summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/datasources/schema.sql181
-rw-r--r--p2pvr/ice/p2pvr.ice20
2 files changed, 146 insertions, 55 deletions
diff --git a/p2pvr/datasources/schema.sql b/p2pvr/datasources/schema.sql
index a3f5769..6dff1ec 100644
--- a/p2pvr/datasources/schema.sql
+++ b/p2pvr/datasources/schema.sql
@@ -30,6 +30,55 @@ SET default_tablespace = '';
SET default_with_oids = false;
--
+-- Name: events; Type: TABLE; Schema: public; Owner: gentoo; Tablespace:
+--
+
+CREATE TABLE events (
+ serviceid integer NOT NULL,
+ eventid integer NOT NULL,
+ title text,
+ titlelang text,
+ subtitle text,
+ description text,
+ descriptionlang text,
+ videoaspect smallint,
+ videoframerate smallint,
+ videohd boolean,
+ audiochannels smallint,
+ audiolanguage text,
+ subtitlelanguage text,
+ category smallint,
+ subcategory smallint,
+ usercategory smallint,
+ dvbrating smallint,
+ starttime timestamp without time zone,
+ stoptime timestamp without time zone,
+ episode smallint,
+ episodes smallint,
+ year smallint,
+ flags text,
+ season integer
+);
+
+
+ALTER TABLE public.events OWNER TO gentoo;
+
+--
+-- Name: event_tsvector(events); Type: FUNCTION; Schema: public; Owner: gentoo
+--
+
+CREATE FUNCTION event_tsvector(e events) RETURNS tsvector
+ LANGUAGE sql STABLE LEAKPROOF
+ AS $$
+select (setweight(to_tsvector('english', e.title), 'A') ||
+ setweight(to_tsvector('english', e.subtitle), 'B') ||
+ setweight(to_tsvector('english', e.description), 'C'));
+$$;
+
+
+ALTER FUNCTION public.event_tsvector(e events) OWNER TO gentoo;
+
+--
-- Name: delivery_dvbc; Type: TABLE; Schema: public; Owner: gentoo; Tablespace:
--
@@ -102,55 +151,6 @@ CREATE TABLE event_schedule (
ALTER TABLE public.event_schedule OWNER TO gentoo;
--
--- Name: events; Type: TABLE; Schema: public; Owner: gentoo; Tablespace:
---
-
-CREATE TABLE events (
- serviceid integer NOT NULL,
- eventid integer NOT NULL,
- title text,
- titlelang text,
- subtitle text,
- description text,
- descriptionlang text,
- videoaspect smallint,
- videoframerate smallint,
- videohd boolean,
- audiochannels smallint,
- audiolanguage text,
- subtitlelanguage text,
- category smallint,
- subcategory smallint,
- usercategory smallint,
- dvbrating smallint,
- starttime timestamp without time zone,
- stoptime timestamp without time zone,
- episode smallint,
- episodes smallint,
- year smallint,
- flags text,
- season integer
-);
-
-
-ALTER TABLE public.events OWNER TO gentoo;
-
---
--- Name: event_tsvector(events); Type: FUNCTION; Schema: public; Owner: gentoo
---
-
-CREATE FUNCTION event_tsvector(e events) RETURNS tsvector
- LANGUAGE sql STABLE LEAKPROOF
- AS $$
-select (setweight(to_tsvector('english', e.title), 'A') ||
- setweight(to_tsvector('english', e.subtitle), 'B') ||
- setweight(to_tsvector('english', e.description), 'C'));
-$$;
-
-
-ALTER FUNCTION public.event_tsvector(e events) OWNER TO gentoo;
-
---
-- Name: networks; Type: TABLE; Schema: public; Owner: gentoo; Tablespace:
--
@@ -215,6 +215,46 @@ ALTER SEQUENCE recorded_recordedid_seq OWNED BY recorded.recordedid;
--
+-- Name: recordings; Type: TABLE; Schema: public; Owner: gentoo; Tablespace:
+--
+
+CREATE TABLE recordings (
+ recordingid integer NOT NULL,
+ storageaddress text NOT NULL,
+ guid text NOT NULL,
+ scheduleid integer NOT NULL,
+ title text,
+ subtitle text,
+ description text,
+ starttime timestamp without time zone NOT NULL,
+ duration interval NOT NULL
+);
+
+
+ALTER TABLE public.recordings OWNER TO gentoo;
+
+--
+-- Name: recordings_recordingid_seq; Type: SEQUENCE; Schema: public; Owner: gentoo
+--
+
+CREATE SEQUENCE recordings_recordingid_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.recordings_recordingid_seq OWNER TO gentoo;
+
+--
+-- Name: recordings_recordingid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: gentoo
+--
+
+ALTER SEQUENCE recordings_recordingid_seq OWNED BY recordings.recordingid;
+
+
+--
-- Name: schedules; Type: TABLE; Schema: public; Owner: gentoo; Tablespace:
--
@@ -309,6 +349,13 @@ ALTER TABLE ONLY recorded ALTER COLUMN recordedid SET DEFAULT nextval('recorded_
--
+-- Name: recordingid; Type: DEFAULT; Schema: public; Owner: gentoo
+--
+
+ALTER TABLE ONLY recordings ALTER COLUMN recordingid SET DEFAULT nextval('recordings_recordingid_seq'::regclass);
+
+
+--
-- Name: scheduleid; Type: DEFAULT; Schema: public; Owner: gentoo
--
@@ -372,6 +419,14 @@ ALTER TABLE ONLY recorded
--
+-- Name: pk_recordings; Type: CONSTRAINT; Schema: public; Owner: gentoo; Tablespace:
+--
+
+ALTER TABLE ONLY recordings
+ ADD CONSTRAINT pk_recordings PRIMARY KEY (recordingid);
+
+
+--
-- Name: pk_records; Type: CONSTRAINT; Schema: public; Owner: gentoo; Tablespace:
--
@@ -447,6 +502,34 @@ CREATE INDEX idx_recorded_title ON recorded USING btree (title);
--
+-- Name: idx_recordings_schedule; Type: INDEX; Schema: public; Owner: gentoo; Tablespace:
+--
+
+CREATE INDEX idx_recordings_schedule ON recordings USING btree (scheduleid);
+
+
+--
+-- Name: idx_recordings_starttime; Type: INDEX; Schema: public; Owner: gentoo; Tablespace:
+--
+
+CREATE INDEX idx_recordings_starttime ON recordings USING btree (starttime);
+
+
+--
+-- Name: idx_recordings_title; Type: INDEX; Schema: public; Owner: gentoo; Tablespace:
+--
+
+CREATE INDEX idx_recordings_title ON recordings USING btree (title);
+
+
+--
+-- Name: uni_recordings_storage; Type: INDEX; Schema: public; Owner: gentoo; Tablespace:
+--
+
+CREATE UNIQUE INDEX uni_recordings_storage ON recordings USING btree (storageaddress, guid);
+
+
+--
-- Name: fk_delivery_dvbc_transportstream; Type: FK CONSTRAINT; Schema: public; Owner: gentoo
--
diff --git a/p2pvr/ice/p2pvr.ice b/p2pvr/ice/p2pvr.ice
index b4aeb8a..e37f2a0 100644
--- a/p2pvr/ice/p2pvr.ice
+++ b/p2pvr/ice/p2pvr.ice
@@ -173,15 +173,16 @@ module P2PVR {
sequence<Program> ProgramList;
// Something that we have recorded.
- struct Recording {
+ class Recording {
int RecordingId;
+ string StorageAddress;
+ string Guid;
+ optional(1) int ScheduleId;
string Title;
- string Subtitle;
- string Description;
+ optional(2) string Subtitle;
+ optional(3) string Description;
Common::DateTime StartTime;
- Common::DateTime EndTime;
- long FileSize;
- int ServiceId;
+ string Duration;
};
sequence<Recording> RecordingList;
@@ -254,7 +255,14 @@ module P2PVR {
idempotent void UpdateEvents(short type);
};
+ interface Storage {
+ idempotent string CreateForEventRecording(Schedule sc, DVBSI::Service se, DVBSI::Event ev);
+ idempotent RawDataClient OpenForWrite(string guid);
+ idempotent void Delete(string guid);
+ };
+
interface Recordings {
+ idempotent int NewRecording(Recording rec);
idempotent void DeleteRecording(int recordingId);
idempotent RecordingList GetRecordings();
};