Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Fix panic when in anonymously
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedream committed Jun 19, 2024
1 parent 509683d commit 756022b
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions crunchy-cli-core/src/utils/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,23 @@ impl Filter {
eps.retain(|e| e.audio_locale == season_locale)
}

if eps.len() < season.number_of_episodes as usize
&& !(self.audios_missing)(
FilterMediaScope::Episode(vec![eps.first().unwrap(), eps.last().unwrap()]),
vec![&eps.first().unwrap().audio_locale],
)?
{
return Ok(vec![]);
#[allow(clippy::if_same_then_else)]
if eps.len() < season.number_of_episodes as usize {
if eps.is_empty()
&& !(self.audios_missing)(
FilterMediaScope::Season(&season),
season.audio_locales.iter().collect(),
)?
{
return Ok(vec![]);
} else if !eps.is_empty()
&& !(self.audios_missing)(
FilterMediaScope::Episode(vec![eps.first().unwrap(), eps.last().unwrap()]),
vec![&eps.first().unwrap().audio_locale],
)?
{
return Ok(vec![]);
}
}

episodes.extend(eps)
Expand Down

0 comments on commit 756022b

Please sign in to comment.