diff options
author | chriszero <zerov83@gmail.com> | 2015-02-14 18:53:11 +0100 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-02-14 18:53:11 +0100 |
commit | e412257abf8de4576a180351d24ff07589fa630c (patch) | |
tree | ed020de5c8257545eca66e96997984731ac60379 /PVideo.cpp | |
parent | 20fefdd3f341d6e7f6b15e4926bf5569aa1943d5 (diff) | |
download | vdr-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.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -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 |