Implement epg import

Load EPG data from Octonet and export it to the pvr interface.

Signed-off-by: Julian Scheel <julian@jusst.de>
This commit is contained in:
Julian Scheel
2016-03-22 13:17:03 +01:00
parent 68fb9608eb
commit a2399d67c2
3 changed files with 159 additions and 1 deletions

View File

@@ -28,6 +28,16 @@
#include "platform/util/StdString.h"
#include "client.h"
struct OctonetEpgEntry
{
int64_t channelId;
time_t start;
time_t end;
int id;
std::string title;
std::string subtitle;
};
struct OctonetChannel
{
int64_t nativeId;
@@ -35,6 +45,8 @@ struct OctonetChannel
std::string url;
bool radio;
int id;
std::vector<OctonetEpgEntry> epg;
};
struct OctonetGroup
@@ -57,14 +69,23 @@ class OctonetData : public PLATFORM::CThread
virtual PVR_ERROR getGroups(ADDON_HANDLE handle, bool bRadio);
virtual PVR_ERROR getGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
virtual PVR_ERROR getEPG(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t start, time_t end);
protected:
virtual bool loadChannelList(void);
virtual bool loadEPG(void);
virtual OctonetGroup* findGroup(const std::string &name);
virtual void *Process(void);
OctonetChannel* findChannel(int64_t nativeId);
time_t parseDateTime(std::string date);
int64_t parseID(std::string id);
private:
std::string serverAddress;
std::vector<OctonetChannel> channels;
std::vector<OctonetGroup> groups;
time_t lastEpgLoad;
};