summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-12-14 04:15:33 +0000
committerrandomdan <randomdan@localhost>2013-12-14 04:15:33 +0000
commitb1d22cdc62d967a008602a2ab0083e3ea322d882 (patch)
treec8fa44d8d3cf2cedc415e17e2e5e073f1266502d
parentAllow FileSink to take a file handle as well as a path (diff)
downloadp2pvr-b1d22cdc62d967a008602a2ab0083e3ea322d882.tar.bz2
p2pvr-b1d22cdc62d967a008602a2ab0083e3ea322d882.tar.xz
p2pvr-b1d22cdc62d967a008602a2ab0083e3ea322d882.zip
Fixups around the schema of services and it's other columns
-rw-r--r--p2pvr/datasources/schema.sql8
-rw-r--r--p2pvr/lib/dvbsiHelpers/service.cpp12
-rw-r--r--p2pvr/lib/si.cpp8
-rw-r--r--p2pvr/lib/sql/SI_servicesSelectAll.sql3
-rw-r--r--p2pvr/lib/sql/SI_servicesSelectById.sql3
5 files changed, 28 insertions, 6 deletions
diff --git a/p2pvr/datasources/schema.sql b/p2pvr/datasources/schema.sql
index 6dff1ec..3f51014 100644
--- a/p2pvr/datasources/schema.sql
+++ b/p2pvr/datasources/schema.sql
@@ -304,10 +304,10 @@ CREATE TABLE services (
providername text,
type smallint,
defaultauthority text,
- runningstatus smallint,
- eitschedule boolean,
- eitpresentfollowing boolean,
- freecamode boolean,
+ runningstatus smallint NOT NULL,
+ eitschedule boolean NOT NULL,
+ eitpresentfollowing boolean NOT NULL,
+ freecamode boolean NOT NULL,
transportstreamid integer NOT NULL,
programid integer
);
diff --git a/p2pvr/lib/dvbsiHelpers/service.cpp b/p2pvr/lib/dvbsiHelpers/service.cpp
index afce096..9f82d91 100644
--- a/p2pvr/lib/dvbsiHelpers/service.cpp
+++ b/p2pvr/lib/dvbsiHelpers/service.cpp
@@ -11,6 +11,10 @@ CreateColumns<DVBSI::ServicePtr>(const ColumnCreator & cc)
cc("name", false);
cc("providerName", false);
cc("defaultAuthority", false);
+ cc("runningStatus", false);
+ cc("eitSchedule", false);
+ cc("eitPresentFollowing", false);
+ cc("freeCAMode", false);
}
template<>
@@ -22,6 +26,10 @@ BindColumns(RowState & rs, const DVBSI::ServicePtr & s)
rs.fields[2] << s->Name;
rs.fields[3] << s->ProviderName;
rs.fields[4] << s->DefaultAuthority;
+ rs.fields[5] << s->RunningStatus;
+ rs.fields[6] << s->EitSchedule;
+ rs.fields[7] << s->EitPresentFollowing;
+ rs.fields[8] << s->FreeCaMode;
}
template<>
@@ -33,5 +41,9 @@ UnbindColumns(RowState & rs, DVBSI::ServicePtr const & s)
rs.fields[2] >> s->Name;
rs.fields[3] >> s->ProviderName;
rs.fields[4] >> s->DefaultAuthority;
+ rs.fields[5] >> s->RunningStatus;
+ rs.fields[6] >> s->EitSchedule;
+ rs.fields[7] >> s->EitPresentFollowing;
+ rs.fields[8] >> s->FreeCaMode;
}
diff --git a/p2pvr/lib/si.cpp b/p2pvr/lib/si.cpp
index abcb9fd..ce55fbc 100644
--- a/p2pvr/lib/si.cpp
+++ b/p2pvr/lib/si.cpp
@@ -1,10 +1,14 @@
#include <pch.hpp>
#include "si.h"
+#include "resources.h"
#include "dvbsiHelpers.h"
#include "sqlContainerCreator.h"
#include <linux/dvb/frontend.h>
#include <logger.h>
+ResourceString(SI_servicesSelectAll, lib_sql_SI_servicesSelectAll_sql);
+ResourceString(SI_servicesSelectById, lib_sql_SI_servicesSelectById_sql);
+
P2PVR::Deliveries
SI::GetAllDeliveries(short type, const Ice::Current &)
{
@@ -66,7 +70,7 @@ SI::GetServices(const Ice::Current&)
{
DVBSI::ServiceList rtn;
SqlContainerCreator<DVBSI::ServiceList, DVBSI::Service> cc(rtn);
- cc.populate(Select("SELECT * FROM services ORDER BY serviceId"));
+ cc.populate(Select(SI_servicesSelectAll));
return rtn;
}
@@ -75,7 +79,7 @@ SI::GetService(int id, const Ice::Current&)
{
DVBSI::ServiceList rtn;
SqlContainerCreator<DVBSI::ServiceList, DVBSI::Service> cc(rtn);
- cc.populate(Select("SELECT * FROM services WHERE serviceId = ?", id));
+ cc.populate(Select(SI_servicesSelectById, id));
return rtn.front();
}
diff --git a/p2pvr/lib/sql/SI_servicesSelectAll.sql b/p2pvr/lib/sql/SI_servicesSelectAll.sql
new file mode 100644
index 0000000..513a076
--- /dev/null
+++ b/p2pvr/lib/sql/SI_servicesSelectAll.sql
@@ -0,0 +1,3 @@
+SELECT serviceId, transportStreamId, name, providerName, defaultAuthority, runningStatus, eitSchedule, eitPresentFollowing, freeCaMode
+FROM services
+ORDER BY serviceId
diff --git a/p2pvr/lib/sql/SI_servicesSelectById.sql b/p2pvr/lib/sql/SI_servicesSelectById.sql
new file mode 100644
index 0000000..f0bda72
--- /dev/null
+++ b/p2pvr/lib/sql/SI_servicesSelectById.sql
@@ -0,0 +1,3 @@
+SELECT serviceId, transportStreamId, name, providerName, defaultAuthority, runningStatus, eitSchedule, eitPresentFollowing, freeCaMode
+FROM services
+WHERE serviceId = ?