Jump to content

TV Episode Naming Incorrect


cloudstriker83

Recommended Posts

cloudstriker83

Hi,

 

I used iTunes before Emby and so have a TV episode structure in the form of

/TV Show Name/Season 1/01 Episode Name.m4v

according to https://github.com/MediaBrowser/Wiki/wiki/TV-naming#episode-naming-conventions it should be okay, to have episodes named just with episode number and episode name.

 

But it's not working that way. I have the file “The Expanse/Season 2/06 Paradigm Shift.m4v” which results in Emby as an episode named “06 Paradigm Shift” with season number 2 and episode number field blank. So Emby doesn't recognize the “06” as episode number but part of the title.

 

When I rename the file to “S02E06 Paradigm Shift.m4v” everything works fine and i have an episode named “Paradigm Shift” with season number 2 and episode number 6.

 

Do have have to rename ALL of my tv media files to correctly work with Emby because the TV-Naming wiki page is incorrect. Or is there a problem with Emby?

 

I attached both logfiles, one with scanning the libraries with the not working “06 Paradigm Shift.m4v” and one with the working “S02E06 Paradigm Shift.m4v” files.

logfile_incorrect.txt

logfile_working.txt

Link to comment
Share on other sites

I think the actual problem is that the tvdb server is having some difficulty today and is timing out quite a bit. As a result some metadata fetches are failing and that is why you're not getting the proper title.

Link to comment
Share on other sites

cloudstriker83

I noticed tvdb having some performance issues today … but I created the library already on friday. And can reproduce both cases by just renaming the file back and forth. S02E06... scan... working, 06... scan... incorrect, S02E06... scan... working, and so on. Would be a big coincidence if tvdb is alway/only down, when I'm trying to use the “06...” file

Link to comment
Share on other sites

Sorry, i understand you're operating under the assumption that there's an Emby problem but that would a bit of an injustice as it's 100% related to the tvdb server issues.

To prove this, I turned on the MovieDb provider for episode metadata, then I added a new episode using your convention above, and viola, correct title, overview, image, everything.

 

58bc7b642c0ec_Untitled.png

Link to comment
Share on other sites

cloudstriker83

I just disabled tvdb for metadata for tv shows, seasons and episodes and switched to moviedb. I then created a new file for episode 7, which didn't exist as a file before (just to prevent something stuck in some kind of cache).... and: the same problem, even now with moviedb. Episode number is part of the title, episode number field is empty.

 

58bc87c5cae66_Bildschirmfoto20170305um22

 

Then I created another new file for episode 8, but with S02E08 naming and it worked fine.

 

58bc883e642cf_Bildschirmfoto20170305um22

Link to comment
Share on other sites

cloudstriker83

I just copied the “The Expanse” folder into a new “TestFolder” and renamed it to a tv show I don't own. So I have the following structure TestFolder/Two and a Half Men/Season 2/...

The video files still have the names (and inline meta data) of The Expanse, like before, and yet again the only files, Emby seems to correctly recognize are the ones with the S02E0x file names. They get the correct meta data and have the episode numbers in the file info overlay.

I tried this with tvdb as metadata source as well as moviedb as source.

 

So it seems unlikely to me, that this has something to do with tvdb (which by the way is up and running normally right now) as I can reproduce this beviour independent from the data source.

 

With that in mind I disabled all of the metadata sources for tv shows, seasons and episodes. I created a new library and started scanning. And again the same result. There are obviously no images, summaries etc. in the episodes, but while “01 Safe.m4v” is now titled “01 Safe” with a blank episode number:

 

58bca587885a7_T01.png

 

file “S02E06 Paradigm Shift.m4v” is now titled “S02E06 Paradigm Shift” BUT has the correct episode number:

 

58bca592a822f_T06.png

 

And then I noticed something on your screenshot that differed from mind: you used a dash between episode number and episode name. So I renamed the file “01 Safe.m4v” to “01 - Safe.m4v” and this is what I got:

 

