You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
fix
This commit is contained in:
@@ -6,9 +6,7 @@ Takes an file argument to initialize, which is the absolute path to the jingle f
|
|||||||
Reacts to the 'no_jingle' argument, for global usage it does not add jingles to the playlist, and for file usage it does not add the jingle after the file
|
Reacts to the 'no_jingle' argument, for global usage it does not add jingles to the playlist, and for file usage it does not add the jingle after the file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import random, log95
|
import random
|
||||||
|
|
||||||
logger = log95.log95("JINGLE-GEN")
|
|
||||||
|
|
||||||
class PlaylistModifierModule:
|
class PlaylistModifierModule:
|
||||||
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
||||||
@@ -16,7 +14,6 @@ class PlaylistModifierModule:
|
|||||||
|
|
||||||
class Module(PlaylistModifierModule):
|
class Module(PlaylistModifierModule):
|
||||||
def __init__(self, file: str) -> None:
|
def __init__(self, file: str) -> None:
|
||||||
logger.info("Generating jingles with the following random state:", repr(random.getstate()))
|
|
||||||
self.file = file
|
self.file = file
|
||||||
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
||||||
if int(global_args.get("no_jingle", 0)): return playlist
|
if int(global_args.get("no_jingle", 0)): return playlist
|
||||||
@@ -31,5 +28,6 @@ class Module(PlaylistModifierModule):
|
|||||||
out.append((track, True, True, True, args))
|
out.append((track, True, True, True, args))
|
||||||
last_jingiel = False
|
last_jingiel = False
|
||||||
del last_jingiel
|
del last_jingiel
|
||||||
|
return out
|
||||||
|
|
||||||
playlistmod = (Module("/home/user/Jingiel.mp3"), 1)
|
playlistmod = (Module("/home/user/Jingiel.mp3"), 1)
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
import random, log95
|
import random
|
||||||
|
|
||||||
logger = log95.log95("SHUFFLER")
|
|
||||||
|
|
||||||
class PlaylistModifierModule:
|
class PlaylistModifierModule:
|
||||||
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
||||||
return playlist
|
return playlist
|
||||||
|
|
||||||
class Module(PlaylistModifierModule):
|
class Module(PlaylistModifierModule):
|
||||||
def __init__(self) -> None:
|
|
||||||
logger.info("Shuffling with the following random state:", repr(random.getstate()))
|
|
||||||
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
|
||||||
if int(global_args.get("no_shuffle", 0)) == 0:
|
if int(global_args.get("no_shuffle", 0)) == 0:
|
||||||
random.shuffle(playlist)
|
random.shuffle(playlist)
|
||||||
|
|||||||
Reference in New Issue
Block a user