Skip to content
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

Merged
merged 1 commit into from Nov 2, 2021
Merged

Optimize episode parser #6379

merged 1 commit into from Nov 2, 2021

Conversation

120318
Copy link
Contributor

@120318 120318 commented Aug 3, 2021

Changes

Issues

Fixes #2839

@@ -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]+)\.([^\\/]*)$"),
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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])?

Copy link
Contributor Author

@120318 120318 Aug 13, 2021

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

Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor

@Artiume Artiume Sep 3, 2021

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

@cvium cvium merged commit a9c3887 into jellyfin:master Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TV-Series episode detection improvement
4 participants