File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments