Adicionando skills para tocar mais musicas do artista/album que esta sendo tocado no momento
Some checks failed
Documentation Generator / Build Sphinx documentation (push) Has been cancelled
Some checks failed
Documentation Generator / Build Sphinx documentation (push) Has been cancelled
This commit is contained in:
22
skill/app.py
22
skill/app.py
@@ -364,7 +364,11 @@ class NaviSonicPlayMusicByCurrentArtist(AbstractRequestHandler):
|
||||
return is_intent_name('NaviSonicPlayMusicByCurrentArtist')(handler_input)
|
||||
|
||||
def handle(self, handler_input: HandlerInput) -> Response:
|
||||
logger.debug('In NaviSonicPlayMusicByCurrentArtist Handler')
|
||||
global backgroundProcess
|
||||
logger.debug('In NaviSonicPlayMusicByCurrentArtist Handler (custom)')
|
||||
if backgroundProcess is not None:
|
||||
backgroundProcess.terminate()
|
||||
backgroundProcess.join()
|
||||
|
||||
t = get_current_song_details() #current "T"rack
|
||||
|
||||
@@ -373,11 +377,6 @@ class NaviSonicPlayMusicByCurrentArtist(AbstractRequestHandler):
|
||||
song_id_list = connection.build_song_list_from_albums(artist_album_lookup, min_song_count)
|
||||
play_queue.clea
|
||||
|
||||
global backgroundProcess
|
||||
if backgroundProcess is not None:
|
||||
backgroundProcess.terminate()
|
||||
backgroundProcess.join()
|
||||
|
||||
controller.enqueue_songs(connection, play_queue, [song_id_list[0], song_id_list[1]]) # When generating the playlist return the first two tracks.
|
||||
backgroundProcess = Process(target=queue_worker_thread, args=(connection, play_queue, song_id_list[2:])) # Create a thread to enqueue the remaining tracks
|
||||
backgroundProcess.start() # Start the additional thread
|
||||
@@ -396,7 +395,11 @@ class NaviSonicPlayMusicByCurrentAlbum(AbstractRequestHandler):
|
||||
return is_intent_name('NaviSonicPlayMusicByCurrentAlbum')(handler_input)
|
||||
|
||||
def handle(self, handler_input: HandlerInput) -> Response:
|
||||
logger.debug('In NaviSonicPlayMusicByCurrentAlbum Handler')
|
||||
global backgroundProcess
|
||||
logger.debug('In NaviSonicPlayMusicByCurrentAlbum Handler (custom)')
|
||||
if backgroundProcess is not None:
|
||||
backgroundProcess.terminate()
|
||||
backgroundProcess.join()
|
||||
|
||||
t = get_current_song_details() #current "T"rack
|
||||
|
||||
@@ -407,11 +410,6 @@ class NaviSonicPlayMusicByCurrentAlbum(AbstractRequestHandler):
|
||||
song_id_list = connection.build_song_list_from_albums(result, -1)
|
||||
play_queue.clear()
|
||||
|
||||
global backgroundProcess
|
||||
if backgroundProcess is not None:
|
||||
backgroundProcess.terminate()
|
||||
backgroundProcess.join()
|
||||
|
||||
controller.enqueue_songs(connection, play_queue, [song_id_list[0], song_id_list[1]]) # When generating the playlist return the first two tracks.
|
||||
backgroundProcess = Process(target=queue_worker_thread, args=(connection, play_queue, song_id_list[2:])) # Create a thread to enqueue the remaining tracks
|
||||
backgroundProcess.start() # Start the additional thread
|
||||
|
||||
Reference in New Issue
Block a user