Another elrond suggestion: only init orig_metadata if there's anything in the dict.

This commit sponsored by Joshua Rosen.  Thank you!
This commit is contained in:
Christopher Allan Webber 2013-03-03 14:29:30 -06:00
parent 9d4cebfd36
commit 4f239ff194

View File

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