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