From 229cfefaf7923992b849e6d2d2fc355a08315290 Mon Sep 17 00:00:00 2001 From: klea Date: Fri, 26 Dec 2025 00:18:37 +0000 Subject: ia-metadata-for-dir2ia: parse things better, and add newlines --- bin/ia-metadata-for-dir2ia | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/ia-metadata-for-dir2ia b/bin/ia-metadata-for-dir2ia index 35c4553..0a7fb0c 100755 --- a/bin/ia-metadata-for-dir2ia +++ b/bin/ia-metadata-for-dir2ia @@ -2,7 +2,22 @@ ia-metadata "$@" | jq -r ' .metadata | -del(.identifier, .publicdate, .addeddate, .curation, .uploader) | +.collection |= if . | type=="string" then [.] end | +.collection_added |= (.//[]) | +.collection_added |= if . | type=="string" then [.] end | +.collection -= .collection_added | +del( + .addeddate, + .audio_codec, + .audio_sample_rate, + .collection_added, + .curation, + .frames_per_second, + .identifier, + .publicdate, + .uploader, + .ZZZZZZZZZZZZZZZ_emptyentryattheend +) | to_entries[] | if (.value|type=="array") then { @@ -10,5 +25,5 @@ if (.value|type=="array") then value:.value[] } end | -"\u0027\(.key):\(.value)\u0027" +"\(.key):\(.value)" | @sh ' -- cgit v1.3.1-10-gc9f91