Jump to content

Contribute to the new file naming project


Luke

Recommended Posts

Team,

 

We have an open action item to improve our file naming parsing. I've decided to create a stand-alone portable class library that can be shared in the community with other apps that need to perform the same functions.

 

I've invited the Sonarr (NzbDrone) project to participate because both Media Browser and Sonarr have similar requirements in regards to parsing files. I am not sure if they will accept or not but nonetheless I think it's a good thing to establish the relationship.

 

So I'm looking for people who would like to contribute. When this is complete, it will become the new file parsing engine of Media Browser Server.

 

Github Repo:

 

https://github.com/MediaBrowser/MediaBrowser.Naming

 

Requirements:

  • Parse video directories into objects containing metadata that can be determined from the file names
  • For movies, extract the name, year, language, 3d format, multi-part info and quality level
  • For episodes, extract all of the above plus episode numbers
  • For subtitle files, extract the language, default and forced flags
  • Support all Kodi movie naming feaures: http://kodi.wiki/view/Naming_video_files/Movies
  • Support all Kodi tv naming features: http://kodi.wiki/view/Naming_video_files/TV_shows
  • The consumer should be able to configure all features in the same way Kodi parsing can be configured, e.g. no fixed, hard-coded algorithms
  • Extract extra files, e.g. trailers, theme songs, etc.
  • Determine the relationship between files, e.g. movie has three parts, three subtitle files, three extra videos
  • Support optional, injectable logging to write to the consumer's logging system
  • Must be unit tested
  • Must be a stand-alone library with zero dependencies
  • Will ultimately be a nuget package

 

Later we can even expand on this to recognize all of the images within a directory and pair them up with the videos they belong to. This is going to be a great tool because it will be a stand-alone library that can used by any media application, for any similar purpose.

  • Like 2
Link to comment
Share on other sites

Beardyname

Great effort @@Luke It's stuff like this that makes me like the MB project even more. (also i might use this instead of trying to write my own parser :D )

Edited by Beardyname
Link to comment
Share on other sites

That site is more something we would use after parsing, to find the correct ID/season/episode for each metadata fetcher. Unfortunately, I just tested it out, and thexem.de does not appear to have very up to date data (newer shows missing or showing no connections), and their source code has not been updated in 2 years. Proper support for this kind of thing is something I have wanted MB to offer for a while, though, and is something I have found we need in order to do a good job of supporting more than a single metadata source for each media type.

 

Something I would like to see added to this parser are provider IDs. In addition to parsing the IDs out of the file name, it would also allow us to support identifying an item by file hash, which many online databases provide.

Link to comment
Share on other sites

CBers

I don't quite understand how thexem re-map episodes, as I've had some re-mapped via sonarr and they are are different to the downloaded files.

Link to comment
Share on other sites

Aphid I'm sure you could probably come up with some unit tests to break it, which will help harden it.

Link to comment
Share on other sites

Well, before considering our implementation, I have one issue with Kodi TV name parser - which is the same one that Sonarr are having. Kodi is incapable of correctly parsing absolute episode numbers > 99 without marking the number with "ep".

 

e.g. It will parse "Series name 102.ext" as season 1, episode 2.

 

This is mostly problematic for anime, where the standard naming format is:

 

[sub group] series name - 102 [720p][tag][tag].ext

 

We have to decide if that regex matches against seasons, or absolute episodes. It seems that Sonarr are planning on using the series metadata to guess which to use. We can push the problem up a level by having MB modify the regexs that it is passing to the parser, but it'll still need to be solved at some point. I would rather not have to rely on the user fiddling around with regexs themselves in an xml settings file, as Kodi does - which also applies the changes globally.

Link to comment
Share on other sites

  • 2 weeks later...

I've started work on tv naming. Good news, it's isolated into the library for now, but when it eventually makes it's way into MBS we'll have full support for daily episode naming, something that currently requires workarounds...

 

 

anything_1996.11.14.ext (3) 

anything_1996-11-14.ext (3)

anything_14.11.1996.ext (4)

Link to comment
Share on other sites

dominicM

I was about to post a topic asking why my movies are not properly indexed, I guess it's because current parsing is lacking. The only difference from the recommended naming and my naming is the lack of brackets around the year. It absolutely should parse it but 90% of the movies are without metadata. Am I  really gonna have to wait for this to be implemented or am I missing something that I can do now? Manually searching would take forever... Granted Kodi has the same issue but is built to get metadata. I even tried plex server and it had no problem but for all it's greatness it's let down by it's chains to plex theater so that's a no go :) Any suggestions appreciated!

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...