diff -Nru kodi-pvr-sledovanitv-cz-1.8.0/debian/changelog kodi-pvr-sledovanitv-cz-1.9.0/debian/changelog --- kodi-pvr-sledovanitv-cz-1.8.0/debian/changelog 2013-05-31 22:59:22.000000000 +0000 +++ kodi-pvr-sledovanitv-cz-1.9.0/debian/changelog 2013-05-31 22:59:22.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-sledovanitv-cz (1.8.0-1~bionic) bionic; urgency=low +kodi-pvr-sledovanitv-cz (1.9.0-1~bionic) bionic; urgency=low [ kodi ] * autogenerated dummy changelog diff -Nru kodi-pvr-sledovanitv-cz-1.8.0/pvr.sledovanitv.cz/addon.xml.in kodi-pvr-sledovanitv-cz-1.9.0/pvr.sledovanitv.cz/addon.xml.in --- kodi-pvr-sledovanitv-cz-1.8.0/pvr.sledovanitv.cz/addon.xml.in 2020-05-19 06:25:44.000000000 +0000 +++ kodi-pvr-sledovanitv-cz-1.9.0/pvr.sledovanitv.cz/addon.xml.in 2020-10-22 10:39:40.000000000 +0000 @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff -Nru kodi-pvr-sledovanitv-cz-1.8.0/src/ApiManager.cpp kodi-pvr-sledovanitv-cz-1.9.0/src/ApiManager.cpp --- kodi-pvr-sledovanitv-cz-1.8.0/src/ApiManager.cpp 2020-05-19 06:25:44.000000000 +0000 +++ kodi-pvr-sledovanitv-cz-1.9.0/src/ApiManager.cpp 2020-10-22 10:39:40.000000000 +0000 @@ -462,7 +462,7 @@ params.emplace_back("time", formatTime(start)); params.emplace_back("duration", smallDuration ? "60" : "1439"); - params.emplace_back("detail", "1"); + params.emplace_back("detail", "description,poster"); params.emplace_back("allowOrder", "1"); if (!channels.empty()) params.emplace_back("channels", std::move(channels)); diff -Nru kodi-pvr-sledovanitv-cz-1.8.0/src/client.cpp kodi-pvr-sledovanitv-cz-1.9.0/src/client.cpp --- kodi-pvr-sledovanitv-cz-1.8.0/src/client.cpp 2020-05-19 06:25:44.000000000 +0000 +++ kodi-pvr-sledovanitv-cz-1.9.0/src/client.cpp 2020-10-22 10:39:40.000000000 +0000 @@ -357,7 +357,7 @@ if (PVR_ERROR_NO_ERROR != ret) return ret; - return FillStreamProperties(data->GetStreamProperties(stream_url, stream_type, false), properties, iPropertiesCount); + return FillStreamProperties(data->StreamProperties(stream_url, stream_type, false), properties, iPropertiesCount); } int GetChannelsAmount(void) @@ -389,7 +389,7 @@ if (PVR_ERROR_NO_ERROR != ret) return ret; - return FillStreamProperties(data->GetStreamProperties(stream_url, stream_type, true), properties, iPropertiesCount); + return FillStreamProperties(data->StreamProperties(stream_url, stream_type, true), properties, iPropertiesCount); } int GetChannelGroupsAmount(void) @@ -464,7 +464,7 @@ if (PVR_ERROR_NO_ERROR != ret) return ret; - return FillStreamProperties(data->GetStreamProperties(stream_url, stream_type, false), properties, iPropertiesCount); + return FillStreamProperties(data->StreamProperties(stream_url, stream_type, false), properties, iPropertiesCount); } /** TIMER FUNCTIONS */ @@ -601,7 +601,11 @@ bool IsRealTimeStream() { - return true; + auto data = std::atomic_load(&m_data); + if (data) + return data->CurrentStreamIsLive(); + + return false; } const char *GetBackendHostname(void) diff -Nru kodi-pvr-sledovanitv-cz-1.8.0/src/Data.cpp kodi-pvr-sledovanitv-cz-1.9.0/src/Data.cpp --- kodi-pvr-sledovanitv-cz-1.8.0/src/Data.cpp 2020-05-19 06:25:44.000000000 +0000 +++ kodi-pvr-sledovanitv-cz-1.9.0/src/Data.cpp 2020-10-22 10:39:40.000000000 +0000 @@ -113,6 +113,7 @@ , m_useAdaptive{cfg.useAdaptive} , m_showLockedChannels{cfg.showLockedChannels} , m_showLockedOnlyPin{cfg.showLockedOnlyPin} + , m_currentStreamIsLive{false} , m_manager{std::move(cfg.userName), std::move(cfg.password), std::move(cfg.deviceId), std::move(cfg.productId)} { @@ -424,6 +425,7 @@ iptventry.startTime = start_time; iptventry.endTime = end_time; iptventry.strEventId = epgEntry.get("eventId", "").asString(); + iptventry.strIconPath = epgEntry.get("poster", "").asString(); std::string availability = epgEntry.get("availability", "none").asString(); iptventry.availableTimeshift = availability == "timeshift" || availability == "pvr"; iptventry.strRecordId = epgEntry["recordId"].asString(); @@ -1231,9 +1233,12 @@ return m_manager.loggedIn(); } -properties_t Data::GetStreamProperties(const std::string & url, const std::string & streamType, bool isLive) const +properties_t Data::StreamProperties(const std::string & url, const std::string & streamType, bool isLive) { static const std::set ADAPTIVE_TYPES = {"mpd", "ism", "hls"}; + + m_currentStreamIsLive = isLive; + properties_t props; props[PVR_STREAM_PROPERTY_STREAMURL] = url; if (m_useAdaptive && 0 < ADAPTIVE_TYPES.count(streamType)) @@ -1246,6 +1251,11 @@ return props; } +bool Data::CurrentStreamIsLive() const +{ + return m_currentStreamIsLive; +} + std::string Data::ChannelsList() const { decltype (m_channels) channels; diff -Nru kodi-pvr-sledovanitv-cz-1.8.0/src/Data.h kodi-pvr-sledovanitv-cz-1.9.0/src/Data.h --- kodi-pvr-sledovanitv-cz-1.8.0/src/Data.h 2020-05-19 06:25:44.000000000 +0000 +++ kodi-pvr-sledovanitv-cz-1.9.0/src/Data.h 2020-10-22 10:39:40.000000000 +0000 @@ -182,7 +182,8 @@ PVR_ERROR DeleteRecord(int iRecordId); PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed); bool LoggedIn() const; - properties_t GetStreamProperties(const std::string & url, const std::string & streamType, bool isLive) const; + properties_t StreamProperties(const std::string & url, const std::string & streamType, bool isLive); + bool CurrentStreamIsLive() const; protected: static int ParseDateTime(std::string strDate); @@ -243,6 +244,9 @@ bool m_showLockedChannels; bool m_showLockedOnlyPin; + // data used only by client(kodi) calling thread + bool m_currentStreamIsLive; + ApiManager m_manager; };