[Debconf-video-commits] r216 - in package/trunk: conf src

benh at alioth.debian.org benh at alioth.debian.org
Thu Aug 7 21:53:59 UTC 2008


Author: benh
Date: 2008-08-07 21:53:58 +0000 (Thu, 07 Aug 2008)
New Revision: 216

Modified:
   package/trunk/conf/video-data.sql
   package/trunk/src/dc-publish
   package/trunk/src/dc-video-schema.sql
Log:
Although the RSS feed only includes the 'low' format, we want to publish the 'high' format files too.
Therefore define a 'published' flag to video_target_format and use it in dc-publish.


Modified: package/trunk/conf/video-data.sql
===================================================================
--- package/trunk/conf/video-data.sql	2008-08-07 21:33:31 UTC (rev 215)
+++ package/trunk/conf/video-data.sql	2008-08-07 21:53:58 UTC (rev 216)
@@ -17,50 +17,60 @@
 INSERT INTO video_target_format(
     target_format_abbr, priority, container_name, filename_extension,
     video_width, video_height, video_codec_name, video_bit_rate,
-    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate
+    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate,
+    published
 )
 VALUES(
     'archival', 100, 'ogg', '.ogg',
     0, 0, 'theora', 4000000,
-    0, 0, 'vorbis', 192000
+    0, 0, 'vorbis', 192000,
+    false
 );
 INSERT INTO video_target_format(
     target_format_abbr, priority, container_name, filename_extension,
     video_width, video_height, video_codec_name, video_bit_rate,
-    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate
+    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate,
+    published
 )
 VALUES(
     'high', 25, 'ogg', '.ogg',
     0, 0, 'theora', 1500000,
-    0, 0, 'vorbis', 128000
+    0, 0, 'vorbis', 128000,
+    true
 );
 INSERT INTO video_target_format(
     target_format_abbr, priority, container_name, filename_extension,
     video_width, video_height, video_codec_name, video_bit_rate,
-    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate
+    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate,
+    published
 )
 VALUES(
     'low', 50, 'ogg', '.ogg',
     320, 240, 'theora', 230000,
-    32000, 1, 'vorbis', 64000
+    32000, 1, 'vorbis', 64000,
+    true
 );
 INSERT INTO video_target_format(
     target_format_abbr, priority, container_name, filename_extension,
     video_width, video_height, video_codec_name, video_bit_rate,
-    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate
+    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate,
+    published
 )
 VALUES(
     'ntsc-dvd', 0, 'ntsc-dvd', '.mpeg',
     352, 240, 'mpeg1video', 220000,
-    48000, 2, 'ac3', 128000
+    48000, 2, 'ac3', 128000,
+    false
 );
 INSERT INTO video_target_format(
     target_format_abbr, priority, container_name, filename_extension,
     video_width, video_height, video_codec_name, video_bit_rate,
-    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate
+    audio_sample_rate, audio_channel_count, audio_codec_name, audio_bit_rate,
+    published
 )
 VALUES(
     'pal-dvd', 0, 'pal-dvd', '.mpeg',
     352, 240, 'mpeg1video', 220000,
-    48000, 2, 'mp2', 128000
+    48000, 2, 'mp2', 128000,
+    false
 );

Modified: package/trunk/src/dc-publish
===================================================================
--- package/trunk/src/dc-publish	2008-08-07 21:33:31 UTC (rev 215)
+++ package/trunk/src/dc-publish	2008-08-07 21:53:58 UTC (rev 216)
@@ -131,28 +131,25 @@
                 {'title': conference_title})
     conference_id = cur.fetchone()
 
-    cur.execute("SELECT id, filename_extension FROM video_target_format"
-                " WHERE target_format_abbr = %(format_abbr)s",
-                {'format_abbr': format_abbr})
-    format_id, format_ext = cur.fetchone()
-
     file_ids = []
     file_names = []
 
     cur.execute("""
-SELECT video_target_file.id, event_recording_base_name
+SELECT video_target_file.id, target_format_abbr, event_recording_base_name,
+       filename_extension
 FROM
-((video_target_file JOIN video_event_recording
-  ON video_target_file.event_recording_id = video_event_recording.id)
- JOIN event
- ON video_event_recording.event_id = event.event_id)
+(((video_target_file JOIN video_event_recording
+   ON video_target_file.event_recording_id = video_event_recording.id)
+  JOIN event
+  ON video_event_recording.event_id = event.event_id)
+ JOIN video_target_format
+ ON video_target_file.target_format_id = video_target_format.id)
 WHERE event.conference_id = %(conference_id)s
-      AND video_target_file.target_format_id = %(format_id)d
+      AND video_target_format.published
       AND published_time IS NULL
 """,
-                {'conference_id': conference_id,
-                 'format_id': format_id})
-    for file_id, base_name in cur.fetchall():
+                {'conference_id': conference_id})
+    for file_id, format_abbr, base_name, format_ext in cur.fetchall():
         file_ids.append(file_id)
         file_names.append('%s/%s%s' % (format_abbr, base_name, format_ext))
 

Modified: package/trunk/src/dc-video-schema.sql
===================================================================
--- package/trunk/src/dc-video-schema.sql	2008-08-07 21:33:31 UTC (rev 215)
+++ package/trunk/src/dc-video-schema.sql	2008-08-07 21:53:58 UTC (rev 216)
@@ -65,7 +65,8 @@
     audio_channel_count integer NOT NULL
     CHECK (audio_channel_count >= 0 AND audio_channel_count <= 2),
     audio_codec_name character varying(20) NOT NULL,
-    audio_bit_rate integer NOT NULL CHECK (audio_bit_rate >= 10000)
+    audio_bit_rate integer NOT NULL CHECK (audio_bit_rate >= 10000),
+    published boolean
 );
 
 -- Target file that has been created.  Its name can be inferred




More information about the Debconf-video-commits mailing list