From 4727ee109ee66c959d3e1bd72b47cc0ff8dd4fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= Date: Sun, 15 Oct 2017 13:33:36 +0200 Subject: Handle collection in batchaddmedia command Make the batchaddmedia command look for a 'collection-slug' column, that for each row may specify the slug of a collection that the media should be added to. This matches the '--collection-slug' argument of the addmedia command. --- mediagoblin/gmg_commands/batchaddmedia.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mediagoblin/gmg_commands') diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py index 2e3d9a40..a521fe4d 100644 --- a/mediagoblin/gmg_commands/batchaddmedia.py +++ b/mediagoblin/gmg_commands/batchaddmedia.py @@ -110,6 +110,7 @@ def batchaddmedia(args): title = file_metadata.get('title') or file_metadata.get('dc:title') description = (file_metadata.get('description') or file_metadata.get('dc:description')) + collection_slug = file_metadata.get('collection-slug') license = file_metadata.get('license') try: @@ -152,6 +153,7 @@ FAIL: Local file {filename} could not be accessed. filename=filename, title=maybe_unicodeify(title), description=maybe_unicodeify(description), + collection_slug=maybe_unicodeify(collection_slug), license=maybe_unicodeify(license), metadata=json_ld_metadata, tags_string=u"") -- cgit v1.2.3