From 32aec1e533e9de8b843e54d5a08b55d26e81f87e Mon Sep 17 00:00:00 2001 From: tilly-Q Date: Thu, 27 Mar 2014 17:10:31 -0400 Subject: Fixed a minor error in the batch upload script and modified the json-ld context. --- mediagoblin/gmg_commands/batchaddmedia.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mediagoblin/gmg_commands') diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py index 414e969c..012a5ee4 100644 --- a/mediagoblin/gmg_commands/batchaddmedia.py +++ b/mediagoblin/gmg_commands/batchaddmedia.py @@ -137,6 +137,8 @@ zip files and directories" dcterms_context = { 'dcterms':'http://purl.org/dc/terms/' } for media_id in media_locations.keys(): + files_attempted += 1 + file_metadata = media_metadata[media_id] sanitized_metadata = check_metadata_format(file_metadata) if sanitized_metadata == {}: continue @@ -149,7 +151,6 @@ zip files and directories" description = file_metadata.get('dcterms:description') license = file_metadata.get('dcterms:license') filename = url.path.split()[-1] - files_attempted += 1 if url.scheme == 'http': media_file = tempfile.TemporaryFile() @@ -228,6 +229,7 @@ def check_metadata_format(metadata_dict): "$schema":"http://json-schema.org/schema#", "properties":{ "@context":{}, + "dcterms:contributor":{}, "dcterms:coverage":{}, "dcterms:created":{}, @@ -246,8 +248,7 @@ def check_metadata_format(metadata_dict): "dcterms:source":{}, "dcterms:subject":{}, "dcterms:title":{}, - "dcterms:type":{}, - "media:id":{} + "dcterms:type":{} }, "additionalProperties": false, "required":["dcterms:title","@context","media:id"] @@ -260,7 +261,7 @@ def check_metadata_format(metadata_dict): title = metadata_dict.get('dcterms:title') or metadata_dict.get('media:id') or \ _(u'UNKNOWN FILE') print _( -u"""WARN: Could not find appropriate metadata for file {title}. +u"""WARN: Could not find appropriate metadata for file "{title}". File will be skipped""".format(title=title)) output_dict = {} except: -- cgit v1.2.3