Skip to content

Commit

Permalink
added mimetype to audio config json
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-jettka committed Jan 30, 2025
1 parent 236fbc0 commit 00d6575
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions add/data/xql/getAudio.xql
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ let $albumCover := $doc//mei:graphic[@type = 'cover']/string(@target)
let $records :=
for $rec in $doc//mei:recording
let $recSource := $doc//mei:source[@xml:id = substring-after($rec/@decls, '#')]
let $recTitle := $recSource/mei:titleStmt/mei:title
let $avFile := $rec/mei:avFile[1]/string(@target)
let $recTitle := $recSource/mei:titleStmt/string-join(mei:title, ', ')
let $src := $rec/mei:avFile[1]/string(@target)
let $mimetype := $rec/mei:avFile[1]/string(@mimetype)
return
(:TODO map instead of concatenation :)

'{
"title": "' || replace($recTitle, '"', '\\"') || '",
"composer": "' || replace($artist, '"', '\\"') || '",
"work": "' || replace($album, '"', '\\"') || '",
"src": "' || $avFile || '",
"src": "' || $src || '",
"type": "' || $mimetype || '",
"cover_art_url": "' || $albumCover || '"' || '
}'

let $audioConfig := '[' ||
replace(string-join($records, ', '), '\n', '')
|| ']'
let $audioConfig := '[' || replace(string-join($records, ', '), '\n', '') || ']'

return
$audioConfig

0 comments on commit 00d6575

Please sign in to comment.