Addressed comments

This commit is contained in:
capak07
2024-03-04 21:30:02 -04:00
parent 8a3155999b
commit bbb39a3aa7

View File

@@ -1,12 +1,12 @@
import { CommonMedia } from '@/entrypoint/utils/media'; import { CommonMedia } from '@/entrypoint/utils/media';
export function normalizeTitle(title: string): string { export function normalizeTitle(title: string): string {
let titleTrimmed = title.trim(); let titleTrimmed = title.trim().toLowerCase();
if (titleTrimmed !== "The Movie" && titleTrimmed.endsWith("The Movie")) { if (((titleTrimmed !== "the movie" && titleTrimmed.endsWith("the movie")) ||
titleTrimmed = titleTrimmed.replace("The Movie", ""); (titleTrimmed !== "the series" && titleTrimmed.endsWith("the series")))) {
titleTrimmed = titleTrimmed.replace("the movie", "");
} }
return titleTrimmed return titleTrimmed
.toLowerCase()
.replace(/['":]/g, "") .replace(/['":]/g, "")
.replace(/[^a-zA-Z0-9]+/g, "_"); .replace(/[^a-zA-Z0-9]+/g, "_");
} }