Skip to content

Commit

Permalink
Merge pull request #572 from ksooo/misc-fixes-nexus
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
ksooo authored Jan 31, 2022
2 parents 4c872b8 + 3caea7c commit 85bfe37
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pvr.hts/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.hts"
version="20.2.0"
version="20.2.1"
name="Tvheadend HTSP Client"
provider-name="Adam Sutton, Sam Stenvall, Lars Op den Kamp, Kai Sommerfeld">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
9 changes: 9 additions & 0 deletions pvr.hts/changelog.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
23 changes: 12 additions & 11 deletions src/Tvheadend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
else
rec.SetError(str);

rec.SetError(error);
}

/* A running recording will have an active subscription assigned to it */
Expand Down Expand Up @@ -2648,11 +2650,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)
{
Expand Down

0 comments on commit 85bfe37

Please sign in to comment.