Skip to content

Commit

Permalink
fix: unset the default series or main anime when moving series
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Oct 5, 2023
1 parent b7a4123 commit a1b52b7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Shoko.Server/Models/SVR_AnimeSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,24 @@ public void MoveSeries(SVR_AnimeGroup newGroup)
{
oldGroup.DeleteGroup(false);
}
else
{
var updatedOldGroup = false;
if (oldGroup.DefaultAnimeSeriesID.HasValue && oldGroup.DefaultAnimeSeriesID.Value == AnimeSeriesID)
{
oldGroup.DefaultAnimeSeriesID = null;
updatedOldGroup = true;
}

if (oldGroup.MainAniDBAnimeID.HasValue && oldGroup.MainAniDBAnimeID.Value == AniDB_ID)
{
oldGroup.MainAniDBAnimeID = null;
updatedOldGroup = true;
}

if (updatedOldGroup)
RepoFactory.AnimeGroup.Save(oldGroup);
}

// Update the top group
var topGroup = oldGroup.TopLevelAnimeGroup;
Expand Down

0 comments on commit a1b52b7

Please sign in to comment.