From 26ca3ca65c70edf0ea024113ac3b7f361e3be755 Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 19 Jun 2023 17:25:57 +0200 Subject: [PATCH] Remove usage of deprecated functions --- crunchy-cli-core/src/utils/format.rs | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/crunchy-cli-core/src/utils/format.rs b/crunchy-cli-core/src/utils/format.rs index 2f546df..ca7df94 100644 --- a/crunchy-cli-core/src/utils/format.rs +++ b/crunchy-cli-core/src/utils/format.rs @@ -5,7 +5,7 @@ use anyhow::Result; use chrono::Duration; use crunchyroll_rs::media::{Resolution, Stream, Subtitle, VariantData}; use crunchyroll_rs::{Concert, Episode, Locale, MediaCollection, Movie, MusicVideo}; -use log::{debug, info, warn}; +use log::{debug, info}; use std::cmp::Ordering; use std::collections::BTreeMap; use std::path::{Path, PathBuf}; @@ -126,24 +126,8 @@ impl SingleFormat { pub async fn stream(&self) -> Result { let stream = match &self.source { - MediaCollection::Episode(e) => { - if let Ok(stream) = e.legacy_streams().await { - stream - } else { - let stream = e.streams().await?; - warn!("Failed to get stream via legacy endpoint"); - stream - } - } - MediaCollection::Movie(m) => { - if let Ok(stream) = m.legacy_streams().await { - stream - } else { - let stream = m.streams().await?; - warn!("Failed to get stream via legacy endpoint"); - stream - } - } + MediaCollection::Episode(e) => e.streams().await?, + MediaCollection::Movie(m) => m.streams().await?, MediaCollection::MusicVideo(mv) => mv.streams().await?, MediaCollection::Concert(c) => c.streams().await?, _ => unreachable!(),