Skip to content

Commit

Permalink
Merge pull request #16 from ksooo/pvr-api-1-9-6-compat
Browse files Browse the repository at this point in the history
PVR addon API 1.9.6 changes
  • Loading branch information
ksooo committed Mar 17, 2015
2 parents 2cb5d5f + eebbb4b commit cc1b511
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pvr.hts/addon.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.hts"
version="2.1.5"
version="2.1.6"
name="Tvheadend HTSP Client"
provider-name="Adam Sutton, Sam Stenvall, Lars Op den Kamp, Kai Sommerfeld">
<requires>
<c-pluff version="0.1"/>
<import addon="xbmc.pvr" version="1.9.5"/>
<import addon="xbmc.pvr" version="1.9.6"/>
<import addon="xbmc.codec" version="1.0.1"/>
</requires>
<extension
Expand Down
13 changes: 9 additions & 4 deletions pvr.hts/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
2.1.6
- updated to PVR API v1.9.6
- added: support for channel group sort index
- fixed: crash while adding/updating timers on the client (double free of a htsp message)

2.1.5
- improved HTSP specification compliance

2.1.4
- Updated to PVR API v1.9.5
- updated to PVR API v1.9.5
- added: avahi discovery
- fixed: lock on exit
- fixed: race when seeking within recordings
- fixed: CHTSPVFS::Read() needs the mutex locked
- removed guilib dep

2.1.1
- Updated to PVR API v1.9.4
- Updated to GUI API v5.8.0
- Updated to Codec API v1.0.1
- updated to PVR API v1.9.4
- updated to GUI API v5.8.0
- updated to Codec API v1.0.1

2.0.5
- fixed incorrect timeout value when deleting recordings (thanks @ksooo)
Expand Down
6 changes: 4 additions & 2 deletions src/HTSPTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,21 @@ struct STag
{
bool del;
uint32_t id;
uint32_t index;
std::string name;
std::string icon;
std::vector<uint32_t> channels;

STag() :
del(false),
id (0)
id (0),
index(0)
{
}

inline bool operator==(const STag &right)
{
return id == right.id && name == right.name &&
return id == right.id && index == right.index && name == right.name &&
icon == right.icon && channels == right.channels;
}

Expand Down
20 changes: 18 additions & 2 deletions src/Tvheadend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ PVR_ERROR CTvheadend::GetTags ( ADDON_HANDLE handle )
PVR_CHANNEL_GROUP tag;
memset(&tag, 0, sizeof(tag));

tag.bIsRadio = false;
tag.bIsRadio = false; // TODO: support for radio channel groups.
strncpy(tag.strGroupName, it->second.name.c_str(),
sizeof(tag.strGroupName));
tag.iPosition = it->second.index;
tags.push_back(tag);
}
}
Expand Down Expand Up @@ -679,13 +680,24 @@ void CTvheadend::TransferEvent
epg.endTime = event.stop;
epg.strPlotOutline = event.summary.c_str();
epg.strPlot = event.desc.c_str();
epg.strOriginalTitle = NULL; /* not supported by tvh */
epg.strCast = NULL; /* not supported by tvh */
epg.strDirector = NULL; /* not supported by tvh */
epg.strWriter = NULL; /* not supported by tvh */
epg.iYear = 0; /* not supported by tvh */
epg.strIMDBNumber = NULL; /* not supported by tvh */
epg.strIconPath = event.image.c_str();
epg.iGenreType = event.content & 0xF0;
epg.iGenreSubType = event.content & 0x0F;
epg.strGenreDescription = NULL; /* not supported by tvh */
epg.firstAired = event.aired;
epg.iParentalRating = 0; /* TODO: add support (seems to be only partially implemented => SEvent::age */
epg.iStarRating = 0; /* TODO: add support (seems to be only partially implemented => SEvent::stars */
epg.bNotify = false; /* not supported by tvh */
epg.iSeriesNumber = event.season;
epg.iEpisodeNumber = event.episode;
epg.iEpisodePartNumber = event.part;
epg.strEpisodeName = NULL; /* not supported by tvh */

/* Callback. */
PVR->TransferEpgEntry(handle, &epg);
Expand Down Expand Up @@ -875,7 +887,7 @@ void* CTvheadend::Process ( void )
else if (!strcmp("channelDelete", method))
ParseChannelDelete(msg.m_msg);

/* Tags */
/* Channel Tags (aka channel groups)*/
else if (!strcmp("tagAdd", method))
ParseTagAddOrUpdate(msg.m_msg, true);
else if (!strcmp("tagUpdate", method))
Expand Down Expand Up @@ -1095,6 +1107,10 @@ void CTvheadend::ParseTagAddOrUpdate ( htsmsg_t *msg, bool bAdd )
STag tag;
tag.id = u32;

/* Index */
if (!htsmsg_get_u32(msg, "tagIndex", &u32))
tag.index = u32;

/* Name */
if ((str = htsmsg_get_str(msg, "tagName")) != NULL)
tag.name = str;
Expand Down

0 comments on commit cc1b511

Please sign in to comment.