From 25e03ba5e70d9559b047d49313424c025b094a25 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Fri, 31 Jan 2025 08:00:55 +0000 Subject: [PATCH 1/2] Add debug logging for EPG loads --- src/IptvSimple.cpp | 8 ++++++++ src/iptvsimple/Epg.cpp | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/IptvSimple.cpp b/src/IptvSimple.cpp index 3f476839..be6f4c8f 100644 --- a/src/IptvSimple.cpp +++ b/src/IptvSimple.cpp @@ -149,17 +149,25 @@ void IptvSimple::Process() if (m_settings->GetM3URefreshMode() == RefreshMode::REPEATED_REFRESH && refreshTimer >= (m_settings->GetM3URefreshIntervalMins() * 60)) + { + Logger::Log(LEVEL_DEBUG, "%s - Refreshing Channels, Grous and EPG at minute interval: %d", __func__, m_settings->GetM3URefreshIntervalMins()); m_reloadChannelsGroupsAndEPG = true; + } if (m_settings->GetM3URefreshMode() == RefreshMode::ONCE_PER_DAY && lastRefreshHour != timeInfo.tm_hour && timeInfo.tm_hour == m_settings->GetM3URefreshHour()) + { + Logger::Log(LEVEL_DEBUG, "%s - Refreshing Channels, Grous and EPG at hour of day: %d", __func__, m_settings->GetM3URefreshHour()); m_reloadChannelsGroupsAndEPG = true; + } std::lock_guard lock(m_mutex); if (m_running && m_reloadChannelsGroupsAndEPG) { std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + Logger::Log(LEVEL_DEBUG, "%s - Reloading Channels, Groups and EPG", __func__); + m_settings->ReloadAddonInstanceSettings(); m_playlistLoader.ReloadPlayList(); m_epg.ReloadEPG(); // Reloading EPG also updates media diff --git a/src/iptvsimple/Epg.cpp b/src/iptvsimple/Epg.cpp index 66efbca5..995a175f 100644 --- a/src/iptvsimple/Epg.cpp +++ b/src/iptvsimple/Epg.cpp @@ -48,6 +48,7 @@ bool Epg::Init(int epgMaxPastDays, int epgMaxFutureDays) if (m_settings->IsCatchupEnabled() || m_settings->IsMediaEnabled()) { + Logger::Log(LEVEL_DEBUG, "%s - LoadEPG on Init, catchup or media", __FUNCTION__); // 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 @@ -374,8 +375,10 @@ void Epg::ReloadEPG() Clear(); + Logger::Log(LEVEL_DEBUG, "%s - Reload EPG", __FUNCTION__); if (LoadEPG(m_lastStart, m_lastEnd)) { + Logger::Log(LEVEL_DEBUG, "%s - Reloaded EPG", __FUNCTION__); MergeEpgDataIntoMedia(); for (const auto& myChannel : m_channels.GetChannelsList()) @@ -392,11 +395,15 @@ PVR_ERROR Epg::GetEPGForChannel(int channelUid, time_t epgWindowStart, time_t ep if (myChannel.GetUniqueId() != channelUid) continue; + Logger::Log(LEVEL_DEBUG, "%s - Getting EPG for Channel: %s", __FUNCTION__, myChannel.GetChannelName().c_str()); + if (epgWindowStart > m_lastStart || epgWindowEnd > m_lastEnd) { + Logger::Log(LEVEL_DEBUG, "%s - Attempting load of EPG for Channel: %s", __FUNCTION__, myChannel.GetChannelName().c_str()); // reload EPG for new time interval only LoadEPG(epgWindowStart, epgWindowEnd); { + Logger::Log(LEVEL_DEBUG, "%s - Loaded EPG for Channel: %s", __FUNCTION__, myChannel.GetChannelName().c_str()); MergeEpgDataIntoMedia(); // doesn't matter is epg loaded or not we shouldn't try to load it for same interval From 02cdf9793b9bb8c433fab870d3515e9984762e64 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Fri, 31 Jan 2025 08:01:49 +0000 Subject: [PATCH 2/2] changelog and version 21.10.2 --- pvr.iptvsimple/addon.xml.in | 2 +- pvr.iptvsimple/changelog.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index f43887e6..b2dd592c 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 ebf74d00..e5dae080 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v21.10.2 +- Add debug logging for EPG loads + v21.10.1 - Translations updates from Weblate - af_za, am_et, ar_sa, ast_es, az_az, be_by, bg_bg, bs_ba, ca_es, cs_cz, cy_gb, da_dk, de_de, el_gr, en_au, en_nz, en_us, eo, es_ar, es_es, es_mx, et_ee, eu_es, fa_af, fa_ir, fi_fi, fo_fo, fr_ca, fr_fr, gl_es, he_il, hi_in, hr_hr, hu_hu, hy_am, id_id, is_is, it_it, ja_jp, ko_kr, lt_lt, lv_lv, mi, mk_mk, ml_in, mn_mn, ms_my, mt_mt, my_mm, nb_no, nl_nl, pl_pl, pt_br, pt_pt, ro_ro, ru_ru, si_lk, sk_sk, sl_si, sq_al, sr_rs, sr_rs@latin, sv_se, szl, ta_in, te_in, tg_tj, th_th, tr_tr, uk_ua, uz_uz, vi_vn, zh_cn, zh_tw