diff --git a/Shoko.Server/API/v1/Implementations/ShokoServiceImplementation/ShokoServiceImplementation_Entities.cs b/Shoko.Server/API/v1/Implementations/ShokoServiceImplementation/ShokoServiceImplementation_Entities.cs index 20c73f183..96688f016 100755 --- a/Shoko.Server/API/v1/Implementations/ShokoServiceImplementation/ShokoServiceImplementation_Entities.cs +++ b/Shoko.Server/API/v1/Implementations/ShokoServiceImplementation/ShokoServiceImplementation_Entities.cs @@ -2200,8 +2200,6 @@ public CL_Response MoveSeries(int animeSeriesID, int newAni ser.MoveSeries(grp); - grp.TopLevelAnimeGroup?.UpdateStatsFromTopLevel(true, true); - var anime = RepoFactory.AniDB_Anime.GetByAnimeID(ser.AniDB_ID); if (anime == null) { diff --git a/Shoko.Server/API/v3/Controllers/SeriesController.cs b/Shoko.Server/API/v3/Controllers/SeriesController.cs index 666183461..60dd2480f 100644 --- a/Shoko.Server/API/v3/Controllers/SeriesController.cs +++ b/Shoko.Server/API/v3/Controllers/SeriesController.cs @@ -1448,8 +1448,6 @@ public ActionResult MoveSeries([FromRoute] int seriesID, [FromRoute] int groupID series.MoveSeries(group); - group.TopLevelAnimeGroup?.UpdateStatsFromTopLevel(true, true); - return Ok(); } diff --git a/Shoko.Server/API/v3/Models/Shoko/Group.cs b/Shoko.Server/API/v3/Models/Shoko/Group.cs index b93b2c40f..48220f586 100644 --- a/Shoko.Server/API/v3/Models/Shoko/Group.cs +++ b/Shoko.Server/API/v3/Models/Shoko/Group.cs @@ -376,7 +376,7 @@ public CreateOrUpdateGroupBody(SVR_AnimeGroup group) // Move the series over to the new group. foreach (var series in seriesList) - series.MoveSeries(group); + series.MoveSeries(group, updateGroupStats: false); // Set the main series and maybe update the group // name/description. diff --git a/Shoko.Server/Models/SVR_AnimeSeries.cs b/Shoko.Server/Models/SVR_AnimeSeries.cs index ec50faf95..1e26f1410 100644 --- a/Shoko.Server/Models/SVR_AnimeSeries.cs +++ b/Shoko.Server/Models/SVR_AnimeSeries.cs @@ -1537,7 +1537,7 @@ public bool Hidden } } - public void MoveSeries(SVR_AnimeGroup newGroup) + public void MoveSeries(SVR_AnimeGroup newGroup, bool updateGroupStats = true) { // Skip moving series if it's already part of the group. if (AnimeGroupID == newGroup.AnimeGroupID) @@ -1548,6 +1548,8 @@ public void MoveSeries(SVR_AnimeGroup newGroup) AnimeGroupID = newGroup.AnimeGroupID; DateTimeUpdated = DateTime.Now; UpdateStats(true, true); + if (updateGroupStats) + newGroup.TopLevelAnimeGroup?.UpdateStatsFromTopLevel(true, true); var oldGroup = RepoFactory.AnimeGroup.GetByID(oldGroupID); if (oldGroup != null)