1
0
Fork 0

Allow incoming metadata to specify whether to mark new_track.

liquidsoap-2.2
Icedream 2022-03-31 14:41:14 +02:00
parent 7dc1e73ddf
commit 2dc8827c78
Signed by: icedream
GPG Key ID: 468BBEEBB9EC6AEA
1 changed files with 3 additions and 1 deletions

View File

@ -74,6 +74,8 @@ def setup_harbor_metadata_api(~metadata_api_port=21338, s) =
# TODO - we remove cover art for now as it disturbs REKT, this needs fixing
# m = metadata.cover.remove(m)
new_track = if list.assoc.mem("new_track", m) then bool_of_string(string_of(list.assoc("new_track"))) else true end
# merge old metadata except for the ones we expect to change
oldm = s.last_metadata() ?? []
oldm = if list.assoc.mem("artist", oldm) then list.assoc.remove("artist", oldm) else oldm end
@ -94,7 +96,7 @@ def setup_harbor_metadata_api(~metadata_api_port=21338, s) =
m = list.append(oldm ?? [], m)
# set metadata on stream
s.insert_metadata(m)
s.insert_metadata(new_track=new_track, m)
http.response(protocol=protocol, code=200, headers=[
("allow","POST"),