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

modularize playlist change

This commit is contained in:
Kuba
2025-10-11 17:29:56 +02:00
parent e7219c5770
commit cf4f3137bd
5 changed files with 46 additions and 29 deletions

13
modules/shuffler.py Normal file
View File

@@ -0,0 +1,13 @@
import random
class PlaylistModifierModule:
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
return playlist
class Module(PlaylistModifierModule):
def modify(self, global_args: dict, playlist: list[tuple[str, bool, bool, bool, dict]]):
if int(global_args.get("no_shuffle", 0)) == 0:
random.shuffle(playlist)
return playlist
playlistmod = (Module(), 0)