소스 검색

Fix Playback speed indicator precision

The original idea was to have two digit precision at all time
in order to ensure the length of the string is always the same.
This prevents the UI button to move when pressed.
I completely missed the first press as the precision was not right
upon first click.
Ztec 1 년 전
부모
커밋
07f6d397d4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      internal/ui/static/js/bootstrap.js

+ 1 - 1
internal/ui/static/js/bootstrap.js

@@ -172,7 +172,7 @@ document.addEventListener("DOMContentLoaded", () => {
                 // Could not do it backend side because I didn't know how to do it because of the template inclusion and
                 // Could not do it backend side because I didn't know how to do it because of the template inclusion and
                 // the way the initial playback speed is handled. See enclosure_media_controls.html if you want to try to fix this
                 // the way the initial playback speed is handled. See enclosure_media_controls.html if you want to try to fix this
                 document.querySelectorAll(`span.speed-indicator[data-enclosure-id="${element.dataset.enclosureId}"]`).forEach((speedI)=>{
                 document.querySelectorAll(`span.speed-indicator[data-enclosure-id="${element.dataset.enclosureId}"]`).forEach((speedI)=>{
-                    speedI.innerText = `${element.dataset.playbackRate}x`;
+                    speedI.innerText = `${parseFloat(element.dataset.playbackRate).toFixed(2)}x`;
                 });
                 });
             }
             }
         }
         }