#extension #torrent-name-parser #tnp #privided

tnp-extensions

Simple set of extensions privided for torrent-name-parser

1 unstable release

0.10.1 Mar 11, 2022

#553 in #extension

MIT license

6KB
70 lines

TNPExtension

dependency status

A simple set of extensions to help with the torrent_name_parser crate.

use torrent_name_parser::Metadata;
use tnp_extensions::TNPExtensions;

let m = Metadata::from("narcos.s01e10.1080p.bluray.x264-rovers").unwrap();
println!("first Ep:{}", m.first_episode().unwrap());
println!("last Epi:{}", m.last_episode().unwrap());
println!("is_multi: {}", m.is_mutli_episodes());

let m = Metadata::from("narcos.s01e10e11.1080p.bluray.x264-rovers.srt").unwrap();
println!("first Ep:{}", m.first_episode().unwrap());
println!("last Epi:{}", m.last_episode().unwrap());
println!("is_multi: {}", m.is_mutli_episodes());
println!("is_subtitle: {}", m.is_subtitle());

lib.rs:

A simple crate to provide some convenience methods for the torrent_name_parser crate.

 use torrent_name_parser::Metadata;
 use tnp_extensions::TNPExtensions;

 let m = Metadata::from("narcos.s01e10.1080p.bluray.x264-rovers").unwrap();
 println!("first Ep:{}", m.first_episode().unwrap());
 println!("last Epi:{}", m.last_episode().unwrap());
 println!("is_multi: {}", m.is_mutli_episodes());

 let m = Metadata::from("narcos.s01e10e11.1080p.bluray.x264-rovers.srt").unwrap();
 println!("first Ep:{}", m.first_episode().unwrap());
 println!("last Epi:{}", m.last_episode().unwrap());
 println!("is_multi: {}", m.is_mutli_episodes());
 println!("is_subtitle: {}", m.is_subtitle());

Dependencies

~2.3–3.5MB
~56K SLoC