summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-06-19 16:08:07 +0200
committerchriszero <zerov83@gmail.com>2015-06-19 16:08:07 +0200
commite778dab14f9f1b935aa03d0237bd4958485d3e02 (patch)
treeadf93512f3442effb79b9ebec9b443b681b79e20
parent6db4cc525bed890576f81569c1406cc5f385db7a (diff)
downloadvdr-plugin-plex-e778dab14f9f1b935aa03d0237bd4958485d3e02.tar.gz
vdr-plugin-plex-e778dab14f9f1b935aa03d0237bd4958485d3e02.tar.bz2
Add token {viewoffsetpercent}
-rw-r--r--PVideo.cpp6
-rw-r--r--templates/plug-plex-root.xml1
2 files changed, 6 insertions, 1 deletions
diff --git a/PVideo.cpp b/PVideo.cpp
index f3544b2..504a678 100644
--- a/PVideo.cpp
+++ b/PVideo.cpp
@@ -242,6 +242,10 @@ void Video::AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool c
grid->AddStringToken("studio", m_sStudio);
grid->AddIntToken("viewCount", m_iViewCount);
grid->AddIntToken("viewoffset", m_lViewoffset/1000/60);
+ if(m_iDuration < 0) // avoid division by zero
+ grid->AddIntToken("viewoffsetpercent", 100.0 / m_iDuration * m_lViewoffset);
+ else
+ grid->AddIntToken("viewoffsetpercent", 0);
grid->AddIntToken("duration", m_iDuration/1000/60);
grid->AddIntToken("year", m_iYear);
grid->AddIntToken("viewgroup", m_pParent->m_eViewGroup);
@@ -270,7 +274,7 @@ void Video::AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool c
map<string, string> gernes;
for(auto it = m_vGenre.begin(); it != m_vGenre.end(); it++) {
- roles["genre"] = *it;
+ gernes["genre"] = *it;
}
grid->AddLoopToken("genres", gernes);
diff --git a/templates/plug-plex-root.xml b/templates/plug-plex-root.xml
index d3d09ad..92b99c7 100644
--- a/templates/plug-plex-root.xml
+++ b/templates/plug-plex-root.xml
@@ -101,6 +101,7 @@
{rating} int, starrating 0.0 - 10.0 multiplied by 10 -> 0 - 100
{ratingstring} string, rating formated as double %.1f
{viewoffset} int, minutes, last viewed position
+ {viewoffsetpercent} last viewed position as percent value 0 - 100
{duration} int, minutes, total duration
{orginaltitle} original title
{summary} Description, plot, summary