diff --git a/README.md b/README.md index da80f42fb..2cc06d3a8 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ General settings required for the addon to function. * **Custom Radio Groups file**: The file used to load the custom Radio groups (groups). The default file is `customRadioGroups-example.xml`. Details on how to customise can be found in the next section of the README. ### EPG -Settings related to the EPG. +Settings related to the EPG. Note that Kodi will only load the EPG data when it needs to. The add-on will force a load of the EPG data regardless of whether or not Kodi requests it if either catchup is enabled or XMLTV logos are required. For settings related to genres please see the next section. diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index 6fbe2b3cf..151e87d5c 100644 --- a/pvr.iptvsimple/addon.xml.in +++ b/pvr.iptvsimple/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ @@ -169,6 +169,10 @@ icon.png +v7.6.2 +- Fixed: Allow catchup correction (timezone shift) when live URLs have catchup placeholders +- Fixed: Always load EPG data if we prefer XMLTV logos or catchup is enabled + v7.6.1 - Fixed: Allow ignoring M3U logos when using local logo path diff --git a/pvr.iptvsimple/changelog.txt b/pvr.iptvsimple/changelog.txt index 924964c07..3820c021d 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,7 @@ +v7.6.2 +- Fixed: Allow catchup correction (timezone shift) when live URLs have catchup placeholders +- Fixed: Always load EPG data if we prefer XMLTV logos or catchup is enabled + v7.6.1 - Fixed: Allow ignoring M3U logos when using local logo path diff --git a/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po b/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po index cd4f8a31c..8fbd41bbe 100644 --- a/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po +++ b/pvr.iptvsimple/resources/language/resource.language.en_gb/strings.po @@ -692,7 +692,7 @@ msgstr "" #. help-category: EPG Settings msgctxt "#30620" -msgid "Settings related to the EPG." +msgid "Settings related to the EPG. Note that Kodi will only load the EPG data when it needs to. The add-on will force a load of the EPG data regardless of whether or not Kodi requests it if either catchup is enabled or XMLTV logos are required." msgstr "" #. help: EPG Settings - epgPathType diff --git a/src/PVRIptvData.cpp b/src/PVRIptvData.cpp index b5857fccc..2f27b4554 100644 --- a/src/PVRIptvData.cpp +++ b/src/PVRIptvData.cpp @@ -191,7 +191,7 @@ PVR_ERROR PVRIptvData::GetChannelStreamProperties(const kodi::addon::PVRChannel& if (!catchupUrl.empty()) streamURL = catchupUrl; else - streamURL = m_catchupController.ProcessStreamUrl(streamURL); + streamURL = m_catchupController.ProcessStreamUrl(m_currentChannel); StreamUtils::SetAllStreamProperties(properties, m_currentChannel, streamURL, catchupUrl.empty(), catchupProperties); diff --git a/src/iptvsimple/CatchupController.cpp b/src/iptvsimple/CatchupController.cpp index e467c89f6..fcf5697d8 100644 --- a/src/iptvsimple/CatchupController.cpp +++ b/src/iptvsimple/CatchupController.cpp @@ -378,10 +378,10 @@ std::string FormatDateTime(time_t timeStart, time_t duration, const std::string return formattedUrl; } -std::string FormatDateTimeNowOnly(const std::string &urlFormatString) +std::string FormatDateTimeNowOnly(const std::string &urlFormatString, int timezoneShiftSecs) { std::string formattedUrl = urlFormatString; - const time_t timeNow = std::time(0); + const time_t timeNow = std::time(0) - timezoneShiftSecs; std::tm dateTimeNow = SafeLocaltime(timeNow); FormatUtc("{lutc}", timeNow, formattedUrl); @@ -425,7 +425,7 @@ std::string BuildEpgTagUrl(time_t startTime, time_t duration, const Channel& cha if ((startTime > 0 && offset < (timeNow - 5)) || (channel.IgnoreCatchupDays() && !programmeCatchupId.empty())) startTimeUrl = FormatDateTime(offset - timezoneShiftSecs, duration, channel.GetCatchupSource()); else - startTimeUrl = FormatDateTimeNowOnly(channel.GetStreamURL()); + startTimeUrl = FormatDateTimeNowOnly(channel.GetStreamURL(), timezoneShiftSecs); static const std::regex CATCHUP_ID_REGEX("\\{catchup-id\\}"); if (!programmeCatchupId.empty()) @@ -472,10 +472,10 @@ std::string CatchupController::GetCatchupUrl(const Channel& channel) const return ""; } -std::string CatchupController::ProcessStreamUrl(const std::string& streamUrl) const +std::string CatchupController::ProcessStreamUrl(const Channel& channel) const { - //We only process current time timestamps specifiers in this case - return FormatDateTimeNowOnly(streamUrl); + //We only process current time timestamps specifiers in this case + return FormatDateTimeNowOnly(channel.GetStreamURL(), m_epg.GetEPGTimezoneShiftSecs(channel) + channel.GetCatchupCorrectionSecs()); } std::string CatchupController::GetStreamTestUrl(const Channel& channel, bool fromEpg) const @@ -484,7 +484,7 @@ std::string CatchupController::GetStreamTestUrl(const Channel& channel, bool fro // Test URL from 2 hours ago for 1 hour duration. return BuildEpgTagUrl(std::time(nullptr) - (2 * 60 * 60), 60 * 60, channel, 0, m_programmeCatchupId, m_epg.GetEPGTimezoneShiftSecs(channel) + channel.GetCatchupCorrectionSecs()); else - return ProcessStreamUrl(channel.GetStreamURL()); + return ProcessStreamUrl(channel); } std::string CatchupController::GetStreamKey(const Channel& channel, bool fromEpg) const diff --git a/src/iptvsimple/CatchupController.h b/src/iptvsimple/CatchupController.h index d125f58e5..eeafb17b5 100644 --- a/src/iptvsimple/CatchupController.h +++ b/src/iptvsimple/CatchupController.h @@ -34,7 +34,7 @@ namespace iptvsimple std::string GetCatchupUrlFormatString(const data::Channel& channel) const; std::string GetCatchupUrl(const data::Channel& channel) const; - std::string ProcessStreamUrl(const std::string& streamUrl) const; + std::string ProcessStreamUrl(const data::Channel& channel) const; bool ControlsLiveStream() const { return m_controlsLiveStream; } void ResetCatchupState() { m_resetCatchupState = true; } diff --git a/src/iptvsimple/Epg.cpp b/src/iptvsimple/Epg.cpp index ffa706493..ca2ae96b6 100644 --- a/src/iptvsimple/Epg.cpp +++ b/src/iptvsimple/Epg.cpp @@ -46,11 +46,11 @@ bool Epg::Init(int epgMaxPastDays, int epgMaxFutureDays) SetEPGMaxPastDays(epgMaxPastDays); SetEPGMaxFutureDays(epgMaxFutureDays); - if (Settings::GetInstance().IsCatchupEnabled()) + if (Settings::GetInstance().AlwaysLoadEPGData()) { - // For catchup we need a local store of the EPG data. Kodi may not load the - // data on each startup so we need to make sure it's loaded whether or not - // kodi considers it necessary. + // Kodi may not load the data on each startup so we need to make sure it's loaded whether + // or not kodi considers it necessary when either 1) we need the EPG logos or 2) for + // catchup we need a local store of the EPG data time_t now = std::time(nullptr); LoadEPG(now - m_epgMaxPastDaysSeconds, now + m_epgMaxFutureDaysSeconds); } diff --git a/src/iptvsimple/Settings.h b/src/iptvsimple/Settings.h index e32d6238e..4f98261ae 100644 --- a/src/iptvsimple/Settings.h +++ b/src/iptvsimple/Settings.h @@ -117,6 +117,7 @@ namespace iptvsimple float GetEpgTimeshiftHours() const { return m_epgTimeShiftHours; } int GetEpgTimeshiftSecs() const { return static_cast(m_epgTimeShiftHours * 60 * 60); } bool GetTsOverride() const { return m_tsOverride; } + bool AlwaysLoadEPGData() const { return m_epgLogosMode == EpgLogosMode::PREFER_XMLTV || IsCatchupEnabled(); } const std::string& GetGenresLocation() const { return m_genresPathType == PathType::REMOTE_PATH ? m_genresUrl : m_genresPath; } bool UseEpgGenreTextWhenMapping() const { return m_useEpgGenreTextWhenMapping; }