mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
Starting using multiprocessing module in Vulkan, now creating a new bot for each guild when played, multiple issues yet
This commit is contained in:
@@ -8,7 +8,7 @@ import random
|
||||
class Playlist:
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.__config = Configs()
|
||||
self.__configs = Configs()
|
||||
self.__queue = deque() # Store the musics to play
|
||||
self.__songs_history = deque() # Store the musics played
|
||||
|
||||
@@ -17,6 +17,9 @@ class Playlist:
|
||||
|
||||
self.__current: Song = None
|
||||
|
||||
def getSongs(self) -> deque[Song]:
|
||||
return self.__queue
|
||||
|
||||
def validate_position(self, position: int) -> bool:
|
||||
if position not in range(1, len(self.__queue) + 1):
|
||||
return False
|
||||
@@ -47,7 +50,7 @@ class Playlist:
|
||||
|
||||
@property
|
||||
def songs_to_preload(self) -> List[Song]:
|
||||
return list(self.__queue)[:self.__config.MAX_PRELOAD_SONGS]
|
||||
return list(self.__queue)[:self.__configs.MAX_PRELOAD_SONGS]
|
||||
|
||||
def __len__(self) -> int:
|
||||
return len(self.__queue)
|
||||
@@ -64,7 +67,7 @@ class Playlist:
|
||||
if played_song.problematic == False:
|
||||
self.__songs_history.appendleft(played_song)
|
||||
|
||||
if len(self.__songs_history) > self.__config.MAX_SONGS_HISTORY:
|
||||
if len(self.__songs_history) > self.__configs.MAX_SONGS_HISTORY:
|
||||
self.__songs_history.pop() # Remove the older
|
||||
|
||||
elif self.__looping_one: # Insert the current song to play again
|
||||
|
||||
Reference in New Issue
Block a user