mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Fix interactive season choosing activation on url filter excluded seasons
This commit is contained in:
parent
b65c0e9dfd
commit
13f54c0da6
2 changed files with 11 additions and 5 deletions
|
|
@ -379,7 +379,10 @@ async fn formats_from_series(
|
|||
.locale
|
||||
.iter()
|
||||
.any(|l| s.metadata.audio_locales.contains(l))
|
||||
})
|
||||
});
|
||||
// remove seasons which match the url filter. this is mostly done to not trigger the
|
||||
// interactive season choosing when dupilcated seasons are excluded by the filter
|
||||
seasons.retain(|s| url_filter.is_season_valid(s.metadata.season_number))
|
||||
}
|
||||
|
||||
if !archive.yes && !find_multiple_seasons_with_same_number(&seasons).is_empty() {
|
||||
|
|
|
|||
|
|
@ -349,7 +349,10 @@ async fn formats_from_series(
|
|||
seasons.retain(|s| {
|
||||
s.metadata.season_number != season.first().unwrap().metadata.season_number
|
||||
|| s.metadata.audio_locales.contains(&download.audio)
|
||||
})
|
||||
});
|
||||
// remove seasons which match the url filter. this is mostly done to not trigger the
|
||||
// interactive season choosing when dupilcated seasons are excluded by the filter
|
||||
seasons.retain(|s| url_filter.is_season_valid(s.metadata.season_number))
|
||||
}
|
||||
|
||||
if !download.yes && !find_multiple_seasons_with_same_number(&seasons).is_empty() {
|
||||
|
|
@ -373,14 +376,14 @@ async fn formats_from_season(
|
|||
season: Media<Season>,
|
||||
url_filter: &UrlFilter,
|
||||
) -> Result<Option<Vec<Format>>> {
|
||||
if !season.metadata.audio_locales.contains(&download.audio) {
|
||||
if !url_filter.is_season_valid(season.metadata.season_number) {
|
||||
return Ok(None);
|
||||
} else if !season.metadata.audio_locales.contains(&download.audio) {
|
||||
error!(
|
||||
"Season {} ({}) is not available with {} audio",
|
||||
season.metadata.season_number, season.title, download.audio
|
||||
);
|
||||
return Ok(None);
|
||||
} else if !url_filter.is_season_valid(season.metadata.season_number) {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let mut formats = vec![];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue