Test & Fix prefer original for /movies/{id}

This commit is contained in:
Zoe Roux
2025-01-17 18:34:53 +01:00
parent 7047304ae5
commit a558f47558
5 changed files with 69 additions and 26 deletions
+7 -3
View File
@@ -109,12 +109,16 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
});
}
set.headers["content-language"] = translation.language;
const ot = ret.originalTranslation;
return {
...ret,
...translation,
...(ret.originalTranslation?.preferOriginal
? ret.originalTranslation
: {}),
...(ot?.preferOriginal && {
...(ot.poster && { poster: ot.poster }),
...(ot.thumbnail && { thumbnail: ot.thumbnail }),
...(ot.banner && { banner: ot.banner }),
...(ot.logo && { logo: ot.logo }),
}),
};
},
{