Another try

This commit is contained in:
Ral 2021-12-26 03:32:01 +01:00
parent 6fb5072c20
commit 7903a8e666
3 changed files with 16 additions and 10 deletions

View File

@ -13,6 +13,6 @@
<script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script>
<script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script>
<script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
<script src=https://infobeamer.montage2.de/main.a72bc232cf7205707699cb3faf6243790fe29e806411c9c37138b32f6f5da481.js integrity="sha256-pyvCMs9yBXB2mcs/r2JDeQ/inoBkEcnDcTizL29dpIE=" type=module></script>
<script src=https://infobeamer.montage2.de/main.b67a4b646a3847aa36131a70016e64dd9f5aec7555b1e993ca99e620f6c78bd4.js integrity="sha256-tnpLZGo4R6o2ExpwAW5k3Z9a7HVVsemTypnmIPbHi9Q=" type=module></script>
</body>
</html>

View File

@ -90,16 +90,22 @@
return scheduleFiltered;
};
var is_new_music = (musicA, musicB) => {
let isNew;
musicA.forEach((ma) => {
musicB.forEach((mb) => {
isNew = ma.artist !== mb.artist || ma.title !== mb.title;
});
});
return isNew;
console.log("Eval new music?");
console.log(musicA);
console.log(musicB);
let isSame;
if (musicA.length !== 0 && musicB.length !== 0) {
isSame = musicA[0].artist === musicB[0].artist && musicA[0].title === musicB[0].title;
} else if (musicA.length === 0 && musicB.length === 0) {
isSame = true;
} else {
isSame = false;
}
return !isSame;
};
var music_filter = (musicA, musicB) => {
let isNew = is_new_music(musicA, musicB);
console.log("New? " + isNew);
musicB.forEach((m) => m.updated = true);
return musicB;
};
@ -423,7 +429,7 @@
function update_screen() {
let realTime = new Date();
console.log("Updating screen at at: " + realTime);
let now = Date.parse("2021-12-27T12:26:00+01:00");
let now = Date.now();
console.log("Using 'now': " + now);
update_main_slide({
schedule: future_events(scheduleData, now),

View File

@ -13,6 +13,6 @@
<script src=https://infobeamer.montage2.de/js/moment/moment.min.73de4254959530e4d1d9bec586379184f96b4953dacf9cd5e5e2bdd7bfeceef7.js integrity="sha256-c95CVJWVMOTR2b7FhjeRhPlrSVPaz5zV5eK917/s7vc="></script>
<script src=https://infobeamer.montage2.de/js/preact/preact.min.0c204e20934f1e09cfe86fbcf1d069d842f988fc71efe3a923021c08892c71c8.js integrity="sha256-DCBOIJNPHgnP6G+88dBp2EL5iPxx7+OpIwIcCIksccg="></script>
<script src=https://infobeamer.montage2.de/js/htm/htm.80e39afe20fd61183412eda89efa10532d57945e6364642aceacd50eb2384b4b.js integrity="sha256-gOOa/iD9YRg0Eu2onvoQUy1XlF5jZGQqzqzVDrI4S0s="></script>
<script src=https://infobeamer.montage2.de/main.a72bc232cf7205707699cb3faf6243790fe29e806411c9c37138b32f6f5da481.js integrity="sha256-pyvCMs9yBXB2mcs/r2JDeQ/inoBkEcnDcTizL29dpIE=" type=module></script>
<script src=https://infobeamer.montage2.de/main.b67a4b646a3847aa36131a70016e64dd9f5aec7555b1e993ca99e620f6c78bd4.js integrity="sha256-tnpLZGo4R6o2ExpwAW5k3Z9a7HVVsemTypnmIPbHi9Q=" type=module></script>
</body>
</html>