From 4f239ff19418a48fa4d369efb005abfc09593359 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Mar 2013 14:29:30 -0600 Subject: [PATCH] Another elrond suggestion: only init orig_metadata if there's anything in the dict. This commit sponsored by Joshua Rosen. Thank you! --- mediagoblin/media_types/video/processing.py | 6 ++++-- 1 file 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) -- 2.25.1