New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize episode parser #6379
Optimize episode parser #6379
Conversation
@@ -250,6 +250,8 @@ public NamingOptions() | |||
}, | |||
// <!-- foo.ep01, foo.EP_01 --> | |||
new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"), | |||
// <!-- foo.E01., foo.e01. --> | |||
new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this expression differ from the one above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new one solves the case like
The.Legend.of.Condor.Heroes.2017.E07.V2.web-dl.1080p.h264.aac-hdctv.mkv
It's a very common name format in PT,this format offen like: xx.xxx.E01.xxxx.xxx
but the old can't support this format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm asking why your new expression starts with [^\\/]*?()\.?
when the other one starts with [\._ -]()
.
Wouldn't changing the expression above to [\._ -]()[Ee][Pp]?_?([0-9]+)([^\\/]*)$
work just as well (I added ?
after [Pp]
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If use your way, this test case will run failed
[InlineData("Season 2009/Elementary - 2009x03-E15 - Ep Name.mp4", 3)] |
this case will be recognized as episode 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what 2009x03-E15
is supposed to mean. Season 2009 Episode 3, but what is E15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know either what is E15, so I add new one. Do you have a better suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would read it as year 2009, season 3, episode 15 or something like that
Changes
Issues
Fixes #2839