Compare commits
9 Commits
08e5d8ce96
...
7cec7ef639
Author | SHA1 | Date |
---|---|---|
|
7cec7ef639 | |
|
99f39a0fdd | |
|
2dc8827c78 | |
|
7dc1e73ddf | |
|
cf7f4f642c | |
|
27b005f477 | |
|
cc9e08bf79 | |
|
ce82b5e0a8 | |
|
362c6ed38e |
|
@ -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
|
# TODO - we remove cover art for now as it disturbs REKT, this needs fixing
|
||||||
# m = metadata.cover.remove(m)
|
# 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
|
# merge old metadata except for the ones we expect to change
|
||||||
oldm = s.last_metadata() ?? []
|
oldm = s.last_metadata() ?? []
|
||||||
oldm = if list.assoc.mem("artist", oldm) then list.assoc.remove("artist", oldm) else oldm end
|
oldm = if list.assoc.mem("artist", oldm) then list.assoc.remove("artist", oldm) else oldm end
|
||||||
|
@ -91,10 +93,11 @@ def setup_harbor_metadata_api(~metadata_api_port=21338, s) =
|
||||||
oldm = if list.assoc.mem("apic", oldm) then list.assoc.remove("apic", oldm) else oldm end
|
oldm = if list.assoc.mem("apic", oldm) then list.assoc.remove("apic", oldm) else oldm end
|
||||||
oldm = if list.assoc.mem("metadata_block_picture", oldm) then list.assoc.remove("metadata_block_picture", oldm) else oldm end
|
oldm = if list.assoc.mem("metadata_block_picture", oldm) then list.assoc.remove("metadata_block_picture", oldm) else oldm end
|
||||||
oldm = if list.assoc.mem("coverart", oldm) then list.assoc.remove("coverart", oldm) else oldm end
|
oldm = if list.assoc.mem("coverart", oldm) then list.assoc.remove("coverart", oldm) else oldm end
|
||||||
|
oldm = if list.assoc.mem("cover_url", oldm) then list.assoc.remove("cover_url", oldm) else oldm end
|
||||||
m = list.append(oldm ?? [], m)
|
m = list.append(oldm ?? [], m)
|
||||||
|
|
||||||
# set metadata on stream
|
# set metadata on stream
|
||||||
s.insert_metadata(m)
|
s.insert_metadata(new_track=new_track, m)
|
||||||
|
|
||||||
http.response(protocol=protocol, code=200, headers=[
|
http.response(protocol=protocol, code=200, headers=[
|
||||||
("allow","POST"),
|
("allow","POST"),
|
||||||
|
|
|
@ -22,15 +22,20 @@ set("sandbox", "disabled")
|
||||||
s = input.http(id="input_ice_main", max_buffer=4., "http://127.0.0.1:61120/main")
|
s = input.http(id="input_ice_main", max_buffer=4., "http://127.0.0.1:61120/main")
|
||||||
|
|
||||||
# Split audio off to be handled specially
|
# Split audio off to be handled specially
|
||||||
a = drop_video(id="main", s)
|
a = drop_video(s)
|
||||||
a = setup_harbor_metadata_api(a)
|
|
||||||
a = mksafe_soft(a)
|
a = mksafe_soft(a)
|
||||||
output.dummy(a)
|
output.dummy(a)
|
||||||
|
|
||||||
def append_encoder_meta(m) =
|
def append_encoder_meta(m) =
|
||||||
[("encoder", "Liquidsoap #{liquidsoap.version}")]
|
[
|
||||||
|
("encoder", "Liquidsoap #{liquidsoap.version}"),
|
||||||
|
("stream_name", stream_name),
|
||||||
|
("stream_description", stream_description),
|
||||||
|
]
|
||||||
end
|
end
|
||||||
a = map_metadata(append_encoder_meta, a)
|
a = map_metadata(id="main", append_encoder_meta, a)
|
||||||
|
|
||||||
|
a = setup_harbor_metadata_api(a)
|
||||||
|
|
||||||
internal_icecast=output.icecast(
|
internal_icecast=output.icecast(
|
||||||
fallible=true,
|
fallible=true,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.17-alpine
|
FROM golang:1.18-alpine
|
||||||
|
|
||||||
WORKDIR /usr/src/icedreammusic/
|
WORKDIR /usr/src/icedreammusic/
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
|
@ -9,5 +9,5 @@ require (
|
||||||
github.com/spf13/viper v1.10.1
|
github.com/spf13/viper v1.10.1
|
||||||
gorm.io/driver/mysql v1.3.2
|
gorm.io/driver/mysql v1.3.2
|
||||||
gorm.io/driver/sqlite v1.3.1
|
gorm.io/driver/sqlite v1.3.1
|
||||||
gorm.io/gorm v1.23.2
|
gorm.io/gorm v1.23.3
|
||||||
)
|
)
|
||||||
|
|
|
@ -989,6 +989,8 @@ gorm.io/gorm v1.23.1 h1:aj5IlhDzEPsoIyOPtTRVI+SyaN1u6k613sbt4pwbxG0=
|
||||||
gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
||||||
gorm.io/gorm v1.23.2 h1:xmq9QRMWL8HTJyhAUBXy8FqIIQCYESeKfJL4DoGKiWQ=
|
gorm.io/gorm v1.23.2 h1:xmq9QRMWL8HTJyhAUBXy8FqIIQCYESeKfJL4DoGKiWQ=
|
||||||
gorm.io/gorm v1.23.2/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
gorm.io/gorm v1.23.2/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
||||||
|
gorm.io/gorm v1.23.3 h1:jYh3nm7uLZkrMVfA8WVNjDZryKfr7W+HTlInVgKFJAg=
|
||||||
|
gorm.io/gorm v1.23.3/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
|
|
|
@ -47,7 +47,7 @@ while true; do
|
||||||
found_source[0]=$(sed -e 's/\\\([`~!@#$%^&*():;<>.,?/\|{}=+-]\)/\1/g' <<<"${found_source[0]}")
|
found_source[0]=$(sed -e 's/\\\([`~!@#$%^&*():;<>.,?/\|{}=+-]\)/\1/g' <<<"${found_source[0]}")
|
||||||
found_source[1]=$(sed -e 's/\\\([`~!@#$%^&*():;<>.,?/\|{}=+-]\)/\1/g' <<<"${found_source[1]}")
|
found_source[1]=$(sed -e 's/\\\([`~!@#$%^&*():;<>.,?/\|{}=+-]\)/\1/g' <<<"${found_source[1]}")
|
||||||
case "${found_source[0]}" in
|
case "${found_source[0]}" in
|
||||||
*\(IDHPC\ Main\ Audio\))
|
*\(ID*\ Main\ Audio\))
|
||||||
found_audio_source="${found_source[0]}"
|
found_audio_source="${found_source[0]}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
|
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
|
||||||
integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg=="
|
integrity="sha512-10/jx2EXwxxWqCLX/hHth/vu2KY3jCF70dCQB8TSgNjbCVAC/8vai53GfMDrO2Emgwccf2pJqxct9ehpzG+MTw=="
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
|
@ -365,6 +365,23 @@
|
||||||
label: originalData.publisher,
|
label: originalData.publisher,
|
||||||
};
|
};
|
||||||
console.info(data);
|
console.info(data);
|
||||||
|
|
||||||
|
// set stream name and episode number in overlay
|
||||||
|
const streamName = data.stream_name;
|
||||||
|
const rxEpisode = /(?:\s*episode\s+|\s+|\#)(\d+)(?:\s+\(.+\))/i;
|
||||||
|
const episodeNumberMatch = streamName.match(rxEpisode);
|
||||||
|
let title = streamName;
|
||||||
|
let subtitle = "";
|
||||||
|
if (episodeNumberMatch && episodeNumberMatch.length > 1) {
|
||||||
|
//episodeNumber = episodeNumberMatch[1].toString();
|
||||||
|
subtitle = episodeNumberMatch[0].trim();
|
||||||
|
title = streamName.replace(rxEpisode, '');
|
||||||
|
title = title.replace(' – ', "\n");
|
||||||
|
title = title.replace(' - ', "\n");
|
||||||
|
}
|
||||||
|
document.querySelector('.logo').innerText = title;
|
||||||
|
document.querySelector('.episode').innerText = subtitle;
|
||||||
|
|
||||||
const almostEnding =
|
const almostEnding =
|
||||||
data.progress > 0 && data.duration > 0
|
data.progress > 0 && data.duration > 0
|
||||||
? data.progress > data.duration - 15000
|
? data.progress > data.duration - 15000
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.17-alpine
|
FROM golang:1.18-alpine
|
||||||
|
|
||||||
WORKDIR /usr/src/icedreammusic/
|
WORKDIR /usr/src/icedreammusic/
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
Loading…
Reference in New Issue