diff --git a/Shoko.Server/Models/SVR_AnimeSeries.cs b/Shoko.Server/Models/SVR_AnimeSeries.cs index e23ffda00..1cbbdd26f 100644 --- a/Shoko.Server/Models/SVR_AnimeSeries.cs +++ b/Shoko.Server/Models/SVR_AnimeSeries.cs @@ -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;