Skip to content

Commit

Permalink
chore: make hash set static
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Feb 5, 2025
1 parent 0798edb commit 985bb12
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Shoko.Server/Providers/TMDB/TmdbLinkingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ public class TmdbLinkingService
{ '“', '"' },
};

private static readonly HashSet<string> _titlesToSearch = new(StringComparer.InvariantCultureIgnoreCase)
{
"OAD",
"OVA",
"Short Movie",
"Special",
"TV Special",
"Web"
};

private readonly ILogger<TmdbLinkingService> _logger;

private readonly ISchedulerFactory _schedulerFactory;
Expand Down Expand Up @@ -809,8 +819,7 @@ private CrossRef_AniDB_TMDB_Episode TryFindAnidbAndTmdbMatch(SVR_AniDB_Anime ani
return new(anidbEpisode.EpisodeID, anidbEpisode.AnimeID, 0, 0, MatchRating.SarahJessicaParker);

// Fix up the title for the first/single episode of a few anime types.
var titlesToSearch = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase) { "OAD", "OVA", "Short Movie", "Special", "TV Special", "Web" };
if (!string.IsNullOrEmpty(anidbTitle) && titlesToSearch.Contains(anidbTitle))
if (!string.IsNullOrEmpty(anidbTitle) && _titlesToSearch.Contains(anidbTitle))
{
var englishAnimeTitle = anime.Titles.FirstOrDefault(title => title.TitleType == TitleType.Official && title.Language == TitleLanguage.English)?.Title;
if (englishAnimeTitle is not null)
Expand Down

0 comments on commit 985bb12

Please sign in to comment.