aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-03-03 14:29:30 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-03-03 14:29:30 -0600
commit4f239ff19418a48fa4d369efb005abfc09593359 (patch)
treee91b76353fb3e080b59648baa76992df4b31d8c6
parent9d4cebfd36b7bba3d8d4ad2cb97a85ec63068cb5 (diff)
downloadmediagoblin-4f239ff19418a48fa4d369efb005abfc09593359.tar.lz
mediagoblin-4f239ff19418a48fa4d369efb005abfc09593359.tar.xz
mediagoblin-4f239ff19418a48fa4d369efb005abfc09593359.zip
Another elrond suggestion: only init orig_metadata if there's anything in the dict.
This commit sponsored by Joshua Rosen. Thank you!
-rw-r--r--mediagoblin/media_types/video/processing.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/media_types/video/processing.py b/mediagoblin/media_types/video/processing.py
index ec9ff225..3da19a08 100644
--- a/mediagoblin/media_types/video/processing.py
+++ b/mediagoblin/media_types/video/processing.py
@@ -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)