aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2014-05-07 15:21:10 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-05-07 15:21:10 -0500
commit2a2c534e51f47cbf7c537c9b659648f23146a64b (patch)
tree5dda4e2e952f0a410a7551e0aea06c8c08a7e4f4
parentaf3a9107a9aef453b62f8fd83e03e9a1bbe416b8 (diff)
downloadmediagoblin-2a2c534e51f47cbf7c537c9b659648f23146a64b.tar.lz
mediagoblin-2a2c534e51f47cbf7c537c9b659648f23146a64b.tar.xz
mediagoblin-2a2c534e51f47cbf7c537c9b659648f23146a64b.zip
Removing build_json_ld_metadata
-rw-r--r--mediagoblin/gmg_commands/batchaddmedia.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/mediagoblin/gmg_commands/batchaddmedia.py b/mediagoblin/gmg_commands/batchaddmedia.py
index 41fb86c9..cf362d83 100644
--- a/mediagoblin/gmg_commands/batchaddmedia.py
+++ b/mediagoblin/gmg_commands/batchaddmedia.py
@@ -139,8 +139,7 @@ zip files and directories"
sanitized_metadata = check_metadata_format(file_metadata)
if sanitized_metadata == {}: continue
- json_ld_metadata = jsonld.compact(build_json_ld_metadata(file_metadata),
- metadata_context)
+ json_ld_metadata = jsonld.compact(file_metadata, metadata_context)
original_location = media_locations[media_id]['media:original']
url = urlparse(original_location)
@@ -219,20 +218,6 @@ def teardown(temp_files):
for temp_file in temp_files:
subprocess.call(['rm','-r',temp_file])
-def build_json_ld_metadata(metadata_dict):
- output_dict = {}
- for p in metadata_dict.keys():
- if p in ["dcterms:rights", "dcterms:relation"]:
- m_type = "xsd:uri"
- elif p in ["dcterms:date", "dcterms:created"]:
- m_type = "xsd:date"
- else:
- m_type = "xsd:string"
- description = {"@value": metadata_dict[p],
- "@type" : m_type}
- output_dict[p] = description
- return output_dict
-
## Set up the MediaGoblin checker
#