mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Fix japanese episode download if episode isn't available in specified language with archive (#207)
This commit is contained in:
parent
b24827dc6b
commit
4bd172df06
1 changed files with 28 additions and 1 deletions
|
|
@ -129,7 +129,34 @@ impl Filter for ArchiveFilter {
|
|||
|
||||
let mut episodes = vec![];
|
||||
for season in seasons {
|
||||
episodes.extend(season.episodes().await?)
|
||||
let season_locale = season
|
||||
.audio_locales
|
||||
.get(0)
|
||||
.cloned()
|
||||
.unwrap_or(Locale::ja_JP);
|
||||
let mut eps = season.episodes().await?;
|
||||
let before_len = eps.len();
|
||||
eps.retain(|e| e.audio_locale == season_locale);
|
||||
if eps.len() != before_len {
|
||||
if eps.len() == 0 {
|
||||
if matches!(self.visited, Visited::Series) {
|
||||
warn!(
|
||||
"Season {} is not available with {} audio",
|
||||
season.season_number, season_locale
|
||||
)
|
||||
}
|
||||
} else {
|
||||
let last_episode = eps.last().unwrap();
|
||||
warn!(
|
||||
"Season {} is only available with {} audio until episode {} ({})",
|
||||
season.season_number,
|
||||
season_locale,
|
||||
last_episode.episode_number,
|
||||
last_episode.title
|
||||
)
|
||||
}
|
||||
}
|
||||
episodes.extend(eps)
|
||||
}
|
||||
|
||||
if Format::has_relative_episodes_fmt(&self.archive.output) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue