Skip to content

Commit

Permalink
Merge pull request #64 from ksooo/pvr-api-6-0-0
Browse files Browse the repository at this point in the history
Implement PVR addon API v6.0.0
  • Loading branch information
ksooo authored Apr 24, 2019
2 parents 3601518 + 1c1bd86 commit f545831
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pvr.demo/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.demo"
version="3.6.1"
version="4.0.0"
name="PVR Demo Client"
provider-name="Pulse-Eight Ltd., Team Kodi">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
6 changes: 3 additions & 3 deletions src/PVRDemoData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ PVR_ERROR PVRDemoData::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHA
return PVR_ERROR_NO_ERROR;
}

PVR_ERROR PVRDemoData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
PVR_ERROR PVRDemoData::GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd)
{
if (m_iEpgStart == -1)
m_iEpgStart = iStart;
Expand All @@ -581,7 +581,7 @@ PVR_ERROR PVRDemoData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &
for (unsigned int iChannelPtr = 0; iChannelPtr < m_channels.size(); iChannelPtr++)
{
PVRDemoChannel &myChannel = m_channels.at(iChannelPtr);
if (myChannel.iUniqueId != (int) channel.iUniqueId)
if (myChannel.iUniqueId != iChannelUid)
continue;

while (iLastEndTime < iEnd && myChannel.epg.size() > 0)
Expand All @@ -595,7 +595,7 @@ PVR_ERROR PVRDemoData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &
memset(&tag, 0, sizeof(EPG_TAG));

tag.iUniqueBroadcastId = myTag.iBroadcastId + iAddBroadcastId;
tag.iUniqueChannelId = channel.iUniqueId;
tag.iUniqueChannelId = iChannelUid;
tag.strTitle = myTag.strTitle.c_str();
tag.startTime = myTag.startTime + iLastEndTime;
tag.endTime = myTag.endTime + iLastEndTime;
Expand Down
3 changes: 1 addition & 2 deletions src/PVRDemoData.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ struct PVRDemoEpgEntry
// time_t firstAired;
// int iParentalRating;
// int iStarRating;
// bool bNotify;
int iSeriesNumber;
int iEpisodeNumber;
// int iEpisodePartNumber;
Expand Down Expand Up @@ -111,7 +110,7 @@ class PVRDemoData
PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio);
PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);

PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd);

int GetRecordingsAmount(bool bDeleted);
PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool bDeleted);
Expand Down
6 changes: 3 additions & 3 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed)
return PVR_ERROR_NO_ERROR;
}

PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd)
{
if (m_data)
return m_data->GetEPGForChannel(handle, channel, iStart, iEnd);
return m_data->GetEPGForChannel(handle, iChannelUid, iStart, iEnd);

return PVR_ERROR_SERVER_ERROR;
}
Expand Down Expand Up @@ -403,12 +403,12 @@ PVR_ERROR DeleteTimer(const PVR_TIMER &timer, bool bForceDelete) { return PVR_ER
PVR_ERROR UpdateTimer(const PVR_TIMER &timer) { return PVR_ERROR_NOT_IMPLEMENTED; }
void DemuxAbort(void) {}
DemuxPacket* DemuxRead(void) { return NULL; }
void FillBuffer(bool mode) {}
void PauseStream(bool bPaused) {}
bool CanPauseStream(void) { return false; }
bool CanSeekStream(void) { return false; }
bool SeekTime(double,bool,double*) { return false; }
void SetSpeed(int) {};
bool IsTimeshifting(void) { return false; }
bool IsRealTimeStream(void) { return true; }
PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; }
PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; }
Expand Down

0 comments on commit f545831

Please sign in to comment.