diff options
| author | louis <louis.braun@gmx.de> | 2015-06-20 15:54:53 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2015-06-20 15:54:53 +0200 |
| commit | 50fe393724a265341b1745dd401db9d93f46f354 (patch) | |
| tree | 122de23fbe91c298c5df144f4cd41bacb32f92e0 /views/displaymenuitemcurrentview.c | |
| parent | bc075507080607a79c688c5aef4e1c3d895747ac (diff) | |
| download | vdr-plugin-skindesigner-50fe393724a265341b1745dd401db9d93f46f354.tar.gz vdr-plugin-skindesigner-50fe393724a265341b1745dd401db9d93f46f354.tar.bz2 | |
added banner to displaymenuschedulescurrentview and displaymenureplaycurrentview
Diffstat (limited to 'views/displaymenuitemcurrentview.c')
| -rw-r--r-- | views/displaymenuitemcurrentview.c | 66 |
1 files changed, 57 insertions, 9 deletions
diff --git a/views/displaymenuitemcurrentview.c b/views/displaymenuitemcurrentview.c index 6a88067..357543e 100644 --- a/views/displaymenuitemcurrentview.c +++ b/views/displaymenuitemcurrentview.c @@ -32,22 +32,70 @@ void cDisplayMenuItemCurrentView::SetScraperPoster(const cEvent *event, const cR intTokens.insert(pair<string,int>("posterwidth", -1)); intTokens.insert(pair<string,int>("posterheight", -1)); stringTokens.insert(pair<string,string>("posterpath", "")); + intTokens.insert(pair<string,int>("hasbanner", false)); + intTokens.insert(pair<string,int>("bannerwidth", -1)); + intTokens.insert(pair<string,int>("bannerheight", -1)); + stringTokens.insert(pair<string,string>("bannerpath", "")); return; } - ScraperGetPoster call; - call.event = event; - call.recording = recording; - if (pScraper->Service("GetPoster", &call)) { - intTokens.insert(pair<string,int>("hasposter", FileExists(call.poster.path))); - intTokens.insert(pair<string,int>("posterwidth", call.poster.width)); - intTokens.insert(pair<string,int>("posterheight", call.poster.height)); - stringTokens.insert(pair<string,string>("posterpath", call.poster.path)); - } else { + ScraperGetEventType getType; + getType.event = event; + getType.recording = recording; + if (!pScraper->Service("GetEventType", &getType)) { intTokens.insert(pair<string,int>("hasposter", false)); intTokens.insert(pair<string,int>("posterwidth", -1)); intTokens.insert(pair<string,int>("posterheight", -1)); stringTokens.insert(pair<string,string>("posterpath", "")); + intTokens.insert(pair<string,int>("hasbanner", false)); + intTokens.insert(pair<string,int>("bannerwidth", -1)); + intTokens.insert(pair<string,int>("bannerheight", -1)); + stringTokens.insert(pair<string,string>("bannerpath", "")); + return; + } + + if (getType.type == tMovie) { + cMovie movie; + movie.movieId = getType.movieId; + pScraper->Service("GetMovie", &movie); + intTokens.insert(pair<string,int>("hasposter", true)); + stringTokens.insert(pair<string,string>("posterpath", movie.poster.path)); + intTokens.insert(pair<string,int>("posterwidth", movie.poster.width)); + intTokens.insert(pair<string,int>("posterheight", movie.poster.height)); + intTokens.insert(pair<string,int>("hasbanner", false)); + intTokens.insert(pair<string,int>("bannerwidth", -1)); + intTokens.insert(pair<string,int>("bannerheight", -1)); + stringTokens.insert(pair<string,string>("bannerpath", "")); + } else if (getType.type == tSeries) { + cSeries series; + series.seriesId = getType.seriesId; + series.episodeId = getType.episodeId; + pScraper->Service("GetSeries", &series); + //Poster + if (series.posters.size() > 0) { + intTokens.insert(pair<string,int>("hasposter", true)); + intTokens.insert(pair<string,int>("posterwidth", series.posters[0].width)); + intTokens.insert(pair<string,int>("posterheight", series.posters[0].height)); + stringTokens.insert(pair<string,string>("posterpath", series.posters[0].path)); + } else { + intTokens.insert(pair<string,int>("hasposter", false)); + intTokens.insert(pair<string,int>("posterwidth", -1)); + intTokens.insert(pair<string,int>("posterheight", -1)); + stringTokens.insert(pair<string,string>("posterpath", "")); + } + + //Banners + if (series.banners.size() > 0) { + intTokens.insert(pair<string,int>("hasbanner", true)); + intTokens.insert(pair<string,int>("bannerwidth", series.banners[0].width)); + intTokens.insert(pair<string,int>("bannerheight", series.banners[0].height)); + stringTokens.insert(pair<string,string>("bannerpath", series.banners[0].path)); + } else { + intTokens.insert(pair<string,int>("hasbanner", false)); + intTokens.insert(pair<string,int>("bannerwidth", -1)); + intTokens.insert(pair<string,int>("bannerheight", -1)); + stringTokens.insert(pair<string,string>("bannerpath", "")); + } } } |
