I've encountered a strange problem.
I have saved a "current running" clip on my server, then send the id of the next or previous clip to determine if i need to skip forward or backward.
if ((request.command.substring(15) > device.currentClip)) {
console.log("XXXXX command: " + request.command.substring(15));
console.log("XXXXX current clip " + device.currentClip);
console.log("[INFO] skipping forward (playlist)");
return;
} else if ((request.command.substring(15) < device.currentClip)) {
console.log("XXXXX command: " + request.command.substring(15));
console.log("XXXXX current clip " + device.currentClip);
console.log("[INFO] skipping backward (playlist)");
return;
}
Strangely, numbers over 10 are evaluated incorrectly, even though the console shows that they are received as they are meant to.
Why is that? Could it have something to do with wrong types? i expect them to be auto-typed or at least throw an error. but they just seem to be "wrong".
Console (always clicking skip-forward button):
XXXXX command: 7
XXXXX current clip 6
[INFO] skipping forward (playlist)
XXXXX command: 10
XXXXX current clip 9
[INFO] skipping backward (playlist)
XXXXX command: 7
XXXXX current clip 6
[INFO] skipping forward (playlist)
XXXXX command: 10
XXXXX current clip 9
[INFO] skipping backward (playlist)
Can someone explain the (possible) error?
Aucun commentaire:
Enregistrer un commentaire