Permalink
Browse files

Fix Saving CommandRequest_DownloadImage for MovieDB

  • Loading branch information...
da3dsoul committed Oct 5, 2018
1 parent 23e0a08 commit c5c9140bd35857a1079a5eb0a14b7ef807b0f525
@@ -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);
@@ -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++;
}
}
@@ -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++;
}
}
@@ -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);
}
}

0 comments on commit c5c9140

Please sign in to comment.