Skip to content

Commit f45ef38

Browse files
authored
Merge pull request #947 from phunkyfish/epg-debug-logging
Add debug logging for EPG loads
2 parents bb513d7 + 02cdf97 commit f45ef38

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

pvr.iptvsimple/addon.xml.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<addon
33
id="pvr.iptvsimple"
4-
version="21.10.1"
4+
version="21.10.2"
55
name="IPTV Simple Client"
66
provider-name="nightik and Ross Nicholson">
77
<requires>@ADDON_DEPENDS@

pvr.iptvsimple/changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v21.10.2
2+
- Add debug logging for EPG loads
3+
14
v21.10.1
25
- Translations updates from Weblate
36
- 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

src/IptvSimple.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,25 @@ void IptvSimple::Process()
149149

150150
if (m_settings->GetM3URefreshMode() == RefreshMode::REPEATED_REFRESH &&
151151
refreshTimer >= (m_settings->GetM3URefreshIntervalMins() * 60))
152+
{
153+
Logger::Log(LEVEL_DEBUG, "%s - Refreshing Channels, Grous and EPG at minute interval: %d", __func__, m_settings->GetM3URefreshIntervalMins());
152154
m_reloadChannelsGroupsAndEPG = true;
155+
}
153156

154157
if (m_settings->GetM3URefreshMode() == RefreshMode::ONCE_PER_DAY &&
155158
lastRefreshHour != timeInfo.tm_hour && timeInfo.tm_hour == m_settings->GetM3URefreshHour())
159+
{
160+
Logger::Log(LEVEL_DEBUG, "%s - Refreshing Channels, Grous and EPG at hour of day: %d", __func__, m_settings->GetM3URefreshHour());
156161
m_reloadChannelsGroupsAndEPG = true;
162+
}
157163

158164
std::lock_guard<std::mutex> lock(m_mutex);
159165
if (m_running && m_reloadChannelsGroupsAndEPG)
160166
{
161167
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
162168

169+
Logger::Log(LEVEL_DEBUG, "%s - Reloading Channels, Groups and EPG", __func__);
170+
163171
m_settings->ReloadAddonInstanceSettings();
164172
m_playlistLoader.ReloadPlayList();
165173
m_epg.ReloadEPG(); // Reloading EPG also updates media

src/iptvsimple/Epg.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ bool Epg::Init(int epgMaxPastDays, int epgMaxFutureDays)
4848

4949
if (m_settings->IsCatchupEnabled() || m_settings->IsMediaEnabled())
5050
{
51+
Logger::Log(LEVEL_DEBUG, "%s - LoadEPG on Init, catchup or media", __FUNCTION__);
5152
// Kodi may not load the data on each startup so we need to make sure it's loaded whether
5253
// or not kodi considers it necessary when either 1) we need the EPG logos or 2) for
5354
// catchup we need a local store of the EPG data
@@ -374,8 +375,10 @@ void Epg::ReloadEPG()
374375

375376
Clear();
376377

378+
Logger::Log(LEVEL_DEBUG, "%s - Reload EPG", __FUNCTION__);
377379
if (LoadEPG(m_lastStart, m_lastEnd))
378380
{
381+
Logger::Log(LEVEL_DEBUG, "%s - Reloaded EPG", __FUNCTION__);
379382
MergeEpgDataIntoMedia();
380383

381384
for (const auto& myChannel : m_channels.GetChannelsList())
@@ -392,11 +395,15 @@ PVR_ERROR Epg::GetEPGForChannel(int channelUid, time_t epgWindowStart, time_t ep
392395
if (myChannel.GetUniqueId() != channelUid)
393396
continue;
394397

398+
Logger::Log(LEVEL_DEBUG, "%s - Getting EPG for Channel: %s", __FUNCTION__, myChannel.GetChannelName().c_str());
399+
395400
if (epgWindowStart > m_lastStart || epgWindowEnd > m_lastEnd)
396401
{
402+
Logger::Log(LEVEL_DEBUG, "%s - Attempting load of EPG for Channel: %s", __FUNCTION__, myChannel.GetChannelName().c_str());
397403
// reload EPG for new time interval only
398404
LoadEPG(epgWindowStart, epgWindowEnd);
399405
{
406+
Logger::Log(LEVEL_DEBUG, "%s - Loaded EPG for Channel: %s", __FUNCTION__, myChannel.GetChannelName().c_str());
400407
MergeEpgDataIntoMedia();
401408

402409
// doesn't matter is epg loaded or not we shouldn't try to load it for same interval

0 commit comments

Comments
 (0)