diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-07-22 14:47:03 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-07-22 14:47:03 +0200 |
| commit | 1f8be2478f97feab79d55cbd4b3d73624733d49a (patch) | |
| tree | 33d2c80be55851c5c1e3209f315ce99f6776f31d /web/client.html | |
| parent | 5d6358d8cc26db520488d2c7fbea5dbaa9e9fbd2 (diff) | |
| download | WRMS-1f8be2478f97feab79d55cbd4b3d73624733d49a.tar.gz WRMS-1f8be2478f97feab79d55cbd4b3d73624733d49a.zip | |
propagate the time bonus to the client and apply it when adding new songs
Diffstat (limited to 'web/client.html')
| -rw-r--r-- | web/client.html | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/web/client.html b/web/client.html index 15f3a33..51ddf3b 100644 --- a/web/client.html +++ b/web/client.html @@ -92,6 +92,7 @@ } } + let timeBonus = 0.0; let isAdmin = false; let searchId = 0; let songs = []; @@ -213,6 +214,11 @@ } function handleAdd(added) { + if (timeBonus != 0) { + for (song of songs) { + song.weight += timeBonus + } + } songs = songs.concat(added); renderPlaylist(); } @@ -279,6 +285,9 @@ console.log("Received Event: ", message); const cmd = JSON.parse(message.data); switch (cmd.cmd) { + case "timeBonus": + timeBonus = cmd.timeBonus; + break; case "add": handleAdd(cmd.songs) break; |
