Skip to content

Commit

Permalink
Fix Saving CommandRequest_DownloadImage for MovieDB
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Oct 5, 2018
1 parent 23e0a08 commit c5c9140
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 34 deletions.
31 changes: 0 additions & 31 deletions Shoko.Server/Commands/CommandRequestImplementation.cs
Expand Up @@ -76,37 +76,6 @@ public string ToXML()
return sb.ToString();
}

public void Save(ISession session)
{
CommandRequest crTemp = RepoFactory.CommandRequest.GetByCommandID(CommandID);
if (crTemp != null)
{
// we will always save mylist watched state changes
// this is because the user may be toggling the status in the client, and we need to process
// them all in the order they were requested
if (CommandType == (int) CommandRequestType.AniDB_UpdateWatchedUDP)
RepoFactory.CommandRequest.Delete(crTemp);
else
return;
}

CommandRequest cri = ToDatabaseObject();
RepoFactory.CommandRequest.SaveWithOpenTransaction(session, cri);

switch (CommandRequestRepository.GetQueueIndex(cri))
{
case 0:
ShokoService.CmdProcessorGeneral.NotifyOfNewCommand();
break;
case 1:
ShokoService.CmdProcessorHasher.NotifyOfNewCommand();
break;
case 2:
ShokoService.CmdProcessorImages.NotifyOfNewCommand();
break;
}
}

public void Save()
{
CommandRequest crTemp = RepoFactory.CommandRequest.GetByCommandID(CommandID);
Expand Down
6 changes: 3 additions & 3 deletions Shoko.Server/Providers/MovieDB/MovieDBHelper.cs
Expand Up @@ -97,7 +97,7 @@ public static void SaveMovieToDatabase(MovieDB_Movie_Result searchResult, bool s
{
CommandRequest_DownloadImage cmd = new CommandRequest_DownloadImage(poster.MovieDB_PosterID,
ImageEntityType.MovieDB_Poster, false);
cmd.Save(session);
cmd.Save();
numPostersDownloaded++;
}
}
Expand Down Expand Up @@ -127,7 +127,7 @@ public static void SaveMovieToDatabase(MovieDB_Movie_Result searchResult, bool s
{
CommandRequest_DownloadImage cmd = new CommandRequest_DownloadImage(fanart.MovieDB_FanartID,
ImageEntityType.MovieDB_FanArt, false);
cmd.Save(session);
cmd.Save();
numFanartDownloaded++;
}
}
Expand Down Expand Up @@ -225,7 +225,7 @@ public static void UpdateMovieInfo(ISession session, int movieID, bool saveImage
}
catch (Exception ex)
{
logger.Error(ex, "Error in ParseBanners: " + ex.ToString());
logger.Error(ex, "Error in UpdateMovieInfo: " + ex);
}
}

Expand Down

0 comments on commit c5c9140

Please sign in to comment.