Skip to content

Commit

Permalink
fix: only merge with entries in the same media folder
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Apr 8, 2024
1 parent 041031a commit b1b1c85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Shokofin/MergeVersions/MergeVersionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public async Task MergeAllMovies(IProgress<double> progress, CancellationToken c
// Merge all movies with more than one version.
var movies = GetMoviesFromLibrary();
var duplicationGroups = movies
.GroupBy(x => x.ProviderIds[ShokoEpisodeId.Name])
.GroupBy(x => (x.GetTopParent()?.Path, x.ProviderIds[ShokoEpisodeId.Name]))
.Where(x => x.Count() > 1)
.ToList();
double currentCount = 0d;
Expand Down Expand Up @@ -229,7 +229,7 @@ private async Task SplitAndMergeAllMovies(IProgress<double> progress, Cancellati

// Merge all movies with more than one version (again).
var duplicationGroups = movies
.GroupBy(movie => movie.ProviderIds[ShokoEpisodeId.Name])
.GroupBy(movie => (movie.GetTopParent()?.Path, movie.ProviderIds[ShokoEpisodeId.Name]))
.Where(movie => movie.Count() > 1)
.ToList();
currentCount = 0d;
Expand Down Expand Up @@ -295,7 +295,7 @@ public async Task MergeAllEpisodes(IProgress<double> progress, CancellationToken
// of additional episodes.
var episodes = GetEpisodesFromLibrary();
var duplicationGroups = episodes
.GroupBy(e => $"{e.ProviderIds[ShokoEpisodeId.Name]}-{(e.IndexNumberEnd ?? e.IndexNumber ?? 1) - (e.IndexNumber ?? 1)}")
.GroupBy(e => (e.GetTopParent()?.Path, $"{e.ProviderIds[ShokoEpisodeId.Name]}-{(e.IndexNumberEnd ?? e.IndexNumber ?? 1) - (e.IndexNumber ?? 1)}"))
.Where(e => e.Count() > 1)
.ToList();
double currentCount = 0d;
Expand Down Expand Up @@ -366,7 +366,7 @@ private async Task SplitAndMergeAllEpisodes(IProgress<double> progress, Cancella
// Merge episodes with more than one version (again), and with the same
// number of additional episodes.
var duplicationGroups = episodes
.GroupBy(e => $"{e.ProviderIds[ShokoEpisodeId.Name]}-{(e.IndexNumberEnd ?? e.IndexNumber ?? 1) - (e.IndexNumber ?? 1)}")
.GroupBy(e => (e.GetTopParent()?.Path, $"{e.ProviderIds[ShokoEpisodeId.Name]}-{(e.IndexNumberEnd ?? e.IndexNumber ?? 1) - (e.IndexNumber ?? 1)}"))
.Where(e => e.Count() > 1)
.ToList();
currentCount = 0d;
Expand Down

0 comments on commit b1b1c85

Please sign in to comment.