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.
This commit is contained in:
parent
3eadd6705e
commit
4727ee109e
@ -87,6 +87,7 @@ just as easy to provide this information through the correct metadata columns.
|
|||||||
- **license** is used to set a license for your piece a media for MediaGoblin's use. This must be a URI.
|
- **license** is used to set a license for your piece a media for MediaGoblin's use. This must be a URI.
|
||||||
- **title** will set the title displayed to MediaGoblin users.
|
- **title** will set the title displayed to MediaGoblin users.
|
||||||
- **description** will set a description of your media.
|
- **description** will set a description of your media.
|
||||||
|
- **collection-slug** will add the media to a collection, if a collection with the given slug exists.
|
||||||
|
|
||||||
Metadata columns
|
Metadata columns
|
||||||
----------------
|
----------------
|
||||||
|
@ -110,6 +110,7 @@ def batchaddmedia(args):
|
|||||||
title = file_metadata.get('title') or file_metadata.get('dc:title')
|
title = file_metadata.get('title') or file_metadata.get('dc:title')
|
||||||
description = (file_metadata.get('description') or
|
description = (file_metadata.get('description') or
|
||||||
file_metadata.get('dc:description'))
|
file_metadata.get('dc:description'))
|
||||||
|
collection_slug = file_metadata.get('collection-slug')
|
||||||
|
|
||||||
license = file_metadata.get('license')
|
license = file_metadata.get('license')
|
||||||
try:
|
try:
|
||||||
@ -152,6 +153,7 @@ FAIL: Local file {filename} could not be accessed.
|
|||||||
filename=filename,
|
filename=filename,
|
||||||
title=maybe_unicodeify(title),
|
title=maybe_unicodeify(title),
|
||||||
description=maybe_unicodeify(description),
|
description=maybe_unicodeify(description),
|
||||||
|
collection_slug=maybe_unicodeify(collection_slug),
|
||||||
license=maybe_unicodeify(license),
|
license=maybe_unicodeify(license),
|
||||||
metadata=json_ld_metadata,
|
metadata=json_ld_metadata,
|
||||||
tags_string=u"")
|
tags_string=u"")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user