[Debconf-video-commits] r101 - package/trunk/src

benh at alioth.debian.org benh at alioth.debian.org
Thu Jun 26 22:26:51 UTC 2008


Author: benh
Date: 2008-06-26 22:26:50 +0000 (Thu, 26 Jun 2008)
New Revision: 101

Modified:
   package/trunk/src/dc-import-recordings
Log:
Updated for schema changes in room/conference_room and video_recording tables.


Modified: package/trunk/src/dc-import-recordings
===================================================================
--- package/trunk/src/dc-import-recordings	2008-06-06 16:26:11 UTC (rev 100)
+++ package/trunk/src/dc-import-recordings	2008-06-26 22:26:50 UTC (rev 101)
@@ -14,6 +14,11 @@
                         password=config.get('DATABASE_PASSWORD'))
     cur = conn.cursor()
 
+    # Find conference id.
+    cur.execute('SELECT conference_id FROM conference WHERE title=%(title)s',
+                {'title': config['CONFERENCE_NAME']})
+    conf_id = cur.fetchone()[0]
+
     # Find currently known recordings.
     cur.execute('SELECT recording_filename FROM video_recording')
     known_filenames = set(tup[0] for tup in cur.fetchall())
@@ -53,13 +58,14 @@
 
         try:
             cur.execute(
-                'INSERT INTO video_recording(room_id, recording_time,'
-                ' recording_duration, recording_filename, file_status_id)'
-                ' VALUES ('
-                ' (SELECT room_id FROM room where short_name=%(room)s),'
+                'INSERT INTO video_recording(conference_id, conference_room,'
+                ' recording_time, recording_duration, recording_filename,'
+                ' file_status_id)'
+                ' VALUES (%(conf_id)d, %(room)s,'
                 ' %(date_time)s, %(duration)s, %(filename)s,'
                 ' (SELECT id FROM video_file_status WHERE file_status_code=%(status)s))',
-                {'room': room,
+                {'conf_id': conf_id,
+                 'room': room,
                  'date_time': date_rec + ' ' + time_rec,
                  'duration': str(os.stat(filename).st_size // dif_bytes_per_second),
                  'filename': filename,




More information about the Debconf-video-commits mailing list