From 844a5c3cd4125150bee2a65c6cff1a2a1b48ecfe Mon Sep 17 00:00:00 2001 From: Dennis Hamester Date: Thu, 10 Nov 2016 11:27:31 +0100 Subject: [PATCH] OctonetData: Add getter for channel name --- src/OctonetData.cpp | 10 ++++++++++ src/OctonetData.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/OctonetData.cpp b/src/OctonetData.cpp index ee35afa..ed5fa3d 100644 --- a/src/OctonetData.cpp +++ b/src/OctonetData.cpp @@ -286,6 +286,16 @@ const std::string& OctonetData::getUrl(int id) const { return channels[0].url; } +const std::string& OctonetData::getName(int id) const { + for(std::vector::const_iterator iter = channels.begin(); iter != channels.end(); ++iter) { + if(iter->id == id) { + return iter->name; + } + } + + return channels[0].name; +} + int OctonetData::getGroupCount(void) { return groups.size(); diff --git a/src/OctonetData.h b/src/OctonetData.h index f734d23..dbfcb13 100644 --- a/src/OctonetData.h +++ b/src/OctonetData.h @@ -71,6 +71,7 @@ class OctonetData : public P8PLATFORM::CThread virtual PVR_ERROR getEPG(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t start, time_t end); const std::string& getUrl(int id) const; + const std::string& getName(int id) const; protected: virtual bool loadChannelList(void);