Commit a7e03f57 authored by Mike Lynch's avatar Mike Lynch
Browse files

Pronom URLs were not working for Siegfried 1.7.8 because of a change to the

Json/YAML properties in 1.5.0 - fixed this but it needs to be tested with an
older Siegfried
parent 8e322ab4
......@@ -183,17 +183,25 @@ module.exports = function() {
//console.log("FILE", this.is_file, this.collection.file_info_by_filename[this.is_file].filesize)
prop.parse("contentSize", String(file_info.filesize));
this.properties[prop.name] = prop;
//console.log("file_info\n" + JSON.stringify(file_info));
if (file_info.matches[0].id === "pronom") {
var fi = file_info.matches[0]
/* Siegfried v1.4.5 and earlier used id "pronom" and puid "fmt/44"
(for example). v1.5.0 and later use ns "pronom" and id "fmt/44".
Pick which one to use based on which of ns / id is defined
*/
if ( fi.ns === "pronom" || fi.id === "pronom" ) {
var pronom = new metadata_property_name();
const id = fi.ns ? fi.id : fi.puid;
pronom.parse(
"fileFormat",
"http://www.nationalarchives.gov.uk/PRONOM/" +
file_info.matches[0].puid
"http://www.nationalarchives.gov.uk/PRONOM/" + id
);
this.properties[pronom.name] = pronom;
//console.log("PRONOM NAME", pronom.name);
}
}
var name_prop = new metadata_property_name();
name_prop.parse("encodingFormat", file_info.matches[0].format);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment