mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-24 18:41:48 +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,6 +1,7 @@
|
|||||||
import { DetailedMeta, getMetaFromId } from "@/backend/metadata/getmeta";
|
import { DetailedMeta, getMetaFromId } from "@/backend/metadata/getmeta";
|
||||||
import { searchForMedia } from "@/backend/metadata/search";
|
import { searchForMedia } from "@/backend/metadata/search";
|
||||||
import { MWMediaMeta, MWMediaType } from "@/backend/metadata/types";
|
import { MWMediaMeta, MWMediaType } from "@/backend/metadata/types";
|
||||||
|
import { compareTitle } from "@/utils/titleMatch";
|
||||||
import { WatchedStoreData, WatchedStoreItem } from "../types";
|
import { WatchedStoreData, WatchedStoreItem } from "../types";
|
||||||
|
|
||||||
interface OldMediaBase {
|
interface OldMediaBase {
|
||||||
@ -49,10 +50,10 @@ async function getMetas(
|
|||||||
type: item.mediaType,
|
type: item.mediaType,
|
||||||
});
|
});
|
||||||
const relevantItem = data.find((res) =>
|
const relevantItem = data.find((res) =>
|
||||||
yearsAreClose(Number(res.year), year)
|
yearsAreClose(Number(res.year), year) && compareTitle(res.title, item.title)
|
||||||
);
|
);
|
||||||
if (!relevantItem) {
|
if (!relevantItem) {
|
||||||
console.error("No item");
|
console.error("No item found for migration: " + item.title);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user