Marking nowPlaying in smapi setPlayedSeconds handler so does not mark when sonos pre-caches a track (#57)

This commit is contained in:
Simon J
2021-09-27 19:13:47 +10:00
committed by GitHub
parent 36d0023a1e
commit c312778e13
4 changed files with 72 additions and 53 deletions

View File

@@ -888,6 +888,9 @@ function bindSmapiSoapServiceToExpress(
switch (type) {
case "track":
musicLibrary.track(typeId).then(({ duration }) => {
if(+seconds > 0) {
musicLibrary.nowPlaying(typeId);
}
if (
(duration < 30 && +seconds >= 10) ||
(duration >= 30 && +seconds >= 30)