Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reaby committed Dec 17, 2020
1 parent 39d15f4 commit 272079d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run start:dev
2 changes: 1 addition & 1 deletion src/public/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap");

html,
body {
Expand Down
11 changes: 6 additions & 5 deletions src/seratoParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SeratoParser {
const start = byt.indexOf("\u0000\u0000\u0006");
let end = -1;
if (start > 0) {
end = byt.indexOf("\u0000\u0007");
end = byt.indexOf("\u0000\u0000\u0000\u0007");
if (end == -1) {
end = byt.indexOf("\u0000\u0000\u0000\u0008");
}
Expand Down Expand Up @@ -84,14 +84,15 @@ class SeratoParser {
byte: statusByte,
};
songs.push(songData);

//console.log(songData);

const id: string = song + artist;
// console.log(id + ": " + statusByte);
//console.log(id + ": " + status);
if (status == true) {
if (!cache.hasOwnProperty(id)) {
cache[id] = [songData];
} else {
cache[id].push(songData);
// cache[id].push(songData); // commenthing this fixes odd bug, when 2 songs are loaded, but history shows only one song out
}
} else {
try {
Expand All @@ -111,7 +112,7 @@ class SeratoParser {
for (const song in cache) {
out.push(cache[song][0]);
}

// console.log(out);
if (out.length > 0) {
return { song: out[0].song, artist: out[0].artist };
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/views/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.helper {
text-align: left;
font-family: "Roboto", sans-serif;
font-weight: 900;
font-weight: 400;
color: var(--text-color);
text-shadow: 0 0 4px var(--neon-text-color),
0 0 32px var(--neon-text-color), 0 0 96px var(--neon-text-color);
Expand Down Expand Up @@ -46,7 +46,6 @@
var aOut = "{{config.animation.out}}";
$(() => {
console.log("rok");
fetchUpdates();
setInterval(fetchUpdates, 5000);
});
Expand Down

0 comments on commit 272079d

Please sign in to comment.