From 998e56de0d0f3237ed68b1024480f7bee275fde5 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 25 Jan 2022 14:17:42 +0100 Subject: [PATCH 1/4] When parsing recording add/update messages, always set the correct error string. --- src/Tvheadend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp index 1fd98890..10de35ee 100644 --- a/src/Tvheadend.cpp +++ b/src/Tvheadend.cpp @@ -2602,8 +2602,8 @@ void CTvheadend::ParseRecordingAddOrUpdate(htsmsg_t* msg, bool bAdd) rec.SetState(PVR_TIMER_STATE_ABORTED); else if (strstr(str, "missing") != nullptr) rec.SetState(PVR_TIMER_STATE_ERROR); - else - rec.SetError(str); + + rec.SetError(str); } /* A running recording will have an active subscription assigned to it */ From 89ec56e6e88dc0e22d6a0b76d37567cc6e44cd07 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 25 Jan 2022 14:19:41 +0100 Subject: [PATCH 2/4] Reduce debug log spam. Do not log recording descriptions. --- src/Tvheadend.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp index 10de35ee..414fabf3 100644 --- a/src/Tvheadend.cpp +++ b/src/Tvheadend.cpp @@ -2648,11 +2648,10 @@ void CTvheadend::ParseRecordingAddOrUpdate(htsmsg_t* msg, bool bAdd) /* Update */ if (rec != comparison) { - std::string error = rec.GetError().empty() ? "none" : rec.GetError(); + const std::string error = rec.GetError().empty() ? "n/a" : rec.GetError(); - Logger::Log(LogLevel::LEVEL_DEBUG, "recording id:%d, state:%s, title:%s, desc:%s, error:%s", - rec.GetId(), state, rec.GetTitle().c_str(), rec.GetDescription().c_str(), - error.c_str()); + Logger::Log(LogLevel::LEVEL_DEBUG, "recording id:%d, state:%s, title:%s, error:%s", + rec.GetId(), state, rec.GetTitle().c_str(), error.c_str()); if (m_asyncState.GetState() > ASYNC_DVR) { From 9282b2afbc847adeab5040ca95f4df12680fc3ac Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 25 Jan 2022 14:48:34 +0100 Subject: [PATCH 3/4] Ignore recordings without a file (e.g. removed recordings). --- src/Tvheadend.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp index 414fabf3..1a67dfd7 100644 --- a/src/Tvheadend.cpp +++ b/src/Tvheadend.cpp @@ -2306,6 +2306,11 @@ void CTvheadend::ParseRecordingAddOrUpdate(htsmsg_t* msg, bool bAdd) !htsmsg_get_u32(msg, "duplicate", &dup) && dup == 1) return; + /* Ignore recordings without a file (e.g. removed recordings) */ + const char* error = htsmsg_get_str(msg, "error"); + if (error && (strstr(error, "missing") != nullptr)) + return; + /* Get/create entry */ Recording& rec = m_recordings[id]; Recording comparison = rec; @@ -2595,15 +2600,12 @@ void CTvheadend::ParseRecordingAddOrUpdate(htsmsg_t* msg, bool bAdd) } /* Error */ - str = htsmsg_get_str(msg, "error"); - if (str) + if (error) { - if (!std::strcmp(str, "300")) + if (!std::strcmp(error, "300")) rec.SetState(PVR_TIMER_STATE_ABORTED); - else if (strstr(str, "missing") != nullptr) - rec.SetState(PVR_TIMER_STATE_ERROR); - rec.SetError(str); + rec.SetError(error); } /* A running recording will have an active subscription assigned to it */ From 3caea7ce228231e5084e17faa09901636c0c1d83 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 31 Jan 2022 18:42:58 +0100 Subject: [PATCH 4/4] Add-on version bump and changelog. --- pvr.hts/addon.xml.in | 2 +- pvr.hts/changelog.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pvr.hts/addon.xml.in b/pvr.hts/addon.xml.in index 959fd1a1..8ea5c149 100644 --- a/pvr.hts/addon.xml.in +++ b/pvr.hts/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.hts/changelog.txt b/pvr.hts/changelog.txt index 4e9faded..58673658 100644 --- a/pvr.hts/changelog.txt +++ b/pvr.hts/changelog.txt @@ -1,3 +1,12 @@ +v20.2.1 +- Ignore recordings without a file (e.g. removed recordings). +- When parsing recording add/update messages, always set the correct error string. +- Reduce debug log spam. Do not log recording descriptions. + +v20.2.0 +- Update translations +- Adapt to recent API changes + v20.1.2 - Fix Unable to change existing timer rule to use any time