mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Proper error handling for missing original
This commit is contained in:
parent
cca0da4bf6
commit
fd57f506c1
@ -48,6 +48,13 @@ export const seedMovie = async (
|
||||
|
||||
const { translations, videos, collection, studios, ...movie } = seed;
|
||||
const nextRefresh = guessNextRefresh(movie.airDate ?? new Date());
|
||||
const original = translations[movie.originalLanguage];
|
||||
if (!original) {
|
||||
return {
|
||||
status: 422,
|
||||
message: "No translation available in the original language.",
|
||||
};
|
||||
}
|
||||
|
||||
const col = await insertCollection(collection, {
|
||||
kind: "movie",
|
||||
@ -55,7 +62,6 @@ export const seedMovie = async (
|
||||
...seed,
|
||||
});
|
||||
|
||||
const original = translations[movie.originalLanguage];
|
||||
const show = await insertShow(
|
||||
{
|
||||
kind: "movie",
|
||||
|
@ -83,6 +83,13 @@ export const seedSerie = async (
|
||||
...serie
|
||||
} = seed;
|
||||
const nextRefresh = guessNextRefresh(serie.startAir ?? new Date());
|
||||
const original = translations[serie.originalLanguage];
|
||||
if (!original) {
|
||||
return {
|
||||
status: 422,
|
||||
message: "No translation available in the original language.",
|
||||
};
|
||||
}
|
||||
|
||||
const col = await insertCollection(collection, {
|
||||
kind: "serie",
|
||||
@ -90,7 +97,6 @@ export const seedSerie = async (
|
||||
...seed,
|
||||
});
|
||||
|
||||
const original = translations[serie.originalLanguage];
|
||||
const show = await insertShow(
|
||||
{
|
||||
kind: "serie",
|
||||
|
Loading…
x
Reference in New Issue
Block a user