summaryrefslogtreecommitdiff
path: root/PVideo.cpp
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-02-14 18:53:11 +0100
committerchriszero <zerov83@gmail.com>2015-02-14 18:53:11 +0100
commite412257abf8de4576a180351d24ff07589fa630c (patch)
treeed020de5c8257545eca66e96997984731ac60379 /PVideo.cpp
parent20fefdd3f341d6e7f6b15e4926bf5569aa1943d5 (diff)
downloadvdr-plugin-plex-e412257abf8de4576a180351d24ff07589fa630c.tar.gz
vdr-plugin-plex-e412257abf8de4576a180351d24ff07589fa630c.tar.bz2
Various Fixes0.1.0
Bump Version to frist beta.
Diffstat (limited to 'PVideo.cpp')
-rw-r--r--PVideo.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/PVideo.cpp b/PVideo.cpp
index b186da8..881ffe4 100644
--- a/PVideo.cpp
+++ b/PVideo.cpp
@@ -1,9 +1,10 @@
#include "PVideo.h"
+#include <Poco/Format.h>
namespace plexclient
{
-Video::Video(Poco::XML::Node* pNode, PlexServer Server)
+Video::Video(Poco::XML::Node* pNode, PlexServer Server, MediaContainer* parent)
{
m_iMyPlayOffset = 0;
m_Server = Server;
@@ -16,6 +17,8 @@ Video::Video(Poco::XML::Node* pNode, PlexServer Server)
Poco::XML::AutoPtr<Poco::XML::NamedNodeMap> pAttribs = pNode->attributes();
m_iRatingKey = GetNodeValueAsInt(pAttribs->getNamedItem("ratingKey"));
+ m_iIndex = GetNodeValueAsInt(pAttribs->getNamedItem("index"));
+ m_iParentIndex = GetNodeValueAsInt(pAttribs->getNamedItem("parentIndex"));
m_sKey = GetNodeValue(pAttribs->getNamedItem("key"));
m_sStudio = GetNodeValue(pAttribs->getNamedItem("studio"));
m_tType = GetNodeValueAsMediaType(pAttribs->getNamedItem("type"));
@@ -51,6 +54,25 @@ Video::Video(Poco::XML::Node* pNode, PlexServer Server)
}
pChildNode = it.nextNode();
}
+ if (m_iParentIndex < 0) {
+ m_iParentIndex = parent->m_iParentIndex;
+ }
}
+std::string Video::GetTitle()
+{
+ std::string res = m_sTitle;
+ switch(m_tType) {
+ case MOVIE:
+ res = Poco::format("%s (%d)", m_sTitle, m_iYear);
+ break;
+ case EPISODE:
+ res = Poco::format("%02dx%02d - %s", m_iParentIndex, m_iIndex, m_sTitle);
+ break;
+ default:
+ break;
+ }
+ return res;
}
+
+} // Namespace