diff --git a/HISTORY b/HISTORY index 60ace8b..b32becd 100644 --- a/HISTORY +++ b/HISTORY @@ -376,4 +376,5 @@ Version 0.5.3 - added SVG Template parsing - fixed memory leak when creating fonts - fixed crash using animated images in plugins - +- added banner to displaymenuschedulescurrentview and + displaymenureplaycurrentview diff --git a/skinskeleton/xmlfiles/displaymenurecordings.xml b/skinskeleton/xmlfiles/displaymenurecordings.xml index 15037a9..8d961b6 100644 --- a/skinskeleton/xmlfiles/displaymenurecordings.xml +++ b/skinskeleton/xmlfiles/displaymenurecordings.xml @@ -56,7 +56,8 @@ {durationminutes} real duration, rest of minutes {durationevent} duration of corresponding event in minutes {durationeventhours} event duration, full hours - {durationeventminutes} event duration, rest of minutes {new} true if recording is new + {durationeventminutes} event duration, rest of minutes + {new} true if recording is new {cutted} true if recording is cutted {folder} true if item is a folder {numrecordingsfolder} if item is a folder, number of recordings in this folder @@ -65,6 +66,10 @@ {posterwidth} width of scraped poster {posterheight} height of scraped poster {posterpath} absolute path of scraped poster + {hasbanner} true if a scraped banner is available for this element + {bannerwidth} width of scraped banner + {bannerheight} height of scraped banner + {bannerpath} absolute path of scraped banner --> diff --git a/skinskeleton/xmlfiles/displaymenuschedules.xml b/skinskeleton/xmlfiles/displaymenuschedules.xml index 748cbee..f8a4811 100644 --- a/skinskeleton/xmlfiles/displaymenuschedules.xml +++ b/skinskeleton/xmlfiles/displaymenuschedules.xml @@ -78,6 +78,10 @@ {posterwidth} width of scraped poster {posterheight} height of scraped poster {posterpath} absolute path of scraped poster + {hasbanner} true if a scraped banner is available for this element + {bannerwidth} width of scraped banner + {bannerheight} height of scraped banner + {bannerpath} absolute path of scraped banner {timerpartitial} true if partitial timer is set for the event {timerfull} true if full timer is set for the event {whatson} true if menu "What's on" is displayed 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("posterwidth", -1)); intTokens.insert(pair("posterheight", -1)); stringTokens.insert(pair("posterpath", "")); + intTokens.insert(pair("hasbanner", false)); + intTokens.insert(pair("bannerwidth", -1)); + intTokens.insert(pair("bannerheight", -1)); + stringTokens.insert(pair("bannerpath", "")); return; } - ScraperGetPoster call; - call.event = event; - call.recording = recording; - if (pScraper->Service("GetPoster", &call)) { - intTokens.insert(pair("hasposter", FileExists(call.poster.path))); - intTokens.insert(pair("posterwidth", call.poster.width)); - intTokens.insert(pair("posterheight", call.poster.height)); - stringTokens.insert(pair("posterpath", call.poster.path)); - } else { + ScraperGetEventType getType; + getType.event = event; + getType.recording = recording; + if (!pScraper->Service("GetEventType", &getType)) { intTokens.insert(pair("hasposter", false)); intTokens.insert(pair("posterwidth", -1)); intTokens.insert(pair("posterheight", -1)); stringTokens.insert(pair("posterpath", "")); + intTokens.insert(pair("hasbanner", false)); + intTokens.insert(pair("bannerwidth", -1)); + intTokens.insert(pair("bannerheight", -1)); + stringTokens.insert(pair("bannerpath", "")); + return; + } + + if (getType.type == tMovie) { + cMovie movie; + movie.movieId = getType.movieId; + pScraper->Service("GetMovie", &movie); + intTokens.insert(pair("hasposter", true)); + stringTokens.insert(pair("posterpath", movie.poster.path)); + intTokens.insert(pair("posterwidth", movie.poster.width)); + intTokens.insert(pair("posterheight", movie.poster.height)); + intTokens.insert(pair("hasbanner", false)); + intTokens.insert(pair("bannerwidth", -1)); + intTokens.insert(pair("bannerheight", -1)); + stringTokens.insert(pair("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("hasposter", true)); + intTokens.insert(pair("posterwidth", series.posters[0].width)); + intTokens.insert(pair("posterheight", series.posters[0].height)); + stringTokens.insert(pair("posterpath", series.posters[0].path)); + } else { + intTokens.insert(pair("hasposter", false)); + intTokens.insert(pair("posterwidth", -1)); + intTokens.insert(pair("posterheight", -1)); + stringTokens.insert(pair("posterpath", "")); + } + + //Banners + if (series.banners.size() > 0) { + intTokens.insert(pair("hasbanner", true)); + intTokens.insert(pair("bannerwidth", series.banners[0].width)); + intTokens.insert(pair("bannerheight", series.banners[0].height)); + stringTokens.insert(pair("bannerpath", series.banners[0].path)); + } else { + intTokens.insert(pair("hasbanner", false)); + intTokens.insert(pair("bannerwidth", -1)); + intTokens.insert(pair("bannerheight", -1)); + stringTokens.insert(pair("bannerpath", "")); + } } }