58bca71554a21_T01b.png

 

Emby recognized the file as episode 1 of that season. But this is NOT what is mentioned in the naming conventions of the Emby wiki. There is “02 Episode Name.avi” one of the possible filenames (and not “02 - Episode Name.avi”).

Link to comment
Share on other sites

cloudstriker83

Just had a look into https://github.com/MediaBrowser/Emby.Naming/blob/master/MediaBrowser.Naming.Tests/TV/EpisodeNumberTests.cs and it seems that you are only testing those file names with dash between episode number and name (TestEpisodeNumber7, TestEpisodeNumber8, TestEpisodeNumber9) or with only episode number and nothing else (TestEpisodeNumber10) and with episode number followed by dot and space and then episode name (TestEpisodeNumber48). But you are not testing episode number, space, episode name.

Link to comment
Share on other sites

what does your emby library setup look like? where does this folder appear in setup and using what content type?

Link to comment
Share on other sites

Happy2Play

@@Luke  as OP noted all formats except spacing is working.  Tested and episode 02 was not identified.

 

58bcc8862a1c4_spacing.jpg

Edited by Happy2Play
Link to comment
Share on other sites

cloudstriker83

The MediaBrowser.Naming repo says it features the support of all http://kodi.wiki/view/Naming_video_files/TV_shows namings. There you'll find the follwing:

 

\Season #\##

Season [season#] at the end of the directory name, file name starts with [episode#]

 

 

 

I'm not that good in C# but it seems there is no regex for that case in NamingOptions.cs (https://github.com/MediaBrowser/Emby.Naming/blob/master/MediaBrowser.Naming/Common/NamingOptions.cs), so you should add something like:

 

                // "Season 1/01 blah.avi"
                nnew EpisodeExpression(@"[Ss]eason[\._ ](?<seasonnumber>[0-9]+)[\\\/](?<epnumber>\d{1,3})([^\\\/]*)$")
                {
                    IsOptimistic = true, 
                    IsNamed = true
                }

And some test methods in https://github.com/MediaBrowser/Emby.Naming/blob/master/MediaBrowser.Naming.Tests/TV/EpisodeNumberTests.cs

        [TestMethod]
        public void TestEpisodeNumber9991()
        {
            Assert.AreEqual(4, GetEpisodeNumberFromFile(@"The Expanse/Season 2/04 Godspeed.m4v"));
        }
        [TestMethod]
        public void TestEpisodeNumber9992()
        {
            Assert.AreEqual(4, GetEpisodeNumberFromFile(@"The Expanse\Season 2\04 Godspeed.m4v"));
        }
Link to comment
Share on other sites

I thought we removed that convention because it caused problems with episode titles like "12 Angry Men"...

Link to comment
Share on other sites

Ok yes, my mistake. It seems we don't have a regex to cover this scenario.  @@cloudstriker83, your regex sample does work, but can you tweak it a little to handle these failing tests

        [TestMethod]
        public void TestEpisodeNumber58()
        {
            Assert.AreEqual(16, GetEpisodeNumberFromFile(@"Season 2\16 12 Some Title.avi"));
        }

        [TestMethod]
        public void TestEpisodeNumber59()
        {
            Assert.AreEqual(7, GetEpisodeNumberFromFile(@"Season 2\7 12 Angry Men.avi"));
        }

In both cases the episode number is being detected as 12. Thanks.

Link to comment
Share on other sites

cloudstriker83

In both cases the episode number is being detected as 12. Thanks.

 

I'm not sure if the regex is wrong. Maybe it has something to do with the following “Group 3” (see below). Or with the isOptimistic, isNamed options. Or maybe the new regex that is checked before does already match so the new one isn't checked at all (try putting the new regex to the top of the array just to see if it's an order problem). Sorry, but I don't have an Emby dev enviroment running to simply play along with the settings.

 

58bdc7ef0a842_Bildschirmfoto20170306um21

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