This commit is contained in:
bytedream 2023-08-25 17:14:44 +02:00
parent e06e6b2b01
commit 3ae6fe4a1a
3 changed files with 6 additions and 4 deletions

View file

@ -213,7 +213,8 @@ async fn get_format(
for single_format in single_formats { for single_format in single_formats {
let stream = single_format.stream().await?; let stream = single_format.stream().await?;
let Some((video, audio)) = variant_data_from_stream(&stream, &archive.resolution).await? else { let Some((video, audio)) = variant_data_from_stream(&stream, &archive.resolution).await?
else {
if single_format.is_episode() { if single_format.is_episode() {
bail!( bail!(
"Resolution ({}) is not available for episode {} ({}) of {} season {}", "Resolution ({}) is not available for episode {} ({}) of {} season {}",

View file

@ -185,7 +185,8 @@ async fn get_format(
single_format: &SingleFormat, single_format: &SingleFormat,
) -> Result<(DownloadFormat, Format)> { ) -> Result<(DownloadFormat, Format)> {
let stream = single_format.stream().await?; let stream = single_format.stream().await?;
let Some((video, audio)) = variant_data_from_stream(&stream, &download.resolution).await? else { let Some((video, audio)) = variant_data_from_stream(&stream, &download.resolution).await?
else {
if single_format.is_episode() { if single_format.is_episode() {
bail!( bail!(
"Resolution ({}) is not available for episode {} ({}) of {} season {}", "Resolution ({}) is not available for episode {} ({}) of {} season {}",

View file

@ -297,8 +297,8 @@ impl Iterator for SingleFormatCollectionIterator {
type Item = Vec<SingleFormat>; type Item = Vec<SingleFormat>;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
let Some((_, episodes)) = self.0.0.iter_mut().next() else { let Some((_, episodes)) = self.0 .0.iter_mut().next() else {
return None return None;
}; };
let value = episodes.pop_first().unwrap().1; let value = episodes.pop_first().unwrap().1;