Struct dim_extern_api::filename::TorrentMetadata
pub struct TorrentMetadata { /* private fields */ }
Implementations§
§impl Metadata
impl Metadata
pub fn from(name: &str) -> Result<Metadata, ErrorMatch>
pub fn from(name: &str) -> Result<Metadata, ErrorMatch>
use torrent_name_parser::Metadata;
if let Ok(m) = Metadata::from("Doctor.Who.(2003).S01E01.avi") {
assert_eq!(m.title(), "Doctor Who");
assert_eq!(m.season(), Some(1));
assert_eq!(m.extension(), Some("avi"));
assert_eq!(m.is_show(), true);
// Season is not 0 (zero) meaning it is not a Season Special. Eg: Christmas Special
assert_eq!(m.is_special(), false);
}
pub fn title(&self) -> &str
pub fn season(&self) -> Option<i32>
pub fn episode(&self) -> Option<i32>
pub fn episodes(&self) -> &Vec<i32, Global> ⓘ
pub fn episodes(&self) -> &Vec<i32, Global> ⓘ
Contains a Vec
of episode numbers detected.
Examples:
No matches -> []
E01
-> [1]
E03e04
-> [3,4]
e03E07
-> [3,4,5,6,7]
pub fn year(&self) -> Option<i32>
pub fn resolution(&self) -> Option<&str>
pub fn quality(&self) -> Option<&str>
pub fn codec(&self) -> Option<&str>
pub fn audio(&self) -> Option<&str>
pub fn group(&self) -> Option<&str>
pub fn country(&self) -> Option<&str>
pub fn imdb_tag(&self) -> Option<&str>
pub fn extended(&self) -> bool
pub fn hardcoded(&self) -> bool
pub fn proper(&self) -> bool
pub fn repack(&self) -> bool
pub fn widescreen(&self) -> bool
pub fn unrated(&self) -> bool
pub fn three_d(&self) -> bool
pub fn extension(&self) -> Option<&str>
pub fn is_show(&self) -> bool
pub fn is_special(&self) -> bool
pub fn language(&self) -> Option<&str>
Trait Implementations§
source§impl FilenameMetadata for TorrentMetadata
impl FilenameMetadata for TorrentMetadata
impl Eq for Metadata
impl StructuralEq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.