Add titleSeparator capture group to series regex
This commit is contained in:
parent
0fa2931a64
commit
a9b4f5960b
2 changed files with 5 additions and 1 deletions
|
@ -12,7 +12,7 @@ use rules::*;
|
|||
use utils::status_icon::*;
|
||||
|
||||
const VIDEO_EXTENSIONS: [&str; 14] = ["mkv", "mp4", "avi", "webm", "mov", "wmv", "flv", "ogg", "ogv", "yuv", "amv", "mpg", "mpeg", "m4v"];
|
||||
const SERIES_REGEX: &str = r"^(?P<title>.+)\sS(?P<season>\d\d)E(?P<episode>\d\d\d?)(E(?P<episode2>\d\d\d?))?((?P<nameSeparator>\s-\s)?(?P<name>.+))?\.(?P<ext>...)$";
|
||||
const SERIES_REGEX: &str = r"^(?P<title>.+)\s(?P<titleSeparator>-\s)?S(?P<season>\d\d)E(?P<episode>\d{2,3})(E(?P<episode2>\d{2,3}))?((?P<nameSeparator>\s-\s)?(?P<name>.+))?\.(?P<ext>...)$";
|
||||
// const FILE_EXT_REGEX: &str = r"^(?P<title>.+)\.(?P<ext>...)$";
|
||||
// const MOVIE_REGEX: &str = r"^(?P<title>.+)\s(?P<year>\(\d{4}\))\s(?P<resolution>\[.+\])\.(?P<ext>...)$";
|
||||
|
||||
|
|
|
@ -6,6 +6,10 @@ use crate::utils::constructors::episode_name;
|
|||
pub struct DashInTitle {}
|
||||
impl Rule for DashInTitle {
|
||||
fn check(_filename: &str, captures: &Captures) -> Option<NonCompliantReason> {
|
||||
if captures.name("titleSeparator").is_some() {
|
||||
return Some(NonCompliantReason::DashInTitle)
|
||||
}
|
||||
|
||||
let title = captures.name("title").unwrap();
|
||||
|
||||
if title.as_str().contains("-") {
|
||||
|
|
Loading…
Reference in a new issue