mirror of
https://github.com/DigitalDevices/pvr.octonet.git
synced 2023-10-10 13:36:57 +02:00
Generate 64 bit id for internal lookup
Store the stringified id from chanellist into a 64 bit integer, which will be used for matching epg data. Signed-off-by: Julian Scheel <julian@jusst.de>
This commit is contained in:
parent
a23e465b63
commit
68fb9608eb
@ -46,6 +46,20 @@ OctonetData::~OctonetData(void)
|
|||||||
groups.clear();
|
groups.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t OctonetData::parseID(std::string id)
|
||||||
|
{
|
||||||
|
int64_t nativeId;
|
||||||
|
size_t strip;
|
||||||
|
/* Strip colons from id */
|
||||||
|
while ((strip = id.find(":")) != std::string::npos)
|
||||||
|
id.erase(strip, 1);
|
||||||
|
|
||||||
|
std::stringstream ids(id);
|
||||||
|
ids >> nativeId;
|
||||||
|
|
||||||
|
return nativeId;
|
||||||
|
}
|
||||||
|
|
||||||
bool OctonetData::loadChannelList()
|
bool OctonetData::loadChannelList()
|
||||||
{
|
{
|
||||||
std::string jsonContent;
|
std::string jsonContent;
|
||||||
@ -80,17 +94,8 @@ bool OctonetData::loadChannelList()
|
|||||||
chan.name = channel["Title"].asString();
|
chan.name = channel["Title"].asString();
|
||||||
chan.url = "rtsp://" + serverAddress + "/" + channel["Request"].asString();
|
chan.url = "rtsp://" + serverAddress + "/" + channel["Request"].asString();
|
||||||
chan.radio = group.radio;
|
chan.radio = group.radio;
|
||||||
|
chan.nativeId = parseID(channel["ID"].asString());
|
||||||
|
|
||||||
#if 0 /* Would require a 64 bit identifier */
|
|
||||||
std::string id = channel["ID"].asString();
|
|
||||||
size_t strip;
|
|
||||||
/* Strip colons from id */
|
|
||||||
while ((strip = id.find(":")) != std::string::npos)
|
|
||||||
id.erase(strip, 1);
|
|
||||||
|
|
||||||
std::stringstream ids(id);
|
|
||||||
ids >> chan.id;
|
|
||||||
#endif
|
|
||||||
chan.id = 1000 + channels.size();
|
chan.id = 1000 + channels.size();
|
||||||
group.members.push_back(channels.size());
|
group.members.push_back(channels.size());
|
||||||
channels.push_back(chan);
|
channels.push_back(chan);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
struct OctonetChannel
|
struct OctonetChannel
|
||||||
{
|
{
|
||||||
|
int64_t nativeId;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string url;
|
std::string url;
|
||||||
bool radio;
|
bool radio;
|
||||||
|
Loading…
Reference in New Issue
Block a user