PDA

View Full Version : DVD sort order option for TV-Shows (Scraper request)


anonymous247
2007-07-09, 00:17
Fantastic work on the recent addition of TV show info scrapers. One feature that would be great would be the ability to control the episode sort order to either DVD order or Aired order. thetvdb.com already seems to support such a feature.

Example: I have 4 seasons of Futurama on my file server, and they're stored with episode numbers corresponding to the DVD order. For season 2 and later, these don't correspond at all to the Aired episode numbers.

The query for the futurama episode list seems to be:

http://thetvdb.com/interfaces/GetEpisodes.php?seriesid=73871

To get it sorted in DVD order, it would be:

http://thetvdb.com/interfaces/GetEpisodes.php?seriesid=73871&order=DVD

Such a feature could possibly be controlled by the .nfo file support recently requested, so an individual series could be set as DVD ordered, and the rest default to Aired order.

Thank you.

Gamester17
2007-07-09, 10:57
Which should XBMC default to then? and would this feature be used by anyone (I mean it the time worth the effort)?

PS! I believe the series "Firefly" is another such show which have different order aired-on-TV than on the retail DVD.

spiff
2007-07-09, 11:30
i can say this. i wont waste my time on it.

patch welcome however.

anonymous247
2007-07-09, 18:01
Sorry to hear you think its not worth your time spiff. While capable, for me to get familiar enough with the xbmc codebase that I could:

1) Add a user editable (in GUI) config parameter to indicate the default ordering.
2) Ensuring this parameter is stored in persistent storage (guisettings.xml?) and retrieved on future runs.
3) Add code to find and use an override for the config parameter in the .nfo for a given directory.
4) Pass the sort order value down through the function calls to the point where its an input to the regexps in the scrapers xml files.

To get familiar enough with the codebase to do all of this would take more of my time than I'm willing to give for such a feature. Not because all of these things are especially hard, but rather because I would have to know the existing codebase.

Anyways, like I said before: sorry to hear its not worth your time. Thanks none-the-less for the tv library features you added.

szsori
2007-07-09, 23:45
To do this on your own, just copy the TheTVDB.com scraper and add the order=DVD parameter to the GetEpisode/EpisodeUpdate URL (not sure which one it uses). Rename it to "TheTVDB.com - DVD Order" (or whatever you want) and then set your content to use that one wherever you want.

anonymous247
2007-07-10, 08:55
szsori, thanks for the suggestion. That was a great and simple way to achieve what I wanted. The only hitches I had were:

1) figuring out that I had to escape the ampersand in the XML file twice (instead of using & I had to use &).

2) I had to delete the thumbnail cache and video database file before things would refresh correctly.

After getting past those things, it worked great. I was worried because I was marking content in a parent folder (Video\TV) one way, and in the subfolder (Video\TV\Futurama) another that the two content markings would conflict and cause problems, but so far it seems to have worked just fine.

For reference for anyone else who wants to do this, just do as szsori said, and:

1) create a copy of the tvdb.xml file, name it tvdb_dvdorder.xml
2) edit the copied file and change the 'name' attribute of the 'scraper' element at the very start of the file from "TheTVDB.com" to "TheTVDB.com - DVD Order".
3) Modify the section of the copied file that calls GetEpisodes.php from this:


<RegExp input="$$3" output="&lt;episodeguide&gt;http://thetvdb.com/interfaces/GetEpisodes.php?seriesid=\1&lt;/episodeguide&gt;" dest="4+">
<expression></expression>
</RegExp>


to this:


<RegExp input="$$3" output="&lt;episodeguide&gt;http://thetvdb.com/interfaces/GetEpisodes.php?order=DVD&amp;amp;seriesid=\1&lt;/episodeguide&gt;" dest="4+">
<expression></expression>
</RegExp>

Gamester17
2007-07-10, 09:17
@anonymous247, if you do not want to get 'down and dirty' with the XBMC source code then you can just do what szsori suggest and copy the TheTVDB.com scraper (), re-name that to "TheTVDB.com (Sort as DVD)" or something, add the order=DVD parameter to the GetEpisode/EpisodeUpdate URL (again like szsori sais) just via a normal text-editior like Notepad in Windows. Then you will be able to select that scraper from the GUI.

