Skip to content

Commit

Permalink
Changes requested from review xbmc/repo-plugins#4596 (review)
Browse files Browse the repository at this point in the history
  • Loading branch information
bossanova808 committed Nov 11, 2024
1 parent 93b750c commit ecedb87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions resources/lib/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ class Playback:
channelnumberlabel:str = None
channelgroup:str = None

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

8 changes: 3 additions & 5 deletions resources/lib/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,9 @@ def save_switchback_list():
:return:
"""
with open(Store.switchback_list_file, 'w', encoding='utf-8') as f:
temp_json = []
for playback in Store.switchback_list:
temp_json.append(playback.toJson())
temp_json = ',\n'.join(temp_json)
f.write(f"[\n{temp_json}\n]\n")
json_string = json.dumps([vars(playback) for playback in Store.switchback_list], indent=4)
f.write(json_string)




2 changes: 1 addition & 1 deletion resources/lib/switchback_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run():
# (Playback record is created onAVStarted in player.py, so check here that it is available)
elif Store.current_playback and Store.kodi_player.isPlaying():
Store.current_playback.resumetime = Store.kodi_player.getTime()
xbmc.sleep(500)
Store.kodi_event_monitor.waitForAbort(0.5)

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

0 comments on commit ecedb87

Please sign in to comment.