Skip to content

Commit

Permalink
Fix #770;
Browse files Browse the repository at this point in the history
Ensure force add file to MyList overwrites AniDB data
  • Loading branch information
Mik1ll committed May 28, 2019
1 parent 06490f4 commit 6d990eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ public void ForceAddFileToMyList(string hash)
{
try
{
CommandRequest_AddFileToMyList cmdAddFile = new CommandRequest_AddFileToMyList(hash);
CommandRequest_AddFileToMyList cmdAddFile = new CommandRequest_AddFileToMyList(hash, false);
cmdAddFile.Save();
}
catch (Exception ex)
Expand Down
8 changes: 6 additions & 2 deletions Shoko.Server/Commands/AniDB/CommandRequest_AddFileToMyList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public override void ProcessCommand()
bool watched = newWatchedDate != null;

bool watchedLocally = originalWatchedDate != null;
bool watchedChanged = watched != watchedLocally;
bool watchedDifferent = watched != watchedLocally;

if (ReadStates)
{
Expand All @@ -117,16 +117,20 @@ public override void ProcessCommand()
{
vid.ToggleWatchedStatus(true, false, newWatchedDate, false, juser.JMMUserID,
false, false);
watchedLocally = true;
watchedDifferent = false;
}
else if (ServerSettings.Instance.AniDb.MyList_ReadUnwatched && !watched && watchedLocally)
{
vid.ToggleWatchedStatus(false, false, null, false, juser.JMMUserID,
false, false);
watchedLocally = false;
watchedDifferent = false;
}
}

// We should have a MyListID at this point, so hopefully this will prevent looping
if (watchedChanged || state != ServerSettings.Instance.AniDb.MyList_StorageState)
if (watchedDifferent || state != ServerSettings.Instance.AniDb.MyList_StorageState)
{
// if vid.MyListID > 0, isManualLink _should_ always be false, but _should_ isn't good enough
if (vid.MyListID > 0 && !isManualLink)
Expand Down

0 comments on commit 6d990eb

Please sign in to comment.