Starting using multiprocessing module in Vulkan, now creating a new bot for each guild when played, multiple issues yet

This commit is contained in:
Rafael Vargas
2022-07-22 16:03:51 -03:00
parent 7a51c22709
commit fc7de9cb4f
13 changed files with 367 additions and 20 deletions

View File

@@ -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