Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PVR addon API v6.0.0 #239

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pvr.iptvsimple/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.iptvsimple"
version="3.5.7"
version="4.0.0"
name="PVR IPTV Simple Client"
provider-name="nightik">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
2 changes: 2 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
v4.0.0
- Update to PVR addon API v6.0.0

v3.5.7
- Correctly show build version in Kodi
Expand Down
7 changes: 3 additions & 4 deletions src/PVRIptvData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,13 +706,13 @@ PVR_ERROR PVRIptvData::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHA
return PVR_ERROR_NO_ERROR;
}

PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd)
PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd)
{
P8PLATFORM::CLockObject lock(m_mutex);
std::vector<PVRIptvChannel>::iterator myChannel;
for (myChannel = m_channels.begin(); myChannel < m_channels.end(); ++myChannel)
{
if (myChannel->iUniqueId != (int) channel.iUniqueId)
if (myChannel->iUniqueId != iChannelUid)
continue;

if (iStart > m_iLastStart || iEnd > m_iLastEnd)
Expand Down Expand Up @@ -745,7 +745,7 @@ PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &

tag.iUniqueBroadcastId = myTag->iBroadcastId;
tag.strTitle = myTag->strTitle.c_str();
tag.iUniqueChannelId = channel.iUniqueId;
tag.iUniqueChannelId = iChannelUid;
tag.startTime = myTag->startTime + iShift;
tag.endTime = myTag->endTime + iShift;
tag.strPlotOutline = myTag->strPlotOutline.c_str();
Expand All @@ -771,7 +771,6 @@ PVR_ERROR PVRIptvData::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &
}
tag.iParentalRating = 0; /* not supported */
tag.iStarRating = 0; /* not supported */
tag.bNotify = false; /* not supported */
tag.iSeriesNumber = 0; /* not supported */
tag.iEpisodeNumber = 0; /* not supported */
tag.iEpisodePartNumber = 0; /* not supported */
Expand Down
2 changes: 1 addition & 1 deletion src/PVRIptvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class PVRIptvData : public P8PLATFORM::CThread
virtual int GetChannelGroupsAmount(void);
virtual PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio);
virtual PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
virtual PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd);
virtual PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, int iChannelUid, time_t iStart, time_t iEnd);
virtual void ReaplyChannelsLogos(const char * strNewPath);
virtual void ReloadPlayList(const char * strNewPath);
virtual void ReloadEPG(const char * strNewPath);
Expand Down
6 changes: 3 additions & 3 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,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 @@ -415,6 +415,7 @@ long long SeekRecordedStream(long long iPosition, int iWhence /* = SEEK_SET */)
long long LengthRecordedStream(void) { return 0; }
void DemuxReset(void) {}
void DemuxFlush(void) {}
void FillBuffer(bool mode) {}
int ReadLiveStream(unsigned char *pBuffer, unsigned int iBufferSize) { return 0; }
long long SeekLiveStream(long long iPosition, int iWhence /* = SEEK_SET */) { return -1; }
long long LengthLiveStream(void) { return -1; }
Expand All @@ -432,7 +433,6 @@ 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; }
bool IsTimeshifting(void) { return false; }
bool IsRealTimeStream(void) { return true; }
void PauseStream(bool bPaused) {}
bool CanSeekStream(void) { return false; }
Expand Down