mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
more fuzzy matching for migrations
Co-authored-by: Jip Frijlink <JipFr@users.noreply.github.com>
This commit is contained in:
parent
4d4626806d
commit
ad518a6508
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
import { DetailedMeta, getMetaFromId } from "@/backend/metadata/getmeta";
|
||||
import { searchForMedia } from "@/backend/metadata/search";
|
||||
import { MWMediaMeta, MWMediaType } from "@/backend/metadata/types";
|
||||
import { compareTitle } from "@/utils/titleMatch";
|
||||
import { WatchedStoreData, WatchedStoreItem } from "../types";
|
||||
|
||||
interface OldMediaBase {
|
||||
|
@ -49,10 +50,10 @@ async function getMetas(
|
|||
type: item.mediaType,
|
||||
});
|
||||
const relevantItem = data.find((res) =>
|
||||
yearsAreClose(Number(res.year), year)
|
||||
yearsAreClose(Number(res.year), year) && compareTitle(res.title, item.title)
|
||||
);
|
||||
if (!relevantItem) {
|
||||
console.error("No item");
|
||||
console.error("No item found for migration: " + item.title);
|
||||
return;
|
||||
}
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue