From 936ecebb946cbfa22e4bb5d7675b13e58c516889 Mon Sep 17 00:00:00 2001 From: 2small Date: Wed, 14 Aug 2019 15:43:59 +0300 Subject: [PATCH] Add support for sub-title/actor/director/writer --- pvr.iptvsimple/addon.xml.in | 2 +- pvr.iptvsimple/changelog.txt | 3 +++ src/PVRIptvData.cpp | 16 ++++++++++++---- src/PVRIptvData.h | 4 ++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index 14d14456a..9cc1d9418 100644 --- a/pvr.iptvsimple/addon.xml.in +++ b/pvr.iptvsimple/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.iptvsimple/changelog.txt b/pvr.iptvsimple/changelog.txt index 06b3b2ada..b6d669775 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v3.6.0 +- Add support for sub-title/actor/director/writer + v3.5.8 - Fix wrong EPG times due to DST on Windows diff --git a/src/PVRIptvData.cpp b/src/PVRIptvData.cpp index 7e6133ad5..1e1676f13 100644 --- a/src/PVRIptvData.cpp +++ b/src/PVRIptvData.cpp @@ -332,6 +332,14 @@ bool PVRIptvData::LoadEPG(time_t iStart, time_t iEnd) GetNodeValue(pChannelNode, "title", entry.strTitle); GetNodeValue(pChannelNode, "desc", entry.strPlot); GetNodeValue(pChannelNode, "category", entry.strGenreString); + GetNodeValue(pChannelNode, "sub-title", entry.strEpisodeName); + + xml_node<> *pCreditsNode = pChannelNode->first_node("credits"); + if (pCreditsNode != NULL) { + GetNodeValue(pCreditsNode, "actor", entry.strCast); + GetNodeValue(pCreditsNode, "director", entry.strDirector); + GetNodeValue(pCreditsNode, "writer", entry.strWriter); + } xml_node<> *pIconNode = pChannelNode->first_node("icon"); if (pIconNode == NULL || !GetAttributeValue(pIconNode, "src", entry.strIconPath)) @@ -802,9 +810,9 @@ PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL & tag.strPlotOutline = myTag->strPlotOutline.c_str(); tag.strPlot = myTag->strPlot.c_str(); tag.strOriginalTitle = NULL; /* not supported */ - tag.strCast = NULL; /* not supported */ - tag.strDirector = NULL; /* not supported */ - tag.strWriter = NULL; /* not supported */ + tag.strCast = myTag->strCast.c_str(); + tag.strDirector = myTag->strDirector.c_str(); + tag.strWriter = myTag->strWriter.c_str(); tag.iYear = 0; /* not supported */ tag.strIMDBNumber = NULL; /* not supported */ tag.strIconPath = myTag->strIconPath.c_str(); @@ -826,7 +834,7 @@ PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL & tag.iSeriesNumber = 0; /* not supported */ tag.iEpisodeNumber = 0; /* not supported */ tag.iEpisodePartNumber = 0; /* not supported */ - tag.strEpisodeName = NULL; /* not supported */ + tag.strEpisodeName = myTag->strEpisodeName.c_str(); tag.iFlags = EPG_TAG_FLAG_UNDEFINED; PVR->TransferEpgEntry(handle, &tag); diff --git a/src/PVRIptvData.h b/src/PVRIptvData.h index 33cb73a82..df7cede34 100644 --- a/src/PVRIptvData.h +++ b/src/PVRIptvData.h @@ -38,10 +38,14 @@ struct PVRIptvEpgEntry time_t startTime; time_t endTime; std::string strTitle; + std::string strEpisodeName; std::string strPlotOutline; std::string strPlot; std::string strIconPath; std::string strGenreString; + std::string strCast; + std::string strDirector; + std::string strWriter; }; struct PVRIptvEpgChannel