Skip to content

Commit ecedb87

Browse files
author
jdaalder
committed
Changes requested from review xbmc/repo-plugins#4596 (review)
1 parent 93b750c commit ecedb87

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

resources/lib/playback.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,4 @@ class Playback:
3030
channelnumberlabel:str = None
3131
channelgroup:str = None
3232

33-
def toJson(self):
34-
return json.dumps(self, default=lambda o: o.__dict__)
3533

resources/lib/store.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ def save_switchback_list():
8585
:return:
8686
"""
8787
with open(Store.switchback_list_file, 'w', encoding='utf-8') as f:
88-
temp_json = []
89-
for playback in Store.switchback_list:
90-
temp_json.append(playback.toJson())
91-
temp_json = ',\n'.join(temp_json)
92-
f.write(f"[\n{temp_json}\n]\n")
88+
json_string = json.dumps([vars(playback) for playback in Store.switchback_list], indent=4)
89+
f.write(json_string)
90+
9391

9492

9593

resources/lib/switchback_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def run():
2525
# (Playback record is created onAVStarted in player.py, so check here that it is available)
2626
elif Store.current_playback and Store.kodi_player.isPlaying():
2727
Store.current_playback.resumetime = Store.kodi_player.getTime()
28-
xbmc.sleep(500)
28+
Store.kodi_event_monitor.waitForAbort(0.5)
2929

3030
# and, we're done...
3131
footprints(startup=False)

0 commit comments

Comments
 (0)