From 525abc9991725ab68b0c40621f5b7ab537a61c0f Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 30 Mar 2022 19:44:30 +0200 Subject: [PVR] CPVRChannelGroup, CPVREpg, CPVREpgContainer, CPVREpgTagsContainer: Remove dead code. --- xbmc/pvr/channels/PVRChannelGroup.cpp | 43 ----------------------------------- xbmc/pvr/channels/PVRChannelGroup.h | 20 ---------------- xbmc/pvr/epg/Epg.cpp | 12 ---------- xbmc/pvr/epg/Epg.h | 12 ---------- xbmc/pvr/epg/EpgContainer.cpp | 36 ----------------------------- xbmc/pvr/epg/EpgContainer.h | 12 ---------- xbmc/pvr/epg/EpgTagsContainer.cpp | 34 --------------------------- xbmc/pvr/epg/EpgTagsContainer.h | 12 ---------- 8 files changed, 181 deletions(-) diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp index dd7528c1c1..86df6ef1fb 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.cpp +++ b/xbmc/pvr/channels/PVRChannelGroup.cpp @@ -961,49 +961,6 @@ void CPVRChannelGroup::OnSettingChanged() m_events.Publish(bRenumbered ? PVREvent::ChannelGroupInvalidated : PVREvent::ChannelGroup); } -CDateTime CPVRChannelGroup::GetEPGDate(EpgDateType epgDateType) const -{ - CDateTime date; - std::shared_ptr epg; - std::shared_ptr channel; - std::unique_lock lock(m_critSection); - - for (const auto& memberPair : m_members) - { - channel = memberPair.second->Channel(); - if (!channel->IsHidden() && (epg = channel->GetEPG())) - { - CDateTime epgDate; - switch (epgDateType) - { - case EPG_FIRST_DATE: - epgDate = epg->GetFirstDate(); - if (epgDate.IsValid() && (!date.IsValid() || epgDate < date)) - date = epgDate; - break; - - case EPG_LAST_DATE: - epgDate = epg->GetLastDate(); - if (epgDate.IsValid() && (!date.IsValid() || epgDate > date)) - date = epgDate; - break; - } - } - } - - return date; -} - -CDateTime CPVRChannelGroup::GetFirstEPGDate() const -{ - return GetEPGDate(EPG_FIRST_DATE); -} - -CDateTime CPVRChannelGroup::GetLastEPGDate() const -{ - return GetEPGDate(EPG_LAST_DATE); -} - int CPVRChannelGroup::GroupID() const { return m_iGroupId; diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h index 831a09b403..d00adc999d 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.h +++ b/xbmc/pvr/channels/PVRChannelGroup.h @@ -35,12 +35,6 @@ namespace PVR class CPVRClient; class CPVREpgInfoTag; - enum EpgDateType - { - EPG_FIRST_DATE = 0, - EPG_LAST_DATE = 1 - }; - enum RenumberMode { NORMAL = 0, @@ -367,18 +361,6 @@ namespace PVR */ virtual bool CreateChannelEpgs(bool bForce = false); - /*! - * @brief Get the start time of the first entry. - * @return The start time. - */ - CDateTime GetFirstEPGDate() const; - - /*! - * @brief Get the end time of the last entry. - * @return The end time. - */ - CDateTime GetLastEPGDate() const; - /*! * @brief Update a channel group member with given data. * @param storageId The storage id of the channel. @@ -550,8 +532,6 @@ namespace PVR void OnSettingChanged(); - CDateTime GetEPGDate(EpgDateType epgDateType) const; - std::shared_ptr m_allChannelsGroup; CPVRChannelsPath m_path; bool m_bDeleted = false; diff --git a/xbmc/pvr/epg/Epg.cpp b/xbmc/pvr/epg/Epg.cpp index 79ef8860b2..1ebba9009a 100644 --- a/xbmc/pvr/epg/Epg.cpp +++ b/xbmc/pvr/epg/Epg.cpp @@ -377,18 +377,6 @@ bool CPVREpg::QueueDeleteQueries(const std::shared_ptr& databas return true; } -CDateTime CPVREpg::GetFirstDate() const -{ - std::unique_lock lock(m_critSection); - return m_tags.GetFirstStartTime(); -} - -CDateTime CPVREpg::GetLastDate() const -{ - std::unique_lock lock(m_critSection); - return m_tags.GetLastEndTime(); -} - std::pair CPVREpg::GetFirstAndLastUncommitedEPGDate() const { std::unique_lock lock(m_critSection); diff --git a/xbmc/pvr/epg/Epg.h b/xbmc/pvr/epg/Epg.h index 1e64f66534..31bc8d0888 100644 --- a/xbmc/pvr/epg/Epg.h +++ b/xbmc/pvr/epg/Epg.h @@ -224,18 +224,6 @@ namespace PVR */ bool QueueDeleteQueries(const std::shared_ptr& database); - /*! - * @brief Get the start time of the first entry in this table. - * @return The first date in UTC. - */ - CDateTime GetFirstDate() const; - - /*! - * @brief Get the end time of the last entry in this table. - * @return The last date in UTC. - */ - CDateTime GetLastDate() const; - /*! * @brief Get the start and end time of the last not yet commited entry in this table. * @return The times; first: start time, second: end time. diff --git a/xbmc/pvr/epg/EpgContainer.cpp b/xbmc/pvr/epg/EpgContainer.cpp index b9744b0148..8c05ce803d 100644 --- a/xbmc/pvr/epg/EpgContainer.cpp +++ b/xbmc/pvr/epg/EpgContainer.cpp @@ -810,42 +810,6 @@ bool CPVREpgContainer::UpdateEPG(bool bOnlyPending /* = false */) return !bInterrupted; } -const CDateTime CPVREpgContainer::GetFirstEPGDate() -{ - CDateTime returnValue; - - m_critSection.lock(); - const auto epgs = m_epgIdToEpgMap; - m_critSection.unlock(); - - for (const auto& epgEntry : epgs) - { - CDateTime entry = epgEntry.second->GetFirstDate(); - if (entry.IsValid() && (!returnValue.IsValid() || entry < returnValue)) - returnValue = entry; - } - - return returnValue; -} - -const CDateTime CPVREpgContainer::GetLastEPGDate() -{ - CDateTime returnValue; - - m_critSection.lock(); - const auto epgs = m_epgIdToEpgMap; - m_critSection.unlock(); - - for (const auto& epgEntry : epgs) - { - CDateTime entry = epgEntry.second->GetLastDate(); - if (entry.IsValid() && (!returnValue.IsValid() || entry > returnValue)) - returnValue = entry; - } - - return returnValue; -} - std::pair CPVREpgContainer::GetFirstAndLastEPGDate() const { // Get values from db diff --git a/xbmc/pvr/epg/EpgContainer.h b/xbmc/pvr/epg/EpgContainer.h index a5b60b4125..127b38a3ce 100644 --- a/xbmc/pvr/epg/EpgContainer.h +++ b/xbmc/pvr/epg/EpgContainer.h @@ -110,18 +110,6 @@ namespace PVR */ std::shared_ptr CreateChannelEpg(int iEpgId, const std::string& strScraperName, const std::shared_ptr& channelData); - /*! - * @brief Get the start time of the first entry. - * @return The start time. - */ - const CDateTime GetFirstEPGDate(); - - /*! - * @brief Get the end time of the last entry. - * @return The end time. - */ - const CDateTime GetLastEPGDate(); - /*! * @brief Get the start and end time across all EPGs. * @return The times; first: start time, second: end time. diff --git a/xbmc/pvr/epg/EpgTagsContainer.cpp b/xbmc/pvr/epg/EpgTagsContainer.cpp index de0ce15e74..9ad73ff163 100644 --- a/xbmc/pvr/epg/EpgTagsContainer.cpp +++ b/xbmc/pvr/epg/EpgTagsContainer.cpp @@ -611,40 +611,6 @@ std::vector> CPVREpgTagsContainer::GetAllTags() return {}; } -CDateTime CPVREpgTagsContainer::GetFirstStartTime() const -{ - CDateTime result; - - if (!m_changedTags.empty()) - result = (*m_changedTags.cbegin()).second->StartAsUTC(); - - if (m_database) - { - const CDateTime dbResult = m_database->GetFirstStartTime(m_iEpgID); - if (!result.IsValid() || (dbResult.IsValid() && dbResult < result)) - result = dbResult; - } - - return result; -} - -CDateTime CPVREpgTagsContainer::GetLastEndTime() const -{ - CDateTime result; - - if (!m_changedTags.empty()) - result = (*m_changedTags.crbegin()).second->EndAsUTC(); - - if (m_database) - { - const CDateTime dbResult = m_database->GetLastEndTime(m_iEpgID); - if (!result.IsValid() || (dbResult.IsValid() && dbResult > result)) - result = dbResult; - } - - return result; -} - std::pair CPVREpgTagsContainer::GetFirstAndLastUncommitedEPGDate() const { if (m_changedTags.empty()) diff --git a/xbmc/pvr/epg/EpgTagsContainer.h b/xbmc/pvr/epg/EpgTagsContainer.h index 3d796f1c34..fcbe0d1757 100644 --- a/xbmc/pvr/epg/EpgTagsContainer.h +++ b/xbmc/pvr/epg/EpgTagsContainer.h @@ -152,18 +152,6 @@ public: */ std::vector> GetAllTags() const; - /*! - * @brief Get the start time of the first tag in this EPG. - * @return The time. - */ - CDateTime GetFirstStartTime() const; - - /*! - * @brief Get the end time of the last tag in this EPG. - * @return The time. - */ - CDateTime GetLastEndTime() const; - /*! * @brief Get the start and end time of the last not yet commited entry in this EPG. * @return The times; first: start time, second: end time. -- cgit v1.2.3