diff --git a/addon/index.js b/addon/index.js index 68db5a3..88ab23e 100644 --- a/addon/index.js +++ b/addon/index.js @@ -156,9 +156,7 @@ addon.get("/:catalogChoices?/meta/:type/:id.json", async function (req, res) { if (req.params.id.includes("tmdb:")) { const resp = await cacheWrapMeta(`${language}:${type}:${tmdbId}`, async () => { - return await getMeta(type, language, tmdbId, rpdbkey, { - hideEpisodeThumbnails: config.hideEpisodeThumbnails === "true" - }); + return await getMeta(type, language, tmdbId, rpdbkey, config); }); const cacheOpts = { staleRevalidate: 20 * 24 * 60 * 60, @@ -176,9 +174,7 @@ addon.get("/:catalogChoices?/meta/:type/:id.json", async function (req, res) { const tmdbId = await getTmdb(type, imdbId); if (tmdbId) { const resp = await cacheWrapMeta(`${language}:${type}:${tmdbId}`, async () => { - return await getMeta(type, language, tmdbId, rpdbkey, { - hideEpisodeThumbnails: config.hideEpisodeThumbnails === "true" - }); + return await getMeta(type, language, tmdbId, rpdbkey, config); }); const cacheOpts = { staleRevalidate: 20 * 24 * 60 * 60, diff --git a/addon/lib/getMeta.js b/addon/lib/getMeta.js index 82ccbab..12c1ffd 100644 --- a/addon/lib/getMeta.js +++ b/addon/lib/getMeta.js @@ -63,7 +63,7 @@ const buildMovieResponse = async (res, type, language, tmdbId, rpdbkey, config = ]); const imdbRating = imdbRatingRaw || res.vote_average?.toFixed(1) || "N/A"; - const castCount = config.castCount !== undefined ? Math.max(1, Math.min(5, Number(config.castCount))) : 5; + const castCount = config.castCount const returnImdbId = config.returnImdbId === true || config.returnImdbId === "true"; const hideInCinemaTag = config.hideInCinemaTag === true || config.hideInCinemaTag === "true"; @@ -130,7 +130,7 @@ const buildTvResponse = async (res, type, language, tmdbId, rpdbkey, config = {} ]); const imdbRating = imdbRatingRaw || res.vote_average?.toFixed(1) || "N/A"; - const castCount = config.castCount !== undefined ? Math.max(1, Math.min(5, Number(config.castCount))) : 5; + const castCount = config.castCount const returnImdbId = config.returnImdbId === true || config.returnImdbId === "true"; const hideInCinemaTag = config.hideInCinemaTag === true || config.hideInCinemaTag === "true";