More information on scrapers can be found here:
http://www.xboxmediacenter.com/wiki/index.php?title=How_To_Write_Media_Info_Scrapers
http://www.xboxmediacenter.com/wiki/index.php?title=Scraper.xml
http://www.xboxmediacenter.com/wiki/index.php?title=Scrap
http://www.xboxmediacenter.com/wiki/index.php?title=How_To_use_Scrapers

Good luck :grin:

jmarshall
2007-07-10, 10:20
I think you must have missed his post Gamester - that's exactly what he did ;)

Gamester17
2007-07-10, 11:55
yepp, sorry I had open it earlier and started replying then I had to run off to do something and I finished answering when I got back, anonymous247 must have replied while I was away.

Typhoid Mary
2007-09-05, 23:50
Thanks for coming back after you figured it out and posting the code anonymous247. Helped me out a ton :)

Gamester17
2007-09-06, 09:55
Feel free to submit that modified "TheTVdb (DVD sort order)" scraper to us as a patch (on our sourceforge.net patch tracker), I think it should be ok to have more than one scraper for each site if they have different properties. We might have to rename the original IMDB scraper to something like "TheTVdb (default) or "TheTVdb(TV sort or)" though to make it clearer.

szsori
2007-09-06, 19:11
We also support various languages, which can be passed as a parameter. However, I think spiff was considering support our userid parameter, which would automatically get the user's correct language. We could also use that to get the desired sort order for each show, return just the favorite banner for each show (if selected), etc. Lots of fun stuff if XBMC can support it. Perhaps tvdb_userid would go into advanced settings and could be appended onto the scraper strings as a parameter if it exists?

szsori
2007-09-06, 19:12
Also, technically it's "The TVDB" (all uppercase TVDB). Not a big deal, but it would forever annoy me if it went in as a patch that way. :)

spiff
2007-09-10, 13:43
perhaps as a temporary solution but i do plan to add support for scraper options to handle this. just not very inspired as its not something i need personally.

others are ofc free to submit a patch in the mean time :P

stryker412
2007-10-20, 04:16
szsori, thanks for the suggestion. That was a great and simple way to achieve what I wanted. The only hitches I had were:

1) figuring out that I had to escape the ampersand in the XML file twice (instead of using &amp; I had to use &amp;amp;).

2) I had to delete the thumbnail cache and video database file before things would refresh correctly.

After getting past those things, it worked great. I was worried because I was marking content in a parent folder (Video\TV) one way, and in the subfolder (Video\TV\Futurama) another that the two content markings would conflict and cause problems, but so far it seems to have worked just fine.

For reference for anyone else who wants to do this, just do as szsori said, and:

1) create a copy of the tvdb.xml file, name it tvdb_dvdorder.xml
2) edit the copied file and change the 'name' attribute of the 'scraper' element at the very start of the file from "TheTVDB.com" to "TheTVDB.com - DVD Order".
3) Modify the section of the copied file that calls GetEpisodes.php from this:


<RegExp input="$$3" output="&lt;episodeguide&gt;http://thetvdb.com/interfaces/GetEpisodes.php?seriesid=\1&lt;/episodeguide&gt;" dest="4+">
<expression></expression>
</RegExp>


to this:


<RegExp input="$$3" output="&lt;episodeguide&gt;http://thetvdb.com/interfaces/GetEpisodes.php?order=DVD&amp;amp;seriesid=\1&lt;/episodeguide&gt;" dest="4+">
<expression></expression>
</RegExp>




Where is the thumbnail cache?

spiff
2007-10-20, 12:48
rtfm

userdata/thumbnails/<section>

how very unlogical and impossible to find by yourself

C-Quel
2008-01-13, 21:24
You can now use scraper settings for thetvdb.com and imdb so when you set content if settings are available for selected source then the settings button becomes active... enter settings and the world is your oyster :)