Skip to content

Commit

Permalink
Merge pull request #354 from MartB/Matrix
Browse files Browse the repository at this point in the history
e2: Add missing radio service type 0x0A, fixes #353
  • Loading branch information
phunkyfish authored Jul 15, 2021
2 parents 7b3f010 + 49978e0 commit 5f70575
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/enigma2/data/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ bool Channel::HasRadioServiceType()
if (found != std::string::npos)
radioServiceType = radioServiceType.substr(0, found);

return radioServiceType == RADIO_SERVICE_TYPE;
return std::find(RADIO_SERVICE_TYPES.begin(), RADIO_SERVICE_TYPES.end(), radioServiceType) != RADIO_SERVICE_TYPES.end();
}

void Channel::UpdateTo(kodi::addon::PVRChannel& left) const
Expand Down
4 changes: 3 additions & 1 deletion src/enigma2/data/Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <memory>
#include <string>
#include <vector>
#include <array>

#include <kodi/addon-instance/pvr/Channels.h>
#include <tinyxml.h>
Expand All @@ -28,7 +29,8 @@ namespace enigma2
public:
const std::string SERVICE_REF_GENERIC_PREFIX = "1:0:1:";
const std::string SERVICE_REF_GENERIC_POSTFIX = ":0:0:0";
const std::string RADIO_SERVICE_TYPE = "2";
// There are at least two different service types for radio, see EN300468 Table 87
const std::array<std::string, 3> RADIO_SERVICE_TYPES = {"2", "A", "a"};

Channel() = default;
Channel(const Channel &c) : BaseChannel(c), m_channelNumber(c.GetChannelNumber()), m_standardServiceReference(c.GetStandardServiceReference()),
Expand Down

0 comments on commit 5f70575

Please sign in to comment.