Code optimization

This commit is contained in:
croneter 2017-08-21 18:59:47 +02:00
parent 5f45cc1c9b
commit 7b6834b326
2 changed files with 3 additions and 10 deletions

View file

@ -172,10 +172,7 @@ class Main():
Start up playback_starter in main Python thread
"""
# Put the request into the 'queue'
while window('plex_command'):
sleep(50)
window('plex_command',
value='play_%s' % argv[2])
plex_command('PLAY', argv[2])
# Wait for the result
while not pickl_window('plex_result'):
sleep(50)

View file

@ -21,9 +21,6 @@ class Monitor_Window(Thread):
Monitors window('plex_command') for new entries that we need to take care
of, e.g. for new plays initiated on the Kodi side with addon paths.
Possible values of window('plex_command'):
'play_....': to start playback using playback_starter
Adjusts state.py accordingly
"""
# Borg - multiple instances, shared state
@ -40,9 +37,8 @@ class Monitor_Window(Thread):
if window('plex_command'):
value = window('plex_command')
window('plex_command', clear=True)
if value.startswith('play_'):
queue.put(value)
if value.startswith('PLAY-'):
queue.put(value.replace('PLAY-', ''))
elif value == 'SUSPEND_LIBRARY_THREAD-True':
state.SUSPEND_LIBRARY_THREAD = True
elif value == 'SUSPEND_LIBRARY_THREAD-False':