diff options
| author | Fuwn <[email protected]> | 2024-02-08 22:01:19 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-08 22:01:19 -0800 |
| commit | 74fe41909287ac8b1ca891aac7bc84c08dc5cf77 (patch) | |
| tree | f20c7e6076a9552831634e7db3e8e3a2716ba9be /src/lib | |
| parent | feat(popup): higher z-index (diff) | |
| download | due.moe-74fe41909287ac8b1ca891aac7bc84c08dc5cf77.tar.xz due.moe-74fe41909287ac8b1ca891aac7bc84c08dc5cf77.zip | |
fix(match): exclude known un-subbed media
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/Data/Static/matchExclude.json | 3 | ||||
| -rw-r--r-- | src/lib/Media/Anime/Airing/Subtitled/match.ts | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/Data/Static/matchExclude.json b/src/lib/Data/Static/matchExclude.json new file mode 100644 index 00000000..6cb91eb2 --- /dev/null +++ b/src/lib/Data/Static/matchExclude.json @@ -0,0 +1,3 @@ +[ + "Meitou \"Isekai no Yu\" Kaitaku-ki: AraFou Onsen Mania Tensei-saki wa, Nonbiri Onsen Tengoku Deshita" +] diff --git a/src/lib/Media/Anime/Airing/Subtitled/match.ts b/src/lib/Media/Anime/Airing/Subtitled/match.ts index 1d1f9d76..bad0d20d 100644 --- a/src/lib/Media/Anime/Airing/Subtitled/match.ts +++ b/src/lib/Media/Anime/Airing/Subtitled/match.ts @@ -3,6 +3,7 @@ import type { Media } from '../../../../Data/AniList/media'; import settings from '$stores/settings'; import type { SubsPlease } from '$lib/Media/Anime/Airing/Subtitled/subsPlease'; import stringSimilarity from 'string-similarity'; +import excludeMatch from '$lib/Data/Static/matchExclude.json'; export interface Time { title: string; @@ -56,6 +57,8 @@ const calculateWeightedSimilarity = (title1: string, title2: string): number => }; export const findClosestMatch = (times: Time[], titles: string[]): Time | null => { + if (titles.some((title) => excludeMatch.includes(title))) return null; + let bestMatch: Time | null = null; let bestScore = 0; |