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

new track prepare logic (smaller lists, wildcards)

This commit is contained in:
2025-09-28 21:52:47 +02:00
parent fb11e7ec80
commit 978cdd4ed5

View File

@@ -8,7 +8,7 @@ import threading
import re, unidecode
from dataclasses import dataclass
from datetime import datetime
import log95
import log95, glob
def print_wait(ttw: float, frequency: float, duration: float=-1, prefix: str="", bias: float = 0):
interval = 1.0 / frequency
@@ -247,12 +247,14 @@ def play_playlist(playlist_path, custom_playlist: bool=False, do_shuffle=True):
playlist: list[tuple[str, bool, bool, bool]] = [] # name, fade in, fade out, official
last_jingiel = True
for track in tracks:
tr = [f for f in glob.glob(track) if os.path.isfile(f)]
for track2 in tr:
if not last_jingiel and random.choice([False, True, False, False]) and JINGIEL_FILE:
playlist.append((track, True, False, True))
playlist.append((track2, True, False, True))
playlist.append((JINGIEL_FILE, False, False, False))
last_jingiel = True
else:
playlist.append((track, True, True, True))
playlist.append((track2, True, True, True))
last_jingiel = False
del last_jingiel