You've already forked RadioPlayer
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:
13
modules/shuffler.py
Normal file
13
modules/shuffler.py
Normal 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)
|
||||
Reference in New Issue
Block a user