Another elrond suggestion: only init orig_metadata if there's anything in the dict.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 3 Mar 2013 20:29:30 +0000 (14:29 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 3 Mar 2013 20:29:30 +0000 (14:29 -0600)
This commit sponsored by Joshua Rosen.  Thank you!

mediagoblin/media_types/video/processing.py

index ec9ff225b2f2a318912d87bdcfee8bc41dae7d29..3da19a08ee079e80f0b5ccae303b7e9999a65105 100644 (file)
@@ -178,5 +178,7 @@ def store_metadata(media_entry, metadata):
         videorate = metadata["videorate"]
         stored_metadata["videorate"] = [videorate.num, videorate.denom]
 
-    media_entry.media_data_init(
-        orig_metadata=stored_metadata)
+    # Only save this field if there's something to save
+    if len(stored_metadata):
+        media_entry.media_data_init(
+            orig_metadata=stored_metadata)