Cleaned up the 'batchaddmedia' command a bit
This commit is contained in:
parent
6b6b1b076b
commit
e8d64d453b
@ -128,6 +128,12 @@ zip files and directories"
|
|||||||
files_attempted += 1
|
files_attempted += 1
|
||||||
|
|
||||||
file_metadata = media_metadata[media_id]
|
file_metadata = media_metadata[media_id]
|
||||||
|
|
||||||
|
### Remove all metadata entries starting with 'media' because we are ###
|
||||||
|
### only using those for internal use. ###
|
||||||
|
file_metadata = dict([(key, value)
|
||||||
|
for key, value in file_metadata.iteritems() if
|
||||||
|
key.split(":")[0] != 'media'])
|
||||||
try:
|
try:
|
||||||
json_ld_metadata = compact_and_validate(file_metadata)
|
json_ld_metadata = compact_and_validate(file_metadata)
|
||||||
except ValidationError, exc:
|
except ValidationError, exc:
|
||||||
@ -138,8 +144,10 @@ zip files and directories"
|
|||||||
original_location = media_locations[media_id]['media:original']
|
original_location = media_locations[media_id]['media:original']
|
||||||
url = urlparse(original_location)
|
url = urlparse(original_location)
|
||||||
|
|
||||||
title = json_ld_metadata.get('dcterms:title')
|
### Pull the important media information for mediagoblin from the ###
|
||||||
description = json_ld_metadata.get('dcterms:description')
|
### metadata, if it is provided. ###
|
||||||
|
title = json_ld_metadata.get('dc:title')
|
||||||
|
description = json_ld_metadata.get('dc:description')
|
||||||
|
|
||||||
license = json_ld_metadata.get('license')
|
license = json_ld_metadata.get('license')
|
||||||
filename = url.path.split()[-1]
|
filename = url.path.split()[-1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user