mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-11 00:35:07 +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 { 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 New Issue
Block a user