Skip to content
Permalink
Browse files

Fix minor JSON errors

  • Loading branch information...
Allen Riddell
Allen Riddell committed Mar 11, 2015
1 parent dad8778 commit 331eced9fa89b0d126d717a2064ba9bb1d878131
@@ -56,7 +56,11 @@ def fetch_volumes():
for dirpath, dirnames, filenames in os.walk(volumes_dir):
for fn in filenames:
if fn == 'metadata.json':
metadata = json.load(open(os.path.join(dirpath, fn), encoding='utf8'))
try:
metadata = json.load(open(os.path.join(dirpath, fn), encoding='utf8'))
except ValueError:
logger.critical("Failed to load {}".format(os.path.join(dirpath, fn)))
raise
work_id = int(metadata['work_id'])
volumes[work_id] += [metadata]
# sort volumes in ascending order by volume number
@@ -5,5 +5,5 @@
"volume_count": 3,
"date_created": "2015-03-11",
"date_updated": "2015-03-11",
"sha1": "385d121ef44e4b1e7a33dd0cb885b4afb80bed84",
"sha1": "385d121ef44e4b1e7a33dd0cb885b4afb80bed84"
}
@@ -5,5 +5,5 @@
"volume_count": 3,
"date_created": "2015-03-11",
"date_updated": "2015-03-11",
"sha1": "dc2d58e4c439dbf7c0c1debec6bab420e5c2d4a7",
"sha1": "dc2d58e4c439dbf7c0c1debec6bab420e5c2d4a7"
}
@@ -5,5 +5,5 @@
"volume_count": 3,
"date_created": "2015-03-11",
"date_updated": "2015-03-11",
"sha1": "7445eb3ec6698c2b375fa47436cddea6f1b10d59",
"sha1": "7445eb3ec6698c2b375fa47436cddea6f1b10d59"
}
@@ -5,5 +5,5 @@
"volume_count": 3,
"date_created": "2015-03-11",
"date_updated": "2015-03-11",
"sha1": "6dde70bf6a39fcb523514b90faa3f98671f2208c",
"sha1": "6dde70bf6a39fcb523514b90faa3f98671f2208c"
}
@@ -5,5 +5,5 @@
"volume_count": 3,
"date_created": "2015-03-11",
"date_updated": "2015-03-11",
"sha1": "bf090bc951be00f76e8de0eea8c90cc45e0e2ca5",
"sha1": "bf090bc951be00f76e8de0eea8c90cc45e0e2ca5"
}
@@ -5,5 +5,5 @@
"volume_count": 3,
"date_created": "2015-03-11",
"date_updated": "2015-03-11",
"sha1": "6af86118f8dc0aaf3e322ad4fd353e3e56717900",
"sha1": "6af86118f8dc0aaf3e322ad4fd353e3e56717900"
}

0 comments on commit 331eced

Please sign in to comment.
You can’t perform that action at this time.