Skip to content

Commit

Permalink
Add catching to parts in RegenerateDB so that the server can at least…
Browse files Browse the repository at this point in the history
… start.
  • Loading branch information
da3dsoul committed Feb 7, 2017
1 parent 8ddf1cb commit f9515b5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
8 changes: 7 additions & 1 deletion JMMServer/Repositories/Cached/AnimeEpisodeRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ public override void RegenerateDb()
if (max <= 0) return;
foreach (AnimeEpisode g in grps)
{
Save(g);
try
{
Save(g);
}
catch (Exception e)
{
}
cnt++;
if (cnt % 10 == 0)
{
Expand Down
9 changes: 8 additions & 1 deletion JMMServer/Repositories/Cached/AnimeSeriesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,14 @@ public override void RegenerateDb()
if (max <= 0) return;
foreach (AnimeSeries s in sers)
{
Save(s, false, false, true);
try
{
Save(s, false, false, true);
}
catch (Exception e)
{

This comment has been minimized.

Copy link
@bigretromike

bigretromike Feb 7, 2017

Contributor

maybe add todo ?:-)

}

cnt++;
if (cnt % 10 == 0)
{
Expand Down
19 changes: 13 additions & 6 deletions JMMServer/Repositories/Cached/VideoLocalRepository.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
Expand Down Expand Up @@ -75,12 +76,18 @@ public override void RegenerateDb()
Save(a, false);
});
//Fix possible paths in filename
Cache.Values.Where(a=>a.FileName.Contains("\\")).ToList().ForEach(a =>
try
{
int b = a.FileName.LastIndexOf("\\");
a.FileName = a.FileName.Substring(b + 1);
Save(a,false);
});
Cache.Values.Where(a=>a.FileName.Contains("\\")).ToList().ForEach(a =>
{
int b = a.FileName.LastIndexOf("\\");
a.FileName = a.FileName.Substring(b + 1);
Save(a,false);
});
}
catch (Exception e)
{
}
}


Expand Down

0 comments on commit f9515b5

Please sign in to comment.