Search by tmdbId with movie or tv or series provider aliases

barbarically
This commit is contained in:
IRHM
2025-02-14 01:10:08 +00:00
parent a3847ccb3c
commit 18a30639b9
+14 -2
View File
@@ -198,7 +198,8 @@
let p = spl[0]?.toLowerCase();
switch (p) {
// Default names that are supported right out of the box
case "tmdb":
case "movie": // tmdb id target
case "tv": // tmdb id target
case "imdb":
case "tvdb":
case "youtube":
@@ -227,6 +228,9 @@
case "game":
p = "igdb";
break;
case "series":
p = "tv";
break;
// If none match, then is invalid provider.
default:
console.info("checkForExternalIdSearch: Invalid provider found:", p);
@@ -278,7 +282,15 @@
return;
}
allSearchResults.push(...data);
} else if (extProvider.provider === "tmdb") {
} else if (
extProvider.provider === "tv" ||
extProvider.provider === "movie"
) {
// HACK I can't be bothered doing a test api call here,
// assuming that people paste the id in, this should work
// without the debounce going to an incomplete id.
// Flesh out if anyone has issues.
goto(`/${extProvider.provider}/${extProvider.id}`);
} else {
// Else call tmdb `external id` endpoint
console.log("Search: Performing external id search.");