fixr: simplify config usage in getMeta for castCount

- Closes #1210
This commit is contained in:
mrcanelas
2025-08-28 16:00:30 -03:00
parent 19e4ed970b
commit 77ef89c894
2 changed files with 4 additions and 8 deletions
+2 -6
View File
@@ -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,
+2 -2
View File
@@ -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";