summaryrefslogtreecommitdiff
path: root/p2pvr/daemon
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-04-19 23:43:27 +0000
committerrandomdan <randomdan@localhost>2014-04-19 23:43:27 +0000
commite07c9021c580d6748db86de385e247adad167172 (patch)
tree50a126f435d8663589cad6121c69761a36c01fce /p2pvr/daemon
parentService stream in html5 compatible webm by default (diff)
downloadp2pvr-e07c9021c580d6748db86de385e247adad167172.tar.bz2
p2pvr-e07c9021c580d6748db86de385e247adad167172.tar.xz
p2pvr-e07c9021c580d6748db86de385e247adad167172.zip
Add methods for getting events that are part of schedules
Diffstat (limited to 'p2pvr/daemon')
-rw-r--r--p2pvr/daemon/si.cpp20
-rw-r--r--p2pvr/daemon/si.h2
-rw-r--r--p2pvr/daemon/sql/SI_eventsInSchedule.sql30
-rw-r--r--p2pvr/daemon/sql/SI_eventsInSchedules.sql29
4 files changed, 81 insertions, 0 deletions
diff --git a/p2pvr/daemon/si.cpp b/p2pvr/daemon/si.cpp
index dda2275..26f7808 100644
--- a/p2pvr/daemon/si.cpp
+++ b/p2pvr/daemon/si.cpp
@@ -11,6 +11,8 @@ ResourceString(SI_servicesSelectAll, daemon_sql_SI_servicesSelectAll_sql);
ResourceString(SI_servicesSelectById, daemon_sql_SI_servicesSelectById_sql);
ResourceString(SI_eventById, daemon_sql_SI_eventById_sql);
ResourceString(SI_eventsOnNow, daemon_sql_SI_eventsOnNow_sql);
+ResourceString(SI_eventsInSchedule, daemon_sql_SI_eventsInSchedule_sql);
+ResourceString(SI_eventsInSchedules, daemon_sql_SI_eventsInSchedules_sql);
ResourceString(SI_eventsInRange, daemon_sql_SI_eventsInRange_sql);
ResourceString(SI_eventSearch, daemon_sql_SI_eventSearch_sql);
@@ -135,3 +137,21 @@ SI::EventSearch(const IceUtil::Optional<std::string> & keywords, const IceUtil::
return rtn;
}
+DVBSI::Events
+SI::EventsInSchedules(const Ice::Current &)
+{
+ DVBSI::Events rtn;
+ SqlContainerCreator<DVBSI::Events, DVBSI::Event> cc(rtn);
+ cc.populate(Select(SI_eventsInSchedules).second);
+ return rtn;
+}
+
+DVBSI::Events
+SI::EventsInSchedule(int scheduleId, const Ice::Current &)
+{
+ DVBSI::Events rtn;
+ SqlContainerCreator<DVBSI::Events, DVBSI::Event> cc(rtn);
+ cc.populate(Select(SI_eventsInSchedule, scheduleId).second);
+ return rtn;
+}
+
diff --git a/p2pvr/daemon/si.h b/p2pvr/daemon/si.h
index c4a0f11..dd48d77 100644
--- a/p2pvr/daemon/si.h
+++ b/p2pvr/daemon/si.h
@@ -16,6 +16,8 @@ class SI : public P2PVR::SI, public DatabaseClient {
DVBSI::EventPtr GetEvent(int serviceId, int eventId, const Ice::Current &);
DVBSI::Events EventsOnNow(const Ice::Current &);
+ DVBSI::Events EventsInSchedules(const Ice::Current &);
+ DVBSI::Events EventsInSchedule(int scheduleId, const Ice::Current &);
DVBSI::Events EventsInRange(const Common::DateTime &, const Common::DateTime &, const Ice::Current &);
DVBSI::Events EventSearch(const IceUtil::Optional<std::string> & keywords, const IceUtil::Optional<Ice::Int> & serviceId, const IceUtil::Optional<Common::DateTime> & from, const IceUtil::Optional<Common::DateTime> & to, const Ice::Current &);
};
diff --git a/p2pvr/daemon/sql/SI_eventsInSchedule.sql b/p2pvr/daemon/sql/SI_eventsInSchedule.sql
new file mode 100644
index 0000000..3f919a5
--- /dev/null
+++ b/p2pvr/daemon/sql/SI_eventsInSchedule.sql
@@ -0,0 +1,30 @@
+select e.serviceid,
+ e.eventid,
+ e.title,
+ e.titlelang,
+ e.subtitle,
+ e.description,
+ e.descriptionlang,
+ e.videoaspect,
+ e.videoframerate,
+ e.videohd,
+ e.audiochannels,
+ e.audiolanguage,
+ e.subtitlelanguage,
+ e.category,
+ e.subcategory,
+ e.usercategory,
+ e.dvbrating,
+ e.starttime,
+ e.stoptime,
+ e.episode,
+ e.episodes,
+ e.year,
+ e.flags,
+ e.season
+from events e, record r
+where e.serviceid = r.serviceid
+and e.eventid = r.eventid
+and r.scheduleid = ?
+order by e.serviceid, e.starttime
+
diff --git a/p2pvr/daemon/sql/SI_eventsInSchedules.sql b/p2pvr/daemon/sql/SI_eventsInSchedules.sql
new file mode 100644
index 0000000..bd4637a
--- /dev/null
+++ b/p2pvr/daemon/sql/SI_eventsInSchedules.sql
@@ -0,0 +1,29 @@
+select e.serviceid,
+ e.eventid,
+ e.title,
+ e.titlelang,
+ e.subtitle,
+ e.description,
+ e.descriptionlang,
+ e.videoaspect,
+ e.videoframerate,
+ e.videohd,
+ e.audiochannels,
+ e.audiolanguage,
+ e.subtitlelanguage,
+ e.category,
+ e.subcategory,
+ e.usercategory,
+ e.dvbrating,
+ e.starttime,
+ e.stoptime,
+ e.episode,
+ e.episodes,
+ e.year,
+ e.flags,
+ e.season
+from events e, record r
+where e.serviceid = r.serviceid
+and e.eventid = r.eventid
+order by e.serviceid, e.starttime
+