aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands
diff options
context:
space:
mode:
authorSimen Heggestøyl <simenheg@gmail.com>2017-10-15 13:33:36 +0200
committerBoris Bobrov <breton@cynicmansion.ru>2017-10-16 18:22:30 +0300
commit4727ee109ee66c959d3e1bd72b47cc0ff8dd4fdd (patch)
treef3648e32c4e250c900c2f2c52c04e587ce1e2c6d /mediagoblin/gmg_commands
parent3eadd6705e9ad5ee39042a130d7b3fdd74200d68 (diff)
downloadmediagoblin-4727ee109ee66c959d3e1bd72b47cc0ff8dd4fdd.tar.lz
mediagoblin-4727ee109ee66c959d3e1bd72b47cc0ff8dd4fdd.tar.xz
mediagoblin-4727ee109ee66c959d3e1bd72b47cc0ff8dd4fdd.zip
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.
Diffstat (limited to 'mediagoblin/gmg_commands')
-rw-r--r--mediagoblin/gmg_commands/batchaddmedia.py2
1 files changed, 2 insertions, 0 deletions
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"")