mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix(debrid/utils): allow season 1 with correct absolute episode to pass validation
This commit is contained in:
@@ -65,14 +65,24 @@ export interface NZBWithSelectedFile extends NZB {
|
||||
|
||||
// helpers
|
||||
export const isSeasonWrong = (
|
||||
parsed: { seasons?: number[] },
|
||||
metadata?: { season?: number }
|
||||
parsed: { seasons?: number[]; episodes?: number[] },
|
||||
metadata?: { season?: number; absoluteEpisode?: number }
|
||||
) => {
|
||||
if (
|
||||
parsed.seasons?.length &&
|
||||
metadata?.season &&
|
||||
!parsed.seasons.includes(metadata.season)
|
||||
) {
|
||||
// allow if season is "wrong" with value of 1 but absolute episode is correct
|
||||
if (
|
||||
parsed.seasons.length === 1 &&
|
||||
parsed.seasons[0] === 1 &&
|
||||
parsed.episodes?.length &&
|
||||
metadata.absoluteEpisode &&
|
||||
parsed.episodes.includes(metadata.absoluteEpisode)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user