From f32ddb726d477ea1be41d852932d22b9def83d28 Mon Sep 17 00:00:00 2001 From: chriszero Date: Sun, 1 Mar 2015 18:03:14 +0100 Subject: Fixes incorrect title display --- PVideo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'PVideo.cpp') diff --git a/PVideo.cpp b/PVideo.cpp index 0518afb..a0da43f 100644 --- a/PVideo.cpp +++ b/PVideo.cpp @@ -74,6 +74,7 @@ void Video::Parse(Poco::XML::Node* pNode) Poco::XML::AutoPtr 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")); @@ -117,7 +118,12 @@ std::string Video::GetTitle() std::string res = m_sTitle; switch(m_tType) { case MOVIE: - res = Poco::format("%s (%d)", m_sTitle, m_iYear); + if(m_iYear > 0) { + res = Poco::format("%s (%d)", m_sTitle, m_iYear); + } + else { + res = m_sTitle; + } break; case EPISODE: res = Poco::format("%02dx%02d - %s", m_iParentIndex, m_iIndex, m_sTitle); -- cgit v1.2.3