Made it possible to submit media with the metadata provided
authortilly-Q <nattilypigeonfowl@gmail.com>
Mon, 21 Apr 2014 16:07:33 +0000 (12:07 -0400)
committertilly-Q <nattilypigeonfowl@gmail.com>
Mon, 21 Apr 2014 16:11:12 +0000 (12:11 -0400)
mediagoblin/gmg_commands/batchaddmedia.py
mediagoblin/submit/lib.py

index deb6c5bdffe3f9d3557464dc9bc5b879f9a9139b..b6fd2763d036671999b2292d9038ba11f5233c2b 100644 (file)
@@ -178,6 +178,7 @@ FAIL: Local file {filename} could not be accessed.".format(filename=filename)
                 title=maybe_unicodeify(title),
                 description=maybe_unicodeify(description),
                 license=maybe_unicodeify(license),
+                metadata=json_ld_metadata,
                 tags_string=u"",
                 upload_limit=upload_limit, max_file_size=max_file_size)
             print "Successfully uploading {filename}!".format(filename=filename)
index c70e273185ea4c03ef7d3ea202bace7ef65dd236..df3f7b62dfca3f6dd6611af4b751743538924632 100644 (file)
@@ -98,7 +98,7 @@ class UserPastUploadLimit(UploadLimitError):
 
 def submit_media(mg_app, user, submitted_file, filename,
                  title=None, description=None,
-                 license=None, tags_string=u"",
+                 license=None, metadata=None, tags_string=u"",
                  upload_limit=None, max_file_size=None,
                  callback_url=None,
                  # If provided we'll do the feed_url update, otherwise ignore
@@ -142,6 +142,8 @@ def submit_media(mg_app, user, submitted_file, filename,
 
     entry.license = license or None
 
+    entry.media_metadata = metadata or u""
+
     # Process the user's folksonomy "tags"
     entry.tags = convert_to_tag_list_of_dicts(tags_string)