Folder.jpg source choice

SirloinOfBeef

18-08-2009 20:10:29

Thanks heaps for the folder.jpg function I requested earlier! It works great!
Having said that, I personally prefer to have the DVD covers from thetvdb as my folder.jpgs.
Could we have an option to choose between the various image types available?

Thanks again for your excellent work!

sstteevvee

22-08-2009 10:36:04

Yep, I can make it possible to choose between the banner (used now), poster, or fan art.

SirloinOfBeef

23-08-2009 02:16:58

Awesome!
As a fellow programmer I know just how much effort you must put into this software.
Thanks heaps again for your excellent work.
There's a PayPal donation on its way to you. Enjoy :)

sstteevvee

23-08-2009 23:44:51

The latest alpha (2.2.0a4) now lets you choose in Preferences->Scan Options which to download. If you have existing folder.jpg files (of the banner style), you'll have to manually delete them first.

Thanks for the drink :)

SirloinOfBeef

29-08-2009 00:19:37

Thanks for adding this feature. It works well... however it's not quite what I was wanting. Excellent job though :)
As it is, each season folder within a show downloads the same poster.
I was hoping that each season would download the DVD cover for that season (or Season Banner as TVDB labels it).
I assume though that this would take a lot more coding as it would mean burrowing and scraping beyond the shows top page, so don't stress if it's an effort. The posters still look good :)

sstteevvee

30-08-2009 10:56:56

I'll put down using the season banners for doing later. :)

whiztler

06-10-2009 00:05:37

Hiya,

Does this mean we can include both the folder.jpg and the banner? XBMC also offers the rectangular banners (besides the covers). It would be great if we could do both.

Flain

07-10-2009 23:55:25

Thanks for adding this feature. It works well... however it's not quite what I was wanting. Excellent job though :)
As it is, each season folder within a show downloads the same poster.
I was hoping that each season would download the DVD cover for that season (or Season Banner as TVDB labels it).
I assume though that this would take a lot more coding as it would mean burrowing and scraping beyond the shows top page, so don't stress if it's an effort. The posters still look good :)


I'd like to second this. I noticed the same, i did a del *.folder.jpg /s on my z:\tv directory then used tvrename to fetch them all again. Saw the same thing where the main poster is used and not the season "banners" (which really are DVD style covers). I'm now using tvmetadatafinder to get my folder.jpgs, but would be nice to get rid of it and just use tvrename for everything :). One thing you can also give as an option is to make folder.jpg as a hidden file? As that seems to be what other programs tend to do as default.

On a side note - i reckon on the feature vote page you should allow a "donation vote" so people can donate cash towards features they would prefer to get implemented first :). I appreciate the effort you put into this great app so have no issues with you getting rewarded where possible!

sparky53

24-05-2012 00:15:25

Reposted from http://code.google.com/p/tvrename/issues/detail?id=6

Hey Guys,

This shouldn't be too dificult, from my nose through the code we are already obtaining the ZIP file from TVDB.com

To find the specific season artwork we need to:
1. Download banners.xml for each series (it's in the same location as en.xml that has the series information in it)
Call to GetPageZIP in TheTVDB.cs should do it (may be more efficient to download the zip files onceand use each file from it.)
2. Parse the XML content
3. Scan through each banner in the Banners Collection
4. Search for the banner with the highest rating for 'BannerType'=season; 'BannerType2' = season; 'Language=en'; Season=SeasonId
5. Record the BannerPath for that element
6. save the image for that season for thetvdb.com/banners/<BannerPath>

I'm not a C coder, but do have a bit of background in hacking things together in Java. I have done my best below to produce an example of the code that would find the appropriate season banner. I hope it helps?

Thanks

Mark


in javay pseudocode:

string GetBannerURL(int SeriesId, int TVDBShowId) throws BannerNotFoundException
// seriesId is the number of the series; 1 for series 1 etc
// intSeriesId is the number of the show in TVDB - eg 76290 is for the series called '24'


boolean found = false;
number bestRating =0;
string bestBannerURL ='';

string lang = forceEnglish ? "en" : this.PreferredLanguage(code);
string url = BuildURL(false, episodesToo, code, lang);
text bannerXML = GetPageZIP(url, "banners.xml", true, forceReload)
XMLDocument bannerDocument = ParseXML(bannerXML);

for each (node banner) in bannerDocument
if node.getElement('BannerType') = 'season'
and node.getElement('BannerType2') = 'season'
and node.getElement('Language') = lang
and node.getElement('Season') = SeriesId
then
// we have a valid banner
if found = false then
//We don't have a valid banner so far, let use this one
found = true;
bestRating = node.getElement('Rating')
bestBannerURL = 'http://thetvdb.com/banners/' & node.getElement('BannerPath')
else if node.getElement('Rating') > bestRating
//We have a better quality banner than the current one, update it
bestRating = node.getElement('Rating')
bestBannerURL = 'http://thetvdb.com/banners/' & node.getElement('BannerPath')
else
//Do nothing, we already have a better banner
end if
else
// do nothing, the file contains many other URLs for images
end if
next

if found = false then throw BannerNotFoundException
else
return bestBannerURL


Image Example
http://www.thetvdb.com/banners/seasons/76290-1-6.jpg

XML Example:
<?xml version="1.0" encoding="UTF-8"?>
<Banners>
<Banner>
<id>149801</id>
<BannerPath>seasons/76290-1-6.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>6.7778</Rating>
<RatingCount>9</RatingCount>
<Season>1</Season>