fix: have script check if no next airing episode
make sure if "trigger latest episode" is enabled, it runs even if no next airing episode for the title
This commit is contained in:
@@ -45,9 +45,6 @@ async function triggerNextEpisodeRoute(titleId: number) {
|
||||
if (!title) {
|
||||
console.error(`Failed to fetch title ${titleId}`);
|
||||
return false;
|
||||
} else if (!title.nextAiringEpisode) {
|
||||
console.log(`Title ${titleId} has no next airing episode`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isDevMode || shouldTriggerLatestEpisode) {
|
||||
@@ -103,11 +100,17 @@ async function triggerNextEpisodeRoute(titleId: number) {
|
||||
console.log(
|
||||
`Triggered next episode route for title ${titleId} (most recent episode)`,
|
||||
);
|
||||
|
||||
if (isDevMode) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!title.nextAiringEpisode) {
|
||||
console.log(`Title ${titleId} has no next airing episode`);
|
||||
return true;
|
||||
}
|
||||
|
||||
return queueTask(
|
||||
process.env,
|
||||
"new-episode",
|
||||
|
||||
Reference in New Issue
Block a user