+1
.env.example
+1
.env.example
+2
-2
docker-compose.yml
+2
-2
docker-compose.yml
···
3
3
services:
4
4
icecast:
5
5
image: docker.io/mkody/icecast:latest
6
-
restart: always
6
+
restart: unless-stopped
7
7
ports:
8
8
- "${ICECAST_PORT:-8000}:8000"
9
9
environment:
···
19
19
20
20
liquidsoap:
21
21
image: docker.io/savonet/liquidsoap:v2.2.2
22
-
restart: always
22
+
restart: unless-stopped
23
23
command: ["/script.liq"]
24
24
environment:
25
25
- ICECAST_SOURCE_PASSWORD
+5
style-status.css
+5
style-status.css
+12
-14
status.xsl
+12
-14
status.xsl
···
78
78
let lastTitle = ''
79
79
// Store the current mount point
80
80
let currentMount = ''
81
-
// Store the last notification
82
-
let lastNotification = null
83
81
84
82
// On every audio element, create a new Plyr instance
85
83
document.querySelectorAll('div[data-mount]').forEach((e) => {
···
141
139
142
140
// If we have permission, send a notification
143
141
if ('Notification' in window && Notification.permission === 'granted') {
144
-
lastNotification = new Notification(
142
+
const lastNotification = new Notification(
145
143
'RRM - Now Playing',
146
144
{
147
145
body: j.icestats.source.title,
148
146
icon: 'https://rita.moe/rita-icon.png',
149
147
renotify: true,
150
-
requireInteraction: false,
148
+
requireInteraction: true,
149
+
silent: true,
151
150
tag: 'now-playing',
152
151
}
153
152
)
153
+
154
+
// Close the notification after 10 seconds, as renotify
155
+
// isn't working perfectly when the track changes
156
+
setTimeout(
157
+
(_) => {
158
+
lastNotification.close()
159
+
},
160
+
10000
161
+
)
154
162
}
155
163
}
156
164
} else {
···
171
179
if ('Notification' in window && Notification.permission === 'default') {
172
180
Notification.requestPermission()
173
181
}
174
-
175
-
document.addEventListener(
176
-
'visibilitychange',
177
-
() => {
178
-
// If the page is visible, close the last notification
179
-
if (document.visibilityState === 'visible') {
180
-
lastNotification?.close()
181
-
}
182
-
}
183
-
)
184
182
]]>
185
183
</script>
186
184
</body>