Skip to content

Commit

Permalink
Merge pull request #401 from Verequies/master
Browse files Browse the repository at this point in the history
Fix missing description in the EPG and DVR
  • Loading branch information
ksooo committed Feb 6, 2019
2 parents dc35ade + 8f9dbb6 commit e394c79
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 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="4.4.12"
version="4.4.13"
name="Tvheadend HTSP Client"
provider-name="Adam Sutton, Sam Stenvall, Lars Op den Kamp, Kai Sommerfeld">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
3 changes: 3 additions & 0 deletions pvr.hts/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
4.4.13
- Fixed missing description in EPG and DVR tags.

4.4.12
- Fixed missing summary in EPG tags.

Expand Down
42 changes: 35 additions & 7 deletions src/Tvheadend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,20 @@ void CTvheadend::ParseRecordingAddOrUpdate ( htsmsg_t *msg, bool bAdd )
if ((str = htsmsg_get_str(msg, "fanartImage")) != NULL)
rec.SetFanartImage(GetImageURL(str));

if (m_conn->GetProtocol() >= 32) {
if (rec.GetDescription().empty() && !rec.GetSubtitle().empty()) {
/*
Due to changes in HTSP v32, if the description is empty, try
to use the subtitle as the description. Clear the subtitle
afterwards to avoid duplicate information being displayed.
This was done by TVHeadend prior to HTSP v32.
*/
rec.SetDescription(rec.GetSubtitle());
rec.SetSubtitle("");
}
}

/* Error */
if ((str = htsmsg_get_str(msg, "error")) != NULL)
{
Expand Down Expand Up @@ -2603,13 +2617,6 @@ bool CTvheadend::ParseEvent ( htsmsg_t *msg, bool bAdd, Event &evt )
evt.SetSummary(str);
if ((str = htsmsg_get_str(msg, "description")) != NULL)
evt.SetDesc(str);
if (evt.GetDesc().empty() && m_conn->GetProtocol() >= 32)
{
// If no description is available, use summary as description. This was done by tvh prior to htsp version 32.
evt.SetDesc(evt.GetSummary());
// No duplicate description/summary
evt.SetSummary("");
}
if ((str = htsmsg_get_str(msg, "image")) != NULL)
evt.SetImage(GetImageURL(str));
if (!htsmsg_get_u32(msg, "nextEventId", &u32))
Expand All @@ -2634,6 +2641,27 @@ bool CTvheadend::ParseEvent ( htsmsg_t *msg, bool bAdd, Event &evt )
evt.SetYear(u32);
if (!htsmsg_get_u32(msg, "dvrId", &u32))
evt.SetRecordingId(u32);

if (m_conn->GetProtocol() >= 32) {
if (evt.GetDesc().empty()) {
/*
Due to changes in HTSP v32, if the description is empty, try
to use the summary as the description. If the summary is empty,
try to use the subtitle as the description. Also clear the
respective entries to avoid duplicate information being displayed.
This was done by TVHeadend prior to HTSP v32.
*/
if (!evt.GetSummary().empty()) {
evt.SetDesc(evt.GetSummary());
evt.SetSummary("");
}
else if (!evt.GetSubtitle().empty()) {
evt.SetDesc(evt.GetSubtitle());
evt.SetSubtitle("");
}
}
}

htsmsg_t *l;
if ((l = htsmsg_get_map(msg, "credits")) != nullptr)
Expand Down

0 comments on commit e394c79

Please sign in to comment.