- Added NaviSonicRandomiseQueue

- Resolves #9
This commit is contained in:
Ross Stewart
2022-10-22 14:53:10 +01:00
parent f4d4b8580d
commit c8ac9a4884
3 changed files with 31 additions and 1 deletions

View File

@@ -176,6 +176,16 @@
"Play random music",
"Play random songs"
]
},
{
"name": "NaviSonicRandomiseQueue",
"slots": [],
"samples": [
"randomise the queue",
"randomise",
"shuffle",
"shuffle the queue"
]
}
],
"types": [

View File

@@ -631,6 +631,24 @@ class NaviSonicUnstarSong(AbstractRequestHandler):
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
#

View File

@@ -98,6 +98,8 @@ Supported Intents
+-------------------------------------------+--------------------------------------------+-------------------------------------+
| :class:`~app.NaviSonicPlayFavouriteSongs` | Play your starred / favourite songs | Play my favourite songs |
+-------------------------------------------+--------------------------------------------+-------------------------------------+
| :class:`~app.NaviSonicRandomiseQueue` | Shuffle / randomise the current play queue | Shuffle the queue |
+-------------------------------------------+--------------------------------------------+-------------------------------------+
| :class:`~app.NaviSonicSongDetails` | Give details on the playing track | What is playing |
+-------------------------------------------+--------------------------------------------+-------------------------------------+
| :class:`~app.NaviSonicStarSong` | Star / favourite a song | Star this song |
@@ -413,7 +415,7 @@ Code Documentation
******************
.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Contents:
AskNavidrome main