Jump to content

Episode Name Parsing


rhodges

Recommended Posts

rhodges

Is there a way, in a plugin to parse a filename without adding the file to the library first?

 

Edit: It looks like I could do it if I EpisodePathParser was available for DI in the service library.

 

https://github.com/MediaBrowser/Emby.Naming/blob/fb4c6219f6811fbf61e40de43497c2523a88a4f3/MediaBrowser.Naming.Tests/TV/MultiEpisodeTests.cs

 

I don't think the nuget packages expose that assembly and class.

 

Edit 2: It looks like I can just reference that assembly and bypass DI, but doesn't seem to be the correct way to do it. I'll probably do that for now since this is a private plugin.

Edited by rhodges
Link to comment
Share on other sites

  • 4 weeks later...
rhodges

WIth the latest round of changes, this is no longer working. I know I'm kinda hacking something in that isn't supported, but I'd love to see the parser exposed in a supported method.

var options = new Naming.Common.ExtendedNamingOptions();
var result = new Naming.TV.EpisodePathParser(options, new Naming.Common.RegexProvider()).Parse(request.Name, false, true);

If I passed Season\Hawaii Five-O S07E07.mkv it was returning back the expected results. Now it doesn't parse it.

 

I will look around and see if I can get it working again, if possible.

 

Edit: Disregard. This was completely on me. When I ripped out the service stack references and refactored my code to not use them, I had a bug in how I was calling this service and the name was not being correctly passed to the plugin.  Oooops.

Edited by rhodges
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...