diff --git a/xbmc/epg/Epg.cpp b/xbmc/epg/Epg.cpp index 9e0445a8d39d9..e0f7a66dcc9a7 100644 --- a/xbmc/epg/Epg.cpp +++ b/xbmc/epg/Epg.cpp @@ -260,7 +260,7 @@ CEpgInfoTagPtr CEpg::GetTag(const CDateTime &StartTime) const return CEpgInfoTagPtr(); } -CEpgInfoTagPtr CEpg::GetTag(int uniqueID) const +CEpgInfoTagPtr CEpg::GetTag(unsigned int uniqueID) const { CEpgInfoTagPtr retval; CSingleLock lock(m_critSection); diff --git a/xbmc/epg/Epg.h b/xbmc/epg/Epg.h index 822bce294ca40..167b994cf0695 100644 --- a/xbmc/epg/Epg.h +++ b/xbmc/epg/Epg.h @@ -209,7 +209,7 @@ namespace EPG * @param uniqueID The unique ID of the event to find. * @return The found tag or an empty tag if it wasn't found. */ - CEpgInfoTagPtr GetTag(int uniqueID) const; + CEpgInfoTagPtr GetTag(unsigned int uniqueID) const; /*! * @brief Update an entry in this EPG. diff --git a/xbmc/epg/EpgContainer.cpp b/xbmc/epg/EpgContainer.cpp index 79757174e057d..6224bd19783c7 100644 --- a/xbmc/epg/EpgContainer.cpp +++ b/xbmc/epg/EpgContainer.cpp @@ -383,7 +383,7 @@ CEpg *CEpgContainer::GetById(int iEpgId) const return epgEntry != m_epgs.end() ? epgEntry->second : NULL; } -CEpgInfoTagPtr CEpgContainer::GetTagById(int iBroadcastId) const +CEpgInfoTagPtr CEpgContainer::GetTagById(unsigned int iBroadcastId) const { CEpgInfoTagPtr retval; CSingleLock lock(m_critSection); diff --git a/xbmc/epg/EpgContainer.h b/xbmc/epg/EpgContainer.h index 7c983e28314c6..866e7f9fb5197 100644 --- a/xbmc/epg/EpgContainer.h +++ b/xbmc/epg/EpgContainer.h @@ -164,7 +164,7 @@ namespace EPG * @param iBroadcastId The event id to get * @return The requested event, or an empty tag when not found */ - virtual CEpgInfoTagPtr GetTagById(int iBroadcastId) const; + virtual CEpgInfoTagPtr GetTagById(unsigned int iBroadcastId) const; /*! * @brief Get an EPG table given a PVR channel. diff --git a/xbmc/epg/EpgDatabase.cpp b/xbmc/epg/EpgDatabase.cpp index 99cd89ef5d330..6516c9c7021fd 100644 --- a/xbmc/epg/EpgDatabase.cpp +++ b/xbmc/epg/EpgDatabase.cpp @@ -227,7 +227,10 @@ int CEpgDatabase::Get(CEpg &epg) CDateTime firstAired(iFirstAired); newTag->m_firstAired = firstAired; - newTag->m_iUniqueBroadcastID = m_pDS->fv("iBroadcastUid").get_asInt(); + int iBroadcastUID = m_pDS->fv("iBroadcastUid").get_asInt(); + // Compat: null value for broadcast uid changed from numerical -1 to 0 with PVR Addon API v4.0.0 + newTag->m_iUniqueBroadcastID = iBroadcastUID == -1 ? PVR_TIMER_NO_EPG_UID : iBroadcastUID; + newTag->m_iBroadcastId = m_pDS->fv("idBroadcast").get_asInt(); newTag->m_strTitle = m_pDS->fv("sTitle").get_asString().c_str(); newTag->m_strPlotOutline = m_pDS->fv("sPlotOutline").get_asString().c_str(); diff --git a/xbmc/epg/EpgInfoTag.cpp b/xbmc/epg/EpgInfoTag.cpp index 62836328f9dcb..604f4d66b0bce 100644 --- a/xbmc/epg/EpgInfoTag.cpp +++ b/xbmc/epg/EpgInfoTag.cpp @@ -51,7 +51,7 @@ CEpgInfoTag::CEpgInfoTag(void) : m_iSeriesNumber(0), m_iEpisodeNumber(0), m_iEpisodePart(0), - m_iUniqueBroadcastID(-1), + m_iUniqueBroadcastID(0), m_iYear(0), m_epg(NULL) { @@ -67,7 +67,7 @@ CEpgInfoTag::CEpgInfoTag(CEpg *epg, PVR::CPVRChannelPtr pvrChannel, const std::s m_iSeriesNumber(0), m_iEpisodeNumber(0), m_iEpisodePart(0), - m_iUniqueBroadcastID(-1), + m_iUniqueBroadcastID(0), m_iYear(0), m_strIconPath(strIconPath), m_epg(epg), @@ -86,7 +86,7 @@ CEpgInfoTag::CEpgInfoTag(const EPG_TAG &data) : m_iSeriesNumber(0), m_iEpisodeNumber(0), m_iEpisodePart(0), - m_iUniqueBroadcastID(-1), + m_iUniqueBroadcastID(0), m_epg(NULL) { m_startTime = (data.startTime + g_advancedSettings.m_iPVRTimeCorrection); @@ -289,12 +289,12 @@ CEpgInfoTagPtr CEpgInfoTag::GetPreviousEvent(void) const return GetTable()->GetPreviousEvent(*this); } -void CEpgInfoTag::SetUniqueBroadcastID(int iUniqueBroadcastID) +void CEpgInfoTag::SetUniqueBroadcastID(unsigned int iUniqueBroadcastID) { m_iUniqueBroadcastID = iUniqueBroadcastID; } -int CEpgInfoTag::UniqueBroadcastID(void) const +unsigned int CEpgInfoTag::UniqueBroadcastID(void) const { return m_iUniqueBroadcastID; } diff --git a/xbmc/epg/EpgInfoTag.h b/xbmc/epg/EpgInfoTag.h index 428d5dcf4df09..2dec60a7b4608 100644 --- a/xbmc/epg/EpgInfoTag.h +++ b/xbmc/epg/EpgInfoTag.h @@ -143,13 +143,13 @@ namespace EPG * @brief Change the unique broadcast ID of this event. * @param iUniqueBroadcastId The new unique broadcast ID. */ - void SetUniqueBroadcastID(int iUniqueBroadcastID); + void SetUniqueBroadcastID(unsigned int iUniqueBroadcastID); /*! * @brief Get the unique broadcast ID. * @return The unique broadcast ID. */ - int UniqueBroadcastID(void) const; + unsigned int UniqueBroadcastID(void) const; /*! * @brief Get the event's database ID. @@ -432,7 +432,7 @@ namespace EPG int m_iSeriesNumber; /*!< series number */ int m_iEpisodeNumber; /*!< episode number */ int m_iEpisodePart; /*!< episode part number */ - int m_iUniqueBroadcastID; /*!< unique broadcast ID */ + unsigned int m_iUniqueBroadcastID; /*!< unique broadcast ID */ std::string m_strTitle; /*!< title */ std::string m_strPlotOutline; /*!< plot outline */ std::string m_strPlot; /*!< plot */ diff --git a/xbmc/pvr/addons/PVRClient.cpp b/xbmc/pvr/addons/PVRClient.cpp index ce2cb47646fb6..d8832130eaa51 100644 --- a/xbmc/pvr/addons/PVRClient.cpp +++ b/xbmc/pvr/addons/PVRClient.cpp @@ -313,7 +313,7 @@ void CPVRClient::WriteClientTimerInfo(const CPVRTimerInfoTag &xbmcTimer, PVR_TIM addonTimer.bStartAnyTime = xbmcTimer.m_bStartAnyTime; addonTimer.bEndAnyTime = xbmcTimer.m_bEndAnyTime; addonTimer.firstDay = firstDay - g_advancedSettings.m_iPVRTimeCorrection; - addonTimer.iEpgUid = epgTag ? epgTag->UniqueBroadcastID() : -1; + addonTimer.iEpgUid = epgTag ? epgTag->UniqueBroadcastID() : PVR_TIMER_NO_EPG_UID; strncpy(addonTimer.strSummary, xbmcTimer.m_strSummary.c_str(), sizeof(addonTimer.strSummary) - 1); addonTimer.iMarginStart = xbmcTimer.m_iMarginStart; addonTimer.iMarginEnd = xbmcTimer.m_iMarginEnd; diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp index 2967c69d401cd..b25da213a4f74 100644 --- a/xbmc/pvr/recordings/PVRRecording.cpp +++ b/xbmc/pvr/recordings/PVRRecording.cpp @@ -187,7 +187,7 @@ void CPVRRecording::Reset(void) m_bGotMetaData = false; m_iRecordingId = 0; m_bIsDeleted = false; - m_iEpgEventId = -1; + m_iEpgEventId = 0; m_iSeason = -1; m_iEpisode = -1; diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h index d66e7a52bee8c..6045d66a0736c 100644 --- a/xbmc/pvr/recordings/PVRRecording.h +++ b/xbmc/pvr/recordings/PVRRecording.h @@ -209,7 +209,7 @@ namespace PVR /*! * @return Broadcast id of the EPG event associated with this recording */ - int EpgEvent(void) const { return m_iEpgEventId; } + unsigned int EpgEvent(void) const { return m_iEpgEventId; } /*! * @return Get the channel on which this recording is/was running @@ -230,10 +230,10 @@ namespace PVR std::string EpisodeName(void) const { return m_strShowTitle; }; private: - CDateTime m_recordingTime; /*!< start time of the recording */ - bool m_bGotMetaData; - bool m_bIsDeleted; /*!< set if entry is a deleted recording which can be undelete */ - int m_iEpgEventId; /*!< epg broadcast id associated with this recording */ + CDateTime m_recordingTime; /*!< start time of the recording */ + bool m_bGotMetaData; + bool m_bIsDeleted; /*!< set if entry is a deleted recording which can be undelete */ + unsigned int m_iEpgEventId; /*!< epg broadcast id associated with this recording */ void UpdatePath(void); void DisplayError(PVR_ERROR err) const; diff --git a/xbmc/pvr/recordings/PVRRecordings.cpp b/xbmc/pvr/recordings/PVRRecordings.cpp index 3c1296859bfa9..663096ddc86ee 100644 --- a/xbmc/pvr/recordings/PVRRecordings.cpp +++ b/xbmc/pvr/recordings/PVRRecordings.cpp @@ -513,7 +513,7 @@ void CPVRRecordings::UpdateFromClient(const CPVRRecordingPtr &tag) void CPVRRecordings::UpdateEpgTags(void) { CSingleLock lock(m_critSection); - int iEpgEvent; + unsigned int iEpgEvent; for (PVR_RECORDINGMAP_ITR it = m_recordings.begin(); it != m_recordings.end(); ++it) { iEpgEvent = it->second->EpgEvent(); diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.cpp b/xbmc/pvr/timers/PVRTimerInfoTag.cpp index 90070fd96fa5a..a238736932002 100644 --- a/xbmc/pvr/timers/PVRTimerInfoTag.cpp +++ b/xbmc/pvr/timers/PVRTimerInfoTag.cpp @@ -144,12 +144,12 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr unsigned int iMustHave = PVR_TIMER_TYPE_ATTRIBUTE_NONE; unsigned int iMustNotHave = PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES; - if (timer.iEpgUid == 0 && timer.iWeekdays != PVR_WEEKDAY_NONE) + if (timer.iEpgUid == PVR_TIMER_NO_EPG_UID && timer.iWeekdays != PVR_WEEKDAY_NONE) iMustHave |= PVR_TIMER_TYPE_IS_REPEATING; else iMustNotHave |= PVR_TIMER_TYPE_IS_REPEATING; - if (timer.iEpgUid == 0) + if (timer.iEpgUid == PVR_TIMER_NO_EPG_UID) iMustHave |= PVR_TIMER_TYPE_IS_MANUAL; else iMustNotHave |= PVR_TIMER_TYPE_IS_MANUAL;