From: Christopher Allan Webber Date: Sun, 3 Mar 2013 20:29:30 +0000 (-0600) Subject: Another elrond suggestion: only init orig_metadata if there's anything in the dict. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4f239ff19418a48fa4d369efb005abfc09593359;p=mediagoblin.git Another elrond suggestion: only init orig_metadata if there's anything in the dict. This commit sponsored by Joshua Rosen. Thank you! --- 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)