diff options
author | louis <louis.braun@gmx.de> | 2014-11-05 17:39:16 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-11-05 17:39:16 +0100 |
commit | 7e7d7c994caa612f8520a772c8dcc964a5207414 (patch) | |
tree | e7619192e90c28bbae01560ea8e3ee70ea593ca3 | |
parent | cf44f2cf4c931470785d0cc8f027c87a5640e2a0 (diff) | |
download | vdr-plugin-skindesigner-7e7d7c994caa612f8520a772c8dcc964a5207414.tar.gz vdr-plugin-skindesigner-7e7d7c994caa612f8520a772c8dcc964a5207414.tar.bz2 |
added dedicated tokens for posters and banners in <srapercontent> in displaychannel and displayreplay
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | skins/metrixhd/xmlfiles/displaychannel.xml | 10 | ||||
-rw-r--r-- | skins/metrixhd/xmlfiles/displayreplay.xml | 10 | ||||
-rw-r--r-- | skinskeleton/xmlfiles/displaychannel.xml | 10 | ||||
-rw-r--r-- | skinskeleton/xmlfiles/displayreplay.xml | 10 | ||||
-rw-r--r-- | views/displaychannelview.c | 36 | ||||
-rw-r--r-- | views/displayreplayview.c | 36 |
7 files changed, 111 insertions, 2 deletions
@@ -55,4 +55,5 @@ Version 0.0.3 menuorg plugin) - fixed Bug with menuselection Patch - added tokens {month}, {monthname} and {year} in displaymenutimers listitem and currentitem +- added dedicated tokens for posters and banners in <srapercontent> in displaychannel and displayreplay diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml index d1148d5..5fb6dc0 100644 --- a/skins/metrixhd/xmlfiles/displaychannel.xml +++ b/skins/metrixhd/xmlfiles/displaychannel.xml @@ -209,6 +209,16 @@ </devices> <!-- Available Variables scrapercontent: + {posterpath} Full Path of Poster to use in image path attribute + {posterwidth} width of poster in pixel + {posterheight} height of poster in pixel + {hasPoster} true if poster is available + {bannerpath} Full Path of banner to use in image path attribute + {bannerwidth} width of banner in pixel + {bannerheight} height of banner in pixel + {hasBanner} true if banner is available + + Use this tokens if you want to display a banner for series and a poster for movies: {mediapath} Full Path of Poster or Banner to use in image path attribute {mediawidth} width of image in pixel {mediaheight} height of image in pixel diff --git a/skins/metrixhd/xmlfiles/displayreplay.xml b/skins/metrixhd/xmlfiles/displayreplay.xml index 244a783..b1d5609 100644 --- a/skins/metrixhd/xmlfiles/displayreplay.xml +++ b/skins/metrixhd/xmlfiles/displayreplay.xml @@ -48,6 +48,16 @@ </datetime> <!-- Available Variables scrapercontent: + {posterpath} Full Path of Poster to use in image path attribute + {posterwidth} width of poster in pixel + {posterheight} height of poster in pixel + {hasPoster} true if poster is available + {bannerpath} Full Path of banner to use in image path attribute + {bannerwidth} width of banner in pixel + {bannerheight} height of banner in pixel + {hasBanner} true if banner is available + + Use this tokens if you want to display a banner for series and a poster for movies: {mediapath} Full Path of Poster or Banner to use in image path attribute {mediawidth} width of image in pixel {mediaheight} height of image in pixel diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml index 49a1630..27fc428 100644 --- a/skinskeleton/xmlfiles/displaychannel.xml +++ b/skinskeleton/xmlfiles/displaychannel.xml @@ -126,6 +126,16 @@ </devices> <!-- Available Variables scrapercontent: + {posterpath} Full Path of Poster to use in image path attribute + {posterwidth} width of poster in pixel + {posterheight} height of poster in pixel + {hasPoster} true if poster is available + {bannerpath} Full Path of banner to use in image path attribute + {bannerwidth} width of banner in pixel + {bannerheight} height of banner in pixel + {hasBanner} true if banner is available + + Use this tokens if you want to display a banner for series and a poster for movies: {mediapath} Full Path of Poster or Banner to use in image path attribute {mediawidth} width of image in pixel {mediaheight} height of image in pixel diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml index b6e4d6d..e9834fc 100644 --- a/skinskeleton/xmlfiles/displayreplay.xml +++ b/skinskeleton/xmlfiles/displayreplay.xml @@ -24,6 +24,16 @@ </datetime> <!-- Available Variables scrapercontent: + {posterpath} Full Path of Poster to use in image path attribute + {posterwidth} width of poster in pixel + {posterheight} height of poster in pixel + {hasPoster} true if poster is available + {bannerpath} Full Path of banner to use in image path attribute + {bannerwidth} width of banner in pixel + {bannerheight} height of banner in pixel + {hasBanner} true if banner is available + + Use this tokens if you want to display a banner for series and a poster for movies: {mediapath} Full Path of Poster or Banner to use in image path attribute {mediawidth} width of image in pixel {mediaheight} height of image in pixel diff --git a/views/displaychannelview.c b/views/displaychannelview.c index 6187753..626658f 100644 --- a/views/displaychannelview.c +++ b/views/displaychannelview.c @@ -328,18 +328,44 @@ void cDisplayChannelView::DrawScraperContent(const cEvent *event) { if (pScraper->Service("GetPosterBanner", &call)) { int mediaWidth = 0; int mediaHeight = 0; - std::string mediaPath = ""; + string mediaPath = ""; bool isBanner = false; + int posterWidth = 0; + int posterHeight = 0; + string posterPath = ""; + bool hasPoster = false; + int bannerWidth = 0; + int bannerHeight = 0; + string bannerPath = ""; + bool hasBanner = false; if ((call.type == tSeries) && call.banner.path.size() > 0) { mediaWidth = call.banner.width; mediaHeight = call.banner.height; mediaPath = call.banner.path; isBanner = true; + bannerWidth = mediaWidth; + bannerHeight = mediaHeight; + bannerPath = mediaPath; + hasBanner = true; + + ScraperGetPoster callPoster; + callPoster.event = event; + callPoster.recording = NULL; + if (pScraper->Service("GetPoster", &callPoster)) { + posterWidth = callPoster.poster.width; + posterHeight = callPoster.poster.height; + posterPath = callPoster.poster.path; + hasPoster = true; + } } else if (call.type == tMovie && call.poster.path.size() > 0 && call.poster.height > 0) { mediaWidth = call.poster.width; mediaHeight = call.poster.height; mediaPath = call.poster.path; + posterWidth = call.poster.width; + posterHeight = call.poster.height; + posterPath = call.poster.path; + hasPoster = true; } else return; @@ -349,6 +375,14 @@ void cDisplayChannelView::DrawScraperContent(const cEvent *event) { intTokens.insert(pair<string,int>("mediaheight", mediaHeight)); intTokens.insert(pair<string,int>("isbanner", isBanner)); stringTokens.insert(pair<string,string>("mediapath", mediaPath)); + intTokens.insert(pair<string,int>("posterwidth", posterWidth)); + intTokens.insert(pair<string,int>("posterheight", posterHeight)); + stringTokens.insert(pair<string,string>("posterpath", posterPath)); + intTokens.insert(pair<string,int>("hasposter", hasPoster)); + intTokens.insert(pair<string,int>("bannerwidth", bannerWidth)); + intTokens.insert(pair<string,int>("bannerheight", bannerHeight)); + stringTokens.insert(pair<string,string>("bannerpath", bannerPath)); + intTokens.insert(pair<string,int>("hasbanner", hasBanner)); ClearViewElement(veScraperContent); DrawViewElement(veScraperContent, &stringTokens, &intTokens); } diff --git a/views/displayreplayview.c b/views/displayreplayview.c index 7c72a90..5777590 100644 --- a/views/displayreplayview.c +++ b/views/displayreplayview.c @@ -141,18 +141,44 @@ void cDisplayReplayView::DrawScraperContent(const cRecording *recording) { if (pScraper->Service("GetPosterBannerV2", &call)) { int mediaWidth = 0; int mediaHeight = 0; - std::string mediaPath = ""; + string mediaPath = ""; bool isBanner = false; + int posterWidth = 0; + int posterHeight = 0; + string posterPath = ""; + bool hasPoster = false; + int bannerWidth = 0; + int bannerHeight = 0; + string bannerPath = ""; + bool hasBanner = false; if ((call.type == tSeries) && call.banner.path.size() > 0) { mediaWidth = call.banner.width; mediaHeight = call.banner.height; mediaPath = call.banner.path; isBanner = true; + bannerWidth = mediaWidth; + bannerHeight = mediaHeight; + bannerPath = mediaPath; + hasBanner = true; + + ScraperGetPoster callPoster; + callPoster.event = NULL; + callPoster.recording = recording; + if (pScraper->Service("GetPoster", &callPoster)) { + posterWidth = callPoster.poster.width; + posterHeight = callPoster.poster.height; + posterPath = callPoster.poster.path; + hasPoster = true; + } } else if (call.type == tMovie && call.poster.path.size() > 0 && call.poster.height > 0) { mediaWidth = call.poster.width; mediaHeight = call.poster.height; mediaPath = call.poster.path; + posterWidth = call.poster.width; + posterHeight = call.poster.height; + posterPath = call.poster.path; + hasPoster = true; } else return; @@ -162,6 +188,14 @@ void cDisplayReplayView::DrawScraperContent(const cRecording *recording) { intTokens.insert(pair<string,int>("mediaheight", mediaHeight)); intTokens.insert(pair<string,int>("isbanner", isBanner)); stringTokens.insert(pair<string,string>("mediapath", mediaPath)); + intTokens.insert(pair<string,int>("posterwidth", posterWidth)); + intTokens.insert(pair<string,int>("posterheight", posterHeight)); + stringTokens.insert(pair<string,string>("posterpath", posterPath)); + intTokens.insert(pair<string,int>("hasposter", hasPoster)); + intTokens.insert(pair<string,int>("bannerwidth", bannerWidth)); + intTokens.insert(pair<string,int>("bannerheight", bannerHeight)); + stringTokens.insert(pair<string,string>("bannerpath", bannerPath)); + intTokens.insert(pair<string,int>("hasbanner", hasBanner)); ClearViewElement(veScraperContent); DrawViewElement(veScraperContent, &stringTokens, &intTokens); } |