Skip to content

Commit

Permalink
fix: hard code haruhi '06 for VFS
Browse files Browse the repository at this point in the history
 # <a:thisIsFine:1058294258727145473>
  • Loading branch information
revam committed Jan 10, 2025
1 parent 74e3429 commit 47d598a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Shokofin/Resolvers/VirtualFileSystemService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ private HashSet<string> GetPathsForMediaFolders(IReadOnlyList<MediaFolderConfigu
);
}

private static readonly HashSet<int> AnidbExceptionSet = [
3651, // Suzumiya Haruhi no Yuuutsu (2006)
];

private IEnumerable<(string sourceLocation, string fileId, string seriesId)> GetFilesForImportFolders(IReadOnlyList<MediaFolderConfiguration> mediaConfigs, HashSet<string> fileSet) {
var start = DateTime.UtcNow;
var singleSeriesIds = new HashSet<int>();
Expand Down Expand Up @@ -644,13 +648,14 @@ private HashSet<string> GetPathsForMediaFolders(IReadOnlyList<MediaFolderConfigu
foreach (var (file, sourceLocation) in multiSeriesFiles) {
var seriesIds = file.CrossReferences
.Where(xref => xref.Series.Shoko.HasValue && xref.Episodes.All(e => e.Shoko.HasValue))
.Select(xref => xref.Series.Shoko!.Value.ToString())
.Select(xref => (seriesId: xref.Series.Shoko!.Value.ToString(), anidbId: xref.Series.AniDB))
.Distinct()
.Select(seriesId => (
seriesId,
showIds: ApiManager.GetShowInfosForShokoSeries(seriesId).ConfigureAwait(false).GetAwaiter().GetResult().Select(showInfo => showInfo.Id).ToHashSet()
.Select(tuple => (
tuple.seriesId,
tuple.anidbId,
showIds: ApiManager.GetShowInfosForShokoSeries(tuple.seriesId).ConfigureAwait(false).GetAwaiter().GetResult().Select(showInfo => showInfo.Id).ToHashSet()
))
.Where(tuple => tuple.showIds.Count > 0 && mappedSingleSeriesIds.Overlaps(tuple.showIds))
.Where(tuple => tuple.showIds.Count > 0 && (mappedSingleSeriesIds.Overlaps(tuple.showIds) || AnidbExceptionSet.Contains(tuple.anidbId)))
.Select(tuple => tuple.seriesId)
.ToList();
foreach (var seriesId in seriesIds)
Expand Down

0 comments on commit 47d598a

Please sign in to comment.