Fixed "name 'generateQueueItem' is not defined"

This fixes #23
This commit is contained in:
RemixDev 2020-08-16 18:10:32 +02:00
parent 808af1c01f
commit 032845f394
1 changed files with 5 additions and 5 deletions

View File

@ -84,7 +84,7 @@ class QueueManager:
albumAPI['nb_disk'] = albumAPI_gw['NUMBER_DISK'] albumAPI['nb_disk'] = albumAPI_gw['NUMBER_DISK']
albumAPI['copyright'] = albumAPI_gw['COPYRIGHT'] albumAPI['copyright'] = albumAPI_gw['COPYRIGHT']
if albumAPI['nb_tracks'] == 1: if albumAPI['nb_tracks'] == 1:
return generateQueueItem(dz, sp, f"https://www.deezer.com/track/{albumAPI['tracks']['data'][0]['id']}", return self.generateQueueItem(dz, sp, f"https://www.deezer.com/track/{albumAPI['tracks']['data'][0]['id']}",
settings, bitrate, albumAPI) settings, bitrate, albumAPI)
tracksArray = dz.get_album_tracks_gw(id) tracksArray = dz.get_album_tracks_gw(id)
if albumAPI['nb_tracks'] == 255: if albumAPI['nb_tracks'] == 255:
@ -174,7 +174,7 @@ class QueueManager:
artistAPITracks = dz.get_artist_albums(id) artistAPITracks = dz.get_artist_albums(id)
albumList = [] albumList = []
for album in artistAPITracks['data']: for album in artistAPITracks['data']:
albumList.append(generateQueueItem(dz, sp, album['link'], settings, bitrate)) albumList.append(self.generateQueueItem(dz, sp, album['link'], settings, bitrate))
if interface: if interface:
interface.send("finishAddingArtist", {'name': artistAPI['name'], 'id': artistAPI['id']}) interface.send("finishAddingArtist", {'name': artistAPI['name'], 'id': artistAPI['id']})
@ -196,7 +196,7 @@ class QueueManager:
for type in artistDiscographyAPI: for type in artistDiscographyAPI:
if type != 'all': if type != 'all':
for album in artistDiscographyAPI[type]: for album in artistDiscographyAPI[type]:
albumList.append(generateQueueItem(dz, sp, album['link'], settings, bitrate)) albumList.append(self.generateQueueItem(dz, sp, album['link'], settings, bitrate))
if interface: if interface:
interface.send("finishAddingArtist", {'name': artistAPI['name'], 'id': artistAPI['id']}) interface.send("finishAddingArtist", {'name': artistAPI['name'], 'id': artistAPI['id']})
@ -278,7 +278,7 @@ class QueueManager:
return QueueError(url, "Wrong URL: "+e.msg[e.msg.find('\n')+2:]) return QueueError(url, "Wrong URL: "+e.msg[e.msg.find('\n')+2:])
if track_id != 0: if track_id != 0:
return generateQueueItem(dz, sp, f'https://www.deezer.com/track/{track_id}', settings, bitrate) return self.generateQueueItem(dz, sp, f'https://www.deezer.com/track/{track_id}', settings, bitrate)
else: else:
logger.warn("Track not found on deezer!") logger.warn("Track not found on deezer!")
return QueueError(url, "Track not found on deezer!", "trackNotOnDeezer") return QueueError(url, "Track not found on deezer!", "trackNotOnDeezer")
@ -294,7 +294,7 @@ class QueueManager:
return QueueError(url, "Wrong URL: "+e.msg[e.msg.find('\n')+2:]) return QueueError(url, "Wrong URL: "+e.msg[e.msg.find('\n')+2:])
if album_id != 0: if album_id != 0:
return generateQueueItem(dz, sp, f'https://www.deezer.com/album/{album_id}', settings, bitrate) return self.generateQueueItem(dz, sp, f'https://www.deezer.com/album/{album_id}', settings, bitrate)
else: else:
logger.warn("Album not found on deezer!") logger.warn("Album not found on deezer!")
return QueueError(url, "Album not found on deezer!", "albumNotOnDeezer") return QueueError(url, "Album not found on deezer!", "albumNotOnDeezer")