From 42a3323a6b3222696835198e634d279cdbf0b82a Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Thu, 29 Jul 2021 23:29:42 +0200 Subject: [PATCH] Pause music handler and finished play_a_song handler, both work fine. --- jarvis/skills/entertainement/spotify/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/jarvis/skills/entertainement/spotify/__init__.py b/jarvis/skills/entertainement/spotify/__init__.py index 8454245..b230913 100644 --- a/jarvis/skills/entertainement/spotify/__init__.py +++ b/jarvis/skills/entertainement/spotify/__init__.py @@ -15,5 +15,15 @@ class SpotifySkill(Skill, metaclass=SkillRegistering): song_lists_matching = spotify.query_song(data['song'], data['singer']) if song_lists_matching is not None and len(song_lists_matching) >= 1: - print(song_lists_matching[0]['uri'] + " / " + song_lists_matching[0]['name'] + " / " + - song_lists_matching[0]['artists'][0]['name']) + print( + "[INFO INTENT] - Now playing : " + song_lists_matching[0]['uri'] + " / " + song_lists_matching[0][ + 'name'] + " / " + + song_lists_matching[0]['artists'][0]['name']) + spotify.get_spotify().add_to_queue(uri=song_lists_matching[0]['uri']) + spotify.get_spotify().next_track() + # spotify.get_spotify().start_playback(context_uri=song_lists_matching[0]['uri']) + + @intent_file_handler("pause_music.intent", "PauseSpotifyIntent") + def pause_music(self, data): + spotify.get_spotify().pause_playback() + print("[INFO INTENT] - Paused music for Spotify")