You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
When an area is in jukebox mode, playing a song is supposed to add it to the queue. This does not work, the server instead reports "You removed your song from the jukebox" even if the jukebox queue is empty. Newbie Hole has been unable to play music for who knows how long.
The text was updated successfully, but these errors were encountered:
defadd_jukebox_vote(self, client: ClientManager.Client, music_name: str, length: int=-1, showname: str=''):
"""Cast a vote on the jukebox. Args: client (ClientManager.Client): Client that is requesting music_name (str): track name length (int, optional): length of track. Defaults to -1. showname (str, optional): showname of voter. Defaults to ''. """ifnotself.jukebox:
returniflength<=0:
self.remove_jukebox_vote(client, False)
else:
self.remove_jukebox_vote(client, True)
self.jukebox_votes.append(
self.JukeboxVote(client, music_name, length, showname))
client.send_ooc('Your song was added to the jukebox.')
iflen(self.jukebox_votes) ==1:
self.start_jukebox()
Now, I'm not quite sure what the -1 is used for; however, there's some kind of trap happening here. The parameter length is generated through:
defget_song_data(self, music_list, music):
""" Get information about a track, if exists. :param music_list: music list to search :param music: track name :returns: tuple (name, length or -1) :raises: ServerError if track not found """foriteminmusic_list:
if'category'notinitem: #skip settings n stuffcontinueifitem['category'] ==music:
returnitem['category'], -1forsonginitem['songs']:
ifsong['name'] ==music:
try:
returnsong['name'], song['length']
exceptKeyError:
returnsong['name'], -1
It looks like the config defaults to -1.
If your music.yaml doesn't have the length attribute as something other than -1, it won't allow you to play it on the Jukebox.
I brought this up in the development channel in the Discord and I'll wait to do something until I get feedback there.
When an area is in jukebox mode, playing a song is supposed to add it to the queue. This does not work, the server instead reports "You removed your song from the jukebox" even if the jukebox queue is empty. Newbie Hole has been unable to play music for who knows how long.
The text was updated successfully, but these errors were encountered: