Struct torrent_name_parser::Metadata
source · pub struct Metadata { /* private fields */ }
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn from(name: &str) -> Result<Self, ErrorMatch>
pub fn from(name: &str) -> Result<Self, 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>
sourcepub fn episodes(&self) -> &Vec<i32>
pub fn episodes(&self) -> &Vec<i32>
Contains a Vec
of episode numbers detected.
Examples:
No matches -> []
E01
-> [1]
E03e04
-> [3,4]
e03E07
-> [3,4,5,6,7]