diff --git a/pvr.demo/PVRDemoAddonSettings.xml b/pvr.demo/PVRDemoAddonSettings.xml index 8c5f5b2..514a5b0 100644 --- a/pvr.demo/PVRDemoAddonSettings.xml +++ b/pvr.demo/PVRDemoAddonSettings.xml @@ -359,6 +359,7 @@ 32 0 + 11 300 @@ -372,6 +373,12 @@ 48 0 + CC-DD + data/cc-dd.png + ABC + Actor One, Actor Two, Actor Three + Director Name + Writer Name 400 @@ -386,6 +393,10 @@ 64 0 + 9 + A + data/a.png + ABC 500 @@ -398,6 +409,10 @@ 80 0 + 11 + BB + data/bb.png + ABCD 600 @@ -422,6 +437,10 @@ 112 0 + 15 + EEE + data/eee.png + ABCD 800 @@ -434,6 +453,10 @@ 128 0 + 9 + A + data/a.png + ABC 900 @@ -446,6 +469,9 @@ 144 0 + 11 + BB + ABC 1100 @@ -458,6 +484,9 @@ 176 0 + 15 + EEE + data/eee.png @@ -471,6 +500,10 @@ 30 0 + 13 + CC-DD + data/cc-dd.png + ABCD 1600 @@ -495,6 +528,9 @@ 20 0 + BB + data/bb.png + ABC 2400 @@ -507,6 +543,7 @@ 30 0 + 9 1900 @@ -519,6 +556,10 @@ 10 0 + 11 + BB + data/bb.png + ABCD 2000 @@ -543,6 +584,10 @@ 30 0 + 11 + BB + data/bb.png + ÜŤƑ-8-ṰẼŠṮ 2200 @@ -555,6 +600,10 @@ 10 0 + 9 + A + data/a.png + ABC 2300 @@ -567,6 +616,10 @@ 20 0 + 13 + CC-DD + data/cc-dd.png + ABCD 2400 @@ -579,6 +632,10 @@ 30 0 + 11 + BB + data/bb.png + ABCD @@ -600,6 +657,31 @@ 1 1 1 + 9 + A + data/a.png + + + Demo TV Recording entry 11 + Demo TV Recording 11 Episode Name + https://mirrors.kodi.tv/demo-files/BBB/bbb_sunflower_1080p_30fps_normal.mp4 + / + Demo TV Channel 1 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7200 + 0 + 2 + 1 + 1 + 1 + 11 + BB + data/bb.png + ABC Demo TV Recording entry 2 @@ -1194,5 +1276,18 @@ 3 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + + Demo Timer entry #10 + 1 + 13:15 + 14:45 + 1 + SUMMARY Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + PLOT Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 13 + CC-DD + data/cc-dd.png + ABC + diff --git a/pvr.demo/README.md b/pvr.demo/README.md index 0a796d8..0e69519 100644 --- a/pvr.demo/README.md +++ b/pvr.demo/README.md @@ -3,6 +3,7 @@ Dummy data and files to be used with the PVR Demo Add-on. ## Icons There are 11 icons used for the channels. The same icons are used for TV and Radio. +4 icons of various aspect ratios are available for ParentalRatingIcons. ## PVR Channel Data types diff --git a/pvr.demo/addon.xml.in b/pvr.demo/addon.xml.in index 4118921..a7682fd 100644 --- a/pvr.demo/addon.xml.in +++ b/pvr.demo/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.demo/changelog.txt b/pvr.demo/changelog.txt index cbd29f3..bb1d637 100644 --- a/pvr.demo/changelog.txt +++ b/pvr.demo/changelog.txt @@ -1,3 +1,10 @@ +v22.0.0 +- Add support for parentalRatingIcon to EPG events. +- Add support for parentalRatingCode/Icon/Source to timers and recordings. + +v21.1.0 +- Add support for parentalRating and parentalRatingCode to EPG events. + v20.5.0 - Update PVR API 8.0.2 diff --git a/pvr.demo/data/a.png b/pvr.demo/data/a.png new file mode 100644 index 0000000..324a564 Binary files /dev/null and b/pvr.demo/data/a.png differ diff --git a/pvr.demo/data/bb.png b/pvr.demo/data/bb.png new file mode 100644 index 0000000..f9186a3 Binary files /dev/null and b/pvr.demo/data/bb.png differ diff --git a/pvr.demo/data/cc-dd.png b/pvr.demo/data/cc-dd.png new file mode 100644 index 0000000..6f46deb Binary files /dev/null and b/pvr.demo/data/cc-dd.png differ diff --git a/pvr.demo/data/eee.png b/pvr.demo/data/eee.png new file mode 100644 index 0000000..06ef953 Binary files /dev/null and b/pvr.demo/data/eee.png differ diff --git a/src/PVRDemo.cpp b/src/PVRDemo.cpp index b5a5078..6905e57 100644 --- a/src/PVRDemo.cpp +++ b/src/PVRDemo.cpp @@ -58,7 +58,7 @@ PVR_ERROR CPVRDemo::GetCapabilities(kodi::addon::PVRCapabilities& capabilities) PVR_ERROR CPVRDemo::GetBackendName(std::string& name) { - name = "pulse-eight demo pvr add-on"; + name = "Demo PVR Client"; return PVR_ERROR_NO_ERROR; } @@ -125,6 +125,14 @@ PVR_ERROR CPVRDemo::GetEPGForChannel(int channelUid, tag.SetSeriesNumber(myTag.iSeriesNumber); tag.SetEpisodeNumber(myTag.iEpisodeNumber); tag.SetEpisodeName(myTag.strEpisodeName); + tag.SetParentalRating(myTag.iParentalRating); + tag.SetParentalRatingCode(myTag.strParentalRatingCode); + tag.SetParentalRatingIcon(myTag.strParentalRatingIcon); + tag.SetParentalRatingSource(myTag.strParentalRatingSource); + + tag.SetCast(myTag.strCast); + tag.SetDirector(myTag.strDirector); + tag.SetWriter(myTag.strWriter); iLastEndTimeTmp = tag.GetEndTime(); @@ -331,6 +339,10 @@ PVR_ERROR CPVRDemo::GetRecordings(bool deleted, kodi::addon::PVRRecordingsResult /* PVR API 8.0.0 */ kodiRecording.SetClientProviderUid(recording.iProviderId); + kodiRecording.SetParentalRating(recording.iParentalRating); + kodiRecording.SetParentalRatingCode(recording.strParentalRatingCode); + kodiRecording.SetParentalRatingIcon(recording.strParentalRatingIcon); + kodiRecording.SetParentalRatingSource(recording.strParentalRatingSource); results.Add(kodiRecording); } @@ -373,6 +385,10 @@ PVR_ERROR CPVRDemo::GetTimers(kodi::addon::PVRTimersResultSet& results) kodiTimer.SetState(timer.state); kodiTimer.SetTitle(timer.strTitle); kodiTimer.SetSummary(timer.strSummary); + //kodiTimer.SetParentalRating(timer.iParentalRating); + //kodiTimer.SetParentalRatingCode(timer.strParentalRatingCode); + //kodiTimer.SetParentalRatingIcon(timer.strParentalRatingIcon); + //kodiTimer.SetParentalRatingSource(timer.strParentalRatingSource); results.Add(kodiTimer); } @@ -770,6 +786,33 @@ bool CPVRDemo::ScanXMLEpgData(const XMLNode* pEpgNode) /* genre subtype */ XMLGetInt(pEpgNode, "genresubtype", entry.iGenreSubType); + /* parental rating age */ + XMLGetInt(pEpgNode, "parentalrating", entry.iParentalRating); + + /* parental rating code */ + if (XMLGetString(pEpgNode, "parentalratingcode", strTmp)) + entry.strParentalRatingCode = strTmp; + + /* parental rating icon */ + if (XMLGetString(pEpgNode, "parentalratingicon", strTmp)) + entry.strParentalRatingIcon = ClientPath() + strTmp; + + /* parental rating source */ + if (XMLGetString(pEpgNode, "parentalratingsource", strTmp)) + entry.strParentalRatingSource = strTmp; + + /* cast */ + if (XMLGetString(pEpgNode, "cast", strTmp)) + entry.strCast = strTmp; + + /* director */ + if (XMLGetString(pEpgNode, "director", strTmp)) + entry.strDirector = strTmp; + + /* writer */ + if (XMLGetString(pEpgNode, "writer", strTmp)) + entry.strWriter = strTmp; + kodi::Log(ADDON_LOG_DEBUG, "loaded EPG entry '%s' channel '%d' start '%d' end '%d'", entry.strTitle.c_str(), entry.iChannelId, entry.startTime, entry.endTime); @@ -861,6 +904,24 @@ bool CPVRDemo::ScanXMLRecordingData(const XMLNode* pRecordingNode, recording.iProviderId = PVR_PROVIDER_INVALID_UID; XMLGetInt(pRecordingNode, "provider", recording.iProviderId); + /* parental rating age */ + XMLGetInt(pRecordingNode, "parentalrating", recording.iParentalRating); + + /* parental rating code */ + if (XMLGetString(pRecordingNode, "parentalratingcode", strTmp)) + recording.strParentalRatingCode = strTmp; + + /* parental rating icon */ + if (XMLGetString(pRecordingNode, "parentalratingicon", strTmp)) + recording.strParentalRatingIcon = ClientPath() + strTmp; + + /* parental rating source */ + if (XMLGetString(pRecordingNode, "parentalratingsource", strTmp)) + recording.strParentalRatingSource = strTmp; + + kodi::Log(ADDON_LOG_DEBUG, "loaded recording '%s' channel '%d' duration '%d'", + recording.strTitle.c_str(), recording.iChannelId, recording.iDuration); + return true; } @@ -914,6 +975,21 @@ bool CPVRDemo::ScanXMLTimerData(const XMLNode* pTimerNode, PVRDemoTimer& timer) } } + /* parental rating age */ + XMLGetInt(pTimerNode, "parentalrating", timer.iParentalRating); + + /* parental rating code */ + if (XMLGetString(pTimerNode, "parentalratingcode", strTmp)) + timer.strParentalRatingCode = strTmp; + + /* parental rating icon */ + if (XMLGetString(pTimerNode, "parentalratingicon", strTmp)) + timer.strParentalRatingIcon = ClientPath() + strTmp; + + /* parental rating source */ + if (XMLGetString(pTimerNode, "parentalratingsource", strTmp)) + timer.strParentalRatingSource = strTmp; + kodi::Log(ADDON_LOG_DEBUG, "loaded timer '%s' channel '%d' start '%d' end '%d'", timer.strTitle.c_str(), timer.iChannelId, timer.startTime, timer.endTime); return true; diff --git a/src/PVRDemo.h b/src/PVRDemo.h index 9aac110..2409ba1 100644 --- a/src/PVRDemo.h +++ b/src/PVRDemo.h @@ -24,13 +24,19 @@ struct PVRDemoEpgEntry int iGenreType; int iGenreSubType; // time_t firstAired; - // int iParentalRating; + int iParentalRating = 0; // int iStarRating; // bool bNotify; int iSeriesNumber; int iEpisodeNumber; // int iEpisodePartNumber; std::string strEpisodeName; + std::string strParentalRatingCode; + std::string strParentalRatingIcon; + std::string strParentalRatingSource; + std::string strCast; + std::string strDirector; + std::string strWriter; }; struct PVRDemoChannel @@ -67,6 +73,10 @@ struct PVRDemoRecording time_t recordingTime; int iChannelId; int iProviderId; + int iParentalRating = 0; + std::string strParentalRatingCode; + std::string strParentalRatingIcon; + std::string strParentalRatingSource; }; struct PVRDemoTimer @@ -77,6 +87,10 @@ struct PVRDemoTimer PVR_TIMER_STATE state; std::string strTitle; std::string strSummary; + int iParentalRating = 0; + std::string strParentalRatingCode; + std::string strParentalRatingIcon; + std::string strParentalRatingSource; }; struct PVRDemoChannelGroup