]> git.example.dev Git - binbsis50.git/commitdiff
updated: makefile, better sync write function
author2weiEmu <saalbach.robert@outlook.de>
Thu, 12 Mar 2026 11:32:26 +0000 (12:32 +0100)
committer2weiEmu <saalbach.robert@outlook.de>
Thu, 12 Mar 2026 11:32:26 +0000 (12:32 +0100)
Makefile [new file with mode: 0644]
lib/rooms.js
public/css/style.css
util/set-custom-sis50.js

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..2f51fd9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+
+default:
+       npm run minify
+       sudo docker run -d --name redis -p 6379:6379 redis:latest
+
+       node util/set-custom-sis50.js
+
+       node app.js
+
+       sudo docker stop redis || true
+       sudo docker rm redis || true
+       
index ad4b29ebfaa2e22e64319dcbbd22549f8e5e72dd..d8e43e2816df9e47f407f1a29aef20d36369a414 100644 (file)
@@ -570,7 +570,7 @@ Room.prototype.sendLoadTrack = function() {
         }
         room.artworkUrl = replies[3];
         room.trackViewUrl = replies[4];
-        room.displayArtistNames = replies[5].replace("~", ", ");
+        room.displayArtistNames = replies[5].replace("~", ", ").replace("");
         room.displayTrackName = replies[6];
         primus.room(room.roomname).send('loadtrack', room.previewUrl);
 
index 4c61b45c0ac73c47c89c704af98a12b836598cb7..6129fbffcb3f021cd7c214c5ced2e0755cafee13 100644 (file)
@@ -232,7 +232,7 @@ form .clearfix {
 }
 .loading-block {
   background-color: #6184B7;
-  border: 1px solid #466085;
+  border: 1px solid #7B352E;
   float: left;
   height: 12px;
   margin-left: 1px;
index c9f38431dc174a17843dda5029d82fc4cabea38c..a8a5dff80d52a0d146b45e7284f0565f32a00f9b 100644 (file)
@@ -6,14 +6,14 @@ const fs = require("node:fs")
 const songsclient = new Redis(6379, "localhost");
 
 // Read from the pre-process file that I made
-fs.readFile("util/song-map.csv", "utf8", (err, data) => {
-  if (err) {
-    console.error(err);
-    return;
-  }
+let data = fs.readFileSync("util/song-map.csv", "utf8")
+console.log(data)
+
 
+let setfunc = async (data) => {
   // here we process the data
   let values = data.split("\n");
+  console.log(values.length)
 
   for (let i = 0; i < values.length; i++) {
     let line = values[i].split(",");
@@ -23,9 +23,9 @@ fs.readFile("util/song-map.csv", "utf8", (err, data) => {
     let displayTrack = line[3]
     let previewName = line[4]
     let viewUrl = ""
-    console.log("adding song: " + i)
+    //console.log("adding song: " + i)
 
-    songsclient.hmset(
+    await songsclient.hmset(
       'song:' + i,
       'artistName',
       artistValues,
@@ -46,5 +46,9 @@ fs.readFile("util/song-map.csv", "utf8", (err, data) => {
     );
     songsclient.zadd("hits", i, i);
   }
-});
 
+  console.log("end of function")
+  songsclient.disconnect()
+}
+
+setfunc(data)