Try 30 days of free premium.

confused with how to name specials (tv maze kodi scraper)

romanvm wrote 3 years ago: 1

Not sure that I follow, what do you mean with "use episode titles for names"? Do you mean to match (specials) episodes based on the episode title, instead of on number/date? I suppose that should work pretty well too, if that's easier than implementing parsing "2010-01-01.Special".

Yes, I see it as the only viable solution because if a special has the same date as a regular episode then the date match does not work. So I'm adding one more way of matching episodes - by episode title. For example, Lets All Go to Eureka.special.mkv instead of 2010-07-09.special.mkv because s04e01 has the same date so the latter naming is not recognized correctly.

If you want to align with the decision we made on the website (which people seem to be very happy with), you could place significant specials within the actual season (sorted by date), but leave insignificant specials in a separate "season 0".

I'm going to do this in the next version. The only problem I see that Kodi sorts episode items by episode number by default and specials do not have episode number so they will be displayed first. But you can change sorting to airdate in view settings and then they are placed correctly.

 


david wrote 3 years ago: 1

@romanvm wrote:
Yes, I see it as the only viable solution because if a special has the same date as a regular episode then the date match does not work. So I'm adding one more way of matching episodes - by episode title. For example, Lets All Go to Eureka.special.mkv instead of 2010-07-09.special.mkv because s04e01 has the same date so the latter naming is not recognized correctly.

I don't have any knowledge about the Kodi internals, but shouldn't it be equally doable to recognize that it's a special (by the .special. in the filename) and then match it on both airdate and episode_type = special? That would work in all cases except when there are multiple specials on the same day, which is extremely rare I think.

Although I guess matching on episode name would be pretty much equally reliable, provided that you normalize the name properly before comparing.

I'm going to do this in the next version. The only problem I see that Kodi sorts episode items by episode number by default and specials do not have episode number so they will be displayed first. But you can change sorting to airdate in view settings and then they are placed correctly.

Sounds good! Let me know if you need anything from our end.

 

romanvm wrote 3 years ago: 1

I don't have any knowledge about the Kodi internals, but shouldn't it be equally doable to recognize that it's a special (by the .special. in the filename) and then match it on both airdate and episode_type = special? That would work in all cases except when there are multiple specials on the same day, which is extremely rare I think.

The problem is that internally Kodi does not have a "special" property for episodes. Specials are grouped together and shown as specials if they have 0 season number.

 

Smith00101010 wrote 3 years ago: 1

Hi,

I am thinking about implementing specials support for the Jellyfin Plugin and would like to hear your opinion of how I plan to define the filenames to use. In Jellyfin Specials are identified by being marked as Season 0 or being in a "Specials" folder so my code already knows that an episode is a special and to which show it belongs. Then I wanted to allow these ways to specify in your filename, which special it is:

1. The TVmaze ID in brackets e.g. "Special.2013-11-23[14014].mkv". 
There are some cases like http://api.tvmaze.com/shows/210/episodesbydate?date=2013-11-23 where two specials have the exact same air date and time where an ID is a failsafe fallback. As an ID is always a definite indicator it makes sense to use it if it is present and points to an episode in the show I am currently scanning.

2. A date and time in the file name in the "yyyy-MM-ddTHH.mm" format (":" is not allowed in Windows filenames)

3. A date in the filename in the "yyyy-MM-dd" format

If a date or date time matches more than one special the name of the episode and the file name are "normalized" by ignoring different characters used for word separation (' ', '+', '.', '-' and '_') and I check, if the episode name is part of the filename.

A last fallback could be to download all episodes of the show and check if any normalized episode name is contained in the normalized filenames.

What do you think? I would like it if there would be a "TVmaze way" to name specials that works on jellyfin, kodi and all other similar applications.

Kind Regards
Smith 00101010


david wrote 3 years ago: 1

@Smith00101010 wrote:

A last fallback could be to download all episodes of the show and check if any normalized episode name is contained in the normalized filenames.

What do you think? I would like it if there would be a "TVmaze way" to name specials that works on jellyfin, kodi and all other similar applications.

That's a commendable goal, but I'm not sure how realistic it is. For example, you're already deviating from "the TVmaze way" by putting all specials in a separate specials folder, instead of listing significant specials together with the regular episodes of that season.

I wouldn't recommend doing any matching on airtime, because I don't think the accuracy of the airtime property is as high as the rest.

I would indeed match on airdate first and foremost, and only in the very rare scenario where two specials aired on the same day fall back to either TVmaze ID or episode name. :)

 

Smith00101010 wrote 3 years ago: 1

Thanks for your input.

I looked a bit deeper into it and apparently placing specials into their own folder or having a season 0  reference in the filename is a current convention but not technical necessary (in jellyfin). So if I find an episode in a regular season folder I can still handle it as a special, so if people want to follow the TVmaze way of having siginificant specials in the season folder it would still work.

That also means that I do not have to identify specials in a special way, so my approach to identifying any episode would be:

1. If a season and episode number is included in the filename, try to find the episode through that (e.G. "S01E04")

2. If the filename contains a date in "yyyy-MM-dd" format, find all episodes with this airdate

3. If no or more than one episode was found check if the filename contains an TVmaze ID in brackets

4. If still no or more than one episode was found, check if any of the normalized possible episode names are in the normalized filename.

What do you think?


david wrote 3 years ago: 1

That sounds foolproof to me! :)

Smith00101010 wrote 3 years ago: 1

Ok thanks, then I will try to get this way of handling it into the jellyfin plugin

Try 30 days of free premium.