- Reordered classes
This commit is contained in:
38
skill/app.py
38
skill/app.py
@@ -39,6 +39,7 @@ logger.addHandler(handler)
|
|||||||
# Get service configuration
|
# Get service configuration
|
||||||
#
|
#
|
||||||
|
|
||||||
|
logger.info('AskNavidrome 0.6!')
|
||||||
logger.debug('Getting configutration from the environment...')
|
logger.debug('Getting configutration from the environment...')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -572,6 +573,24 @@ class NaviSonicPlayFavouriteSongs(AbstractRequestHandler):
|
|||||||
return controller.start_playback('play', speech, card, track_details, handler_input)
|
return controller.start_playback('play', speech, card, track_details, handler_input)
|
||||||
|
|
||||||
|
|
||||||
|
class NaviSonicRandomiseQueue(AbstractRequestHandler):
|
||||||
|
"""Handle NaviSonicRandomiseQueue Intent
|
||||||
|
|
||||||
|
Shuffle the current play queue
|
||||||
|
"""
|
||||||
|
|
||||||
|
def can_handle(self, handler_input: HandlerInput) -> bool:
|
||||||
|
return is_intent_name('NaviSonicRandomiseQueue')(handler_input)
|
||||||
|
|
||||||
|
def handle(self, handler_input: HandlerInput) -> Response:
|
||||||
|
logger.debug('In NaviSonicRandomiseQueue Handler')
|
||||||
|
|
||||||
|
play_queue.shuffle()
|
||||||
|
play_queue.sync()
|
||||||
|
|
||||||
|
return handler_input.response_builder.response
|
||||||
|
|
||||||
|
|
||||||
class NaviSonicSongDetails(AbstractRequestHandler):
|
class NaviSonicSongDetails(AbstractRequestHandler):
|
||||||
"""Handle NaviSonicSongDetails Intent
|
"""Handle NaviSonicSongDetails Intent
|
||||||
|
|
||||||
@@ -630,25 +649,6 @@ class NaviSonicUnstarSong(AbstractRequestHandler):
|
|||||||
|
|
||||||
return handler_input.response_builder.response
|
return handler_input.response_builder.response
|
||||||
|
|
||||||
|
|
||||||
class NaviSonicRandomiseQueue(AbstractRequestHandler):
|
|
||||||
"""Handle NaviSonicRandomiseQueue Intent
|
|
||||||
|
|
||||||
Shuffle the current play queue
|
|
||||||
"""
|
|
||||||
|
|
||||||
def can_handle(self, handler_input: HandlerInput) -> bool:
|
|
||||||
return is_intent_name('NaviSonicRandomiseQueue')(handler_input)
|
|
||||||
|
|
||||||
def handle(self, handler_input: HandlerInput) -> Response:
|
|
||||||
logger.debug('In NaviSonicRandomiseQueue Handler')
|
|
||||||
|
|
||||||
play_queue.shuffle()
|
|
||||||
play_queue.sync()
|
|
||||||
|
|
||||||
return handler_input.response_builder.response
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# AudioPlayer Handlers
|
# AudioPlayer Handlers
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user