0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-27 06:03:52 +01:00

move skip to playview and dump progrss to file

This commit is contained in:
KubaPro010
2025-11-08 15:09:33 +01:00
parent 6628e6b78b
commit 84e152cbb9
2 changed files with 9 additions and 7 deletions

16
modules/progress.py Normal file
View File

@@ -0,0 +1,16 @@
from . import PlayerModule, Track, Path
def format_time(seconds) -> str:
hours = int(seconds // 3600)
minutes = int((seconds % 3600) // 60)
secs = int(seconds % 60)
return f"{hours:02d}:{minutes:02d}:{secs:02d}"
class Module(PlayerModule):
def progress(self, index: int, track: Track, elapsed: float, total: float, real_total: float) -> None:
if track.official:
data = f"{track.path.name}: {format_time(elapsed)} / {format_time(total)}"
# print(data, end="\r", flush=True)
Path("/tmp/radioPlayer_progress").write_text(data)
module = Module()