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

some changes

This commit is contained in:
Kuba
2025-10-31 23:21:02 +01:00
parent ad05b2076c
commit cccf4a2965
2 changed files with 11 additions and 9 deletions

View File

@@ -1,8 +1,6 @@
from modules import InterModuleCommunication
from . import ActiveModifier, log95, Track
import os
import subprocess
import datetime
import os, subprocess, glob, datetime
from .advisor import MORNING_START, DAY_END
@@ -29,6 +27,9 @@ class Module(ActiveModifier):
if not self.playlist: return track
if not os.path.exists("/tmp/radioPlayer_toplay"): open("/tmp/radioPlayer_toplay", "a").close()
with open("/tmp/radioPlayer_toplay", "r") as f: songs = [s.strip() for s in f.readlines() if s.strip()]
songs[:] = [f for s in songs for f in glob.glob(s) if os.path.isfile(f)] # expand glob
if len(songs):
song = songs.pop(0)