<firstaired> works differently than expected...for me (1 Viewer)

helten

Portal Member
January 11, 2007
17
0
Home Country
Denmark Denmark
Hi,

In the attempt at being clever I have arranged all my series to match this: <series> (<firstaired>)\S<season>\...<episode>...<episode2>....<ext> - fx: 24 (2001)\S06\24.S06E09.Day 6- 2-00 PM - 3-00 PM.avi.

I have made a few regular expressions that perfectly matches all my series with series names, seasons, first aired and episodes.
This is an example of such: ^(?<series>[^\(]+)\((?<firstaired>\d+?)\)\\S(?<season>\d+?)\\.*?((episode\s*)|ep|(s\d{1,2}[-\.\s]?e)|x)(?<episode>\d+)(([-&\+]|e|[-&\+]e|(\s*?&\s*?))(?<episode2>\d{1,2}))?.*?\.(?<ext>[^.]*)$

I only look for series names and season numbers in folders and episodes in the file names.

When running the import and the local files are match against the online data, 99.9% of the episodes can not be auto matched.

If I remove the <firstaired> tag completely everything matches just fine except for Battlestar Galactica that matches to the old series, which is the reason I added the year in the first place.

I then tried to change 24 (2001) to 24 (November 6, 2001), which according the thetvdb.com is the accurate first aired date. This resulted in ALL 24 episodes to be auto matched to the first episode of 24.

My conclusion is of course that <firstaired> actually is used for matching against the air date of the specific episode and not the whole series, as I first thought :p

I can see that thetvdb.com has a <FirstAired> for both a whole series as well as individual episodes (from here Programmers API - TvDBwiki). Is it possible to use the <FirstAired> for a whole series, when matching the series? (and yes, it was a long post to ask this questions ;))

:D (also for a really cool plugin!)
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    MP-TVSeries relies on TheTVdB to provide the data, but also to provide the search engine ability to verify if a show exists.

    It uses the API for this and the way to lookup if a series exists is via the following format:

    Code:
    http://www.thetvdb.com/api/GetSeries.php?seriesname=<series_name>

    Example: http://www.thetvdb.com/api/GetSeries.php?seriesname=Battlestar+2003

    As you can see in the example, you do not even need to use the full title of the show, just enough keywords that will allow a proper match to occur, which for TV shows that share a title would require adding the year the show was first aired.

    So you can either perfectly match whatever <SeriesName>...</SeriesName> shows, or use less words. If MP-TVSeries gets multiple results back, it will show this either via drop down box in config wizard, or via dialog inside GUI.

    Example: http://www.thetvdb.com/api/GetSeries.php?seriesname=Battlestar

    The <firstaired> expression option is meant for Episode matching based on the original airdate the episode was first aired (as per TheTVdB episode airdate info). So you need to focus on just the title and include the year info in that one if there are other shows out with same title.
     

    helten

    Portal Member
    January 11, 2007
    17
    0
    Home Country
    Denmark Denmark
    :D for your reply RoChess!

    I will update my folder naming, so I only keep the year in the cases, where there are multiple series with the same name - like for Battlestar Galactica.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    :D for your reply RoChess!

    I will update my folder naming, so I only keep the year in the cases, where there are multiple series with the same name - like for Battlestar Galactica.

    Yes, and it is confusing sometimes, there have been shows that I know re-used the title of an old show, but because the older show had no entry at TheTVdB, the 'new' show got added without year in it. An example of this would be the new show "Up All Night (2011)", which is simply "Up All Night" at TheTVdB. Adding the year to the search will then actually fail to get a result.

    http://www.thetvdb.com/api/GetSeries.php?seriesname=Up+All+Night

    For this reason a new enhancement is being worked on that will run a secondary search if the first one fails to get any result. It will strip stuff such as '&', 'and', and the year from the search and try again.

    Example on the "Winners & Losers" show:

    WRONG = http://www.thetvdb.com/api/GetSeries.php?seriesname=Winners+and+Losers
    CORRECT = http://www.thetvdb.com/api/GetSeries.php?seriesname=Winners+&+Losers

    EASY SOLUTION = http://www.thetvdb.com/api/GetSeries.php?seriesname=Winners+Losers

    Enjoy.


    PS: You can also use the 'String Replacement' system to correct some of the badly named mediafiles if you are unable (or unwilling) to rename them all.
     

    helten

    Portal Member
    January 11, 2007
    17
    0
    Home Country
    Denmark Denmark
    Yes, and it is confusing sometimes, there have been shows that I know re-used the title of an old show, but because the older show had no entry at TheTVdB, the 'new' show got added without year in it. An example of this would be the new show "Up All Night (2011)", which is simply "Up All Night" at TheTVdB. Adding the year to the search will then actually fail to get a result.
    Yeah this was the reason I wanted to be consistent and always add the year to the folders containing each series.

    When looking at the advanced search interface for thetvdb (Online TV Database - An open directory of television shows for HTPC software) it is easy to search specifically for a series name and year. Would it be possible to utilize this somehow? It does not seem like it is possible to do the same using the GetSeries API (API:GetSeries - TvDBwiki).

    This would of course also require a new tag in the search phrases in the plugin - <series_firstaired> or something like that.

    For this reason a new enhancement is being worked on that will run a secondary search if the first one fails to get any result. It will strip stuff such as '&', 'and', and the year from the search and try again.
    This will definitely make sense!
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    When looking at the advanced search interface for thetvdb (Online TV Database - An open directory of television shows for HTPC software) it is easy to search specifically for a series name and year. Would it be possible to utilize this somehow? It does not seem like it is possible to do the same using the GetSeries API (API:GetSeries - TvDBwiki).

    The MP-TVSeries plugin is totally written around the API system, and scraping the TVDB website direct might cause problems with the owners. So the only 'proper' option would be to ask for an enhancement to the TVDB API system, so that it would be possible to do the following:

    Code:
    http://www.thetvdb.com/api/GetSeries.php?seriesname=<series_name>&year=<year>

    This would then be possible to implement in MP-TVSeries. But I highly doubt it will happen anytime soon, it's been years that a new version of the TVDB website was promised with many updates, but nothing has happened. Of course the existing one does work and the results via MP-TVSeries are still amazing. Adding to that the fact it is all free in the end, I guess we can not complain too much.
     

    Users who are viewing this thread

    Top Bottom