From 6c4031158eb7b8b23befe319ac6d1a23e9a4ce2d Mon Sep 17 00:00:00 2001 From: EGrishin Date: Fri, 25 Aug 2017 10:22:12 +0300 Subject: [PATCH] Add SetRepeatMode feature (#101) --- resources/lib/downloadutils.py | 2 +- resources/lib/websocket_client.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 114e74b5..e609a336 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -108,7 +108,7 @@ class DownloadUtils(object): "GoToSettings,PageDown,PreviousLetter,TakeScreenshot," "VolumeUp,VolumeDown,ToggleMute,SendString,DisplayMessage," "SetAudioStreamIndex,SetSubtitleStreamIndex," - + "SetRepeatMode," "Mute,Unmute,SetVolume," "Play,Playstate,PlayNext" ) diff --git a/resources/lib/websocket_client.py b/resources/lib/websocket_client.py index f41888a2..8805794e 100644 --- a/resources/lib/websocket_client.py +++ b/resources/lib/websocket_client.py @@ -188,7 +188,7 @@ class WebSocketClient(threading.Thread): arguments = data['Arguments'] if command in ('Mute', 'Unmute', 'SetVolume', - 'SetSubtitleStreamIndex', 'SetAudioStreamIndex'): + 'SetSubtitleStreamIndex', 'SetAudioStreamIndex', 'SetRepeatMode'): player = xbmc.Player() # These commands need to be reported back @@ -206,6 +206,10 @@ class WebSocketClient(threading.Thread): index = int(arguments['Index']) player.setAudioStream(index - 1) + elif command == 'SetRepeatMode': + mode = arguments['RepeatMode'] + xbmc.executebuiltin('xbmc.PlayerControl(%s)' % mode) + elif command == 'SetSubtitleStreamIndex': emby_index = int(arguments['Index']) current_file = player.getPlayingFile()