summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-05-04 19:55:58 +0200
committerchriszero <zerov83@gmail.com>2015-05-04 19:55:58 +0200
commit56c8a3fbaa9530c17d3a4bbb1852ef5e4b0f3f30 (patch)
tree7b61062ab44c40bacf4c86ad0cac72b6bc7f7614
parentf7196f23bc0ed500dcf1f60b794caa9a9f76a751 (diff)
downloadvdr-plugin-plex-56c8a3fbaa9530c17d3a4bbb1852ef5e4b0f3f30.tar.gz
vdr-plugin-plex-56c8a3fbaa9530c17d3a4bbb1852ef5e4b0f3f30.tar.bz2
Add Token "rating"
-rw-r--r--PVideo.cpp3
-rw-r--r--PVideo.h1
-rw-r--r--templates/plug-plex-root.xml3
-rw-r--r--viewHeader.cpp6
4 files changed, 9 insertions, 4 deletions
diff --git a/PVideo.cpp b/PVideo.cpp
index 73f1837..df602ca 100644
--- a/PVideo.cpp
+++ b/PVideo.cpp
@@ -15,6 +15,7 @@ Video::Video(Poco::XML::Node* pNode, PlexServer* Server, MediaContainer* parent)
{
m_iMyPlayOffset = 0;
m_lViewoffset = 0;
+ m_dRating = 0;
m_pServer = Server;
Parse(pNode);
@@ -96,6 +97,7 @@ void Video::Parse(Poco::XML::Node* pNode)
m_sGrandparentThumb = GetNodeValue(pAttribs->getNamedItem("grandparentThumb"));
m_sGrandparentArt = GetNodeValue(pAttribs->getNamedItem("grandparentArt"));
m_iDuration = GetNodeValueAsLong(pAttribs->getNamedItem("duration"));
+ m_dRating = GetNodeValueAsDouble(pAttribs->getNamedItem("rating"));
m_tAddedAt = GetNodeValueAsTimeStamp(pAttribs->getNamedItem("addedAt"));
m_tUpdatedAt = GetNodeValueAsTimeStamp(pAttribs->getNamedItem("updatedAt"));
@@ -216,6 +218,7 @@ void Video::AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool c
grid->AddStringToken("orginaltitle", m_sOriginalTitle);
grid->AddStringToken("summary", m_sSummary);
grid->AddStringToken("contentrating", m_sContentRating);
+ grid->AddIntToken("rating", m_dRating*10);
grid->AddStringToken("studio", m_sStudio);
grid->AddIntToken("viewCount", m_iViewCount);
grid->AddIntToken("viewoffset", m_lViewoffset/1000/60);
diff --git a/PVideo.h b/PVideo.h
index 7d86aac..92d992a 100644
--- a/PVideo.h
+++ b/PVideo.h
@@ -64,6 +64,7 @@ public:
std::string m_sGrandparentArt;
long m_iDuration;
int m_iViewCount;
+ double m_dRating;
Poco::Timestamp m_tAddedAt;
Poco::Timestamp m_tUpdatedAt;
diff --git a/templates/plug-plex-root.xml b/templates/plug-plex-root.xml
index 3a8d7bf..be631f8 100644
--- a/templates/plug-plex-root.xml
+++ b/templates/plug-plex-root.xml
@@ -80,7 +80,8 @@
If the item is a video following tokens are avaliable
The item is a video if one of the following tokens are set: {ismovie}, {isepisode}
- {contentrating} string, star-rating
+ {contentrating} string, FSK, PEGI
+ {rating} int, starrating 0.0 - 10.0 multiplied by 10 -> 0 - 100, use sprintf and divide by 10
{viewoffset} int, minutes, last viewed position
{duration} int, minutes, total duration
{orginaltitle} original title
diff --git a/viewHeader.cpp b/viewHeader.cpp
index 6471a9e..15cb2c3 100644
--- a/viewHeader.cpp
+++ b/viewHeader.cpp
@@ -22,19 +22,19 @@ void cViewHeader::Draw(cGridElement* elem)
m_pViewElem->AddIntToken("istab1active", 1);
m_pViewElem->AddIntToken("istab2active", 0);
m_pViewElem->AddIntToken("istab3active", 0);
- m_pViewElem->AddStringToken("tab1name", "On Deck");
+ m_pViewElem->AddStringToken("tab1name", tr("On Deck"));
break;
case ePlexMenuTab::pmtRecentlyAdded:
m_pViewElem->AddIntToken("istab1active", 0);
m_pViewElem->AddIntToken("istab2active", 1);
m_pViewElem->AddIntToken("istab3active", 0);
- m_pViewElem->AddStringToken("tab2name", "Recently Added");
+ m_pViewElem->AddStringToken("tab2name", tr("Recently Added"));
break;
case ePlexMenuTab::pmtLibrary:
m_pViewElem->AddIntToken("istab1active", 0);
m_pViewElem->AddIntToken("istab2active", 0);
m_pViewElem->AddIntToken("istab3active", 1);
- m_pViewElem->AddStringToken("tab3name", "Library");
+ m_pViewElem->AddStringToken("tab3name", tr("Library"));
break;
}