mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add --include-chapters flag to archive and download (#301)
This commit is contained in:
parent
9c44fa7dae
commit
56f0ed1795
6 changed files with 272 additions and 191 deletions
|
|
@ -3,7 +3,7 @@ use crate::utils::log::tab_info;
|
|||
use crate::utils::os::{is_special_file, sanitize};
|
||||
use anyhow::Result;
|
||||
use chrono::{Datelike, Duration};
|
||||
use crunchyroll_rs::media::{Resolution, Stream, Subtitle, VariantData};
|
||||
use crunchyroll_rs::media::{Resolution, SkipEvents, Stream, Subtitle, VariantData};
|
||||
use crunchyroll_rs::{Concert, Episode, Locale, MediaCollection, Movie, MusicVideo};
|
||||
use log::{debug, info};
|
||||
use std::cmp::Ordering;
|
||||
|
|
@ -175,6 +175,14 @@ impl SingleFormat {
|
|||
Ok(stream)
|
||||
}
|
||||
|
||||
pub async fn skip_events(&self) -> Result<Option<SkipEvents>> {
|
||||
match &self.source {
|
||||
MediaCollection::Episode(e) => Ok(Some(e.skip_events().await?)),
|
||||
MediaCollection::Movie(m) => Ok(Some(m.skip_events().await?)),
|
||||
_ => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn source_type(&self) -> String {
|
||||
match &self.source {
|
||||
MediaCollection::Episode(_) => "episode",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue