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 }),
}),
};
},
{
+4 -5
View File
@@ -26,10 +26,10 @@ export const bubble: SeedMovie = {
thumbnail:
"https://image.tmdb.org/t/p/original/a8Q2g0g7XzAF6gcB8qgn37ccb9Y.jpg",
banner: null,
logo: null,
logo: "https://image.tmdb.org/t/p/original/ihIs7fayAmZieMlMQbs6TWM77uf.png",
trailerUrl: "https://www.youtube.com/watch?v=vs7zsyIZkMM",
},
jp: {
ja: {
name: "バブル:2022",
tagline: null,
description: null,
@@ -37,10 +37,9 @@ export const bubble: SeedMovie = {
tags: ["アニメ"],
poster:
"https://image.tmdb.org/t/p/original/65dad96VE8FJPEdrAkhdsuWMWH9.jpg",
thumbnail:
"https://image.tmdb.org/t/p/original/a8Q2g0g7XzAF6gcB8qgn37ccb9Y.jpg",
thumbnail: "https://image.tmdb.org/t/p/original/jp.jpg",
banner: null,
logo: "https://image.tmdb.org/t/p/original/ihIs7fayAmZieMlMQbs6TWM77uf.png",
logo: null,
trailerUrl: "https://www.youtube.com/watch?v=vs7zsyIZkMM",
},
},