Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kjtsune committed Oct 29, 2024
1 parent 678f07b commit 0ee89c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils/data_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,13 @@ def chunk_list(lst, chunk_size):
# dump_json_file(episodes, 'z_playlist_movie.json')
eps_error = [i for i in episodes['Items'] if 'Path' not in i or 'RunTimeTicks' not in i]
if eps_error:
ids_error = [i['MediaSources'][0]['Id'] for i in eps_error]
eps_error = [f"{i['Name']}-{i['Id']}" for i in eps_error]
logger.error(f'some ep miss path or runtime data, may leak error\n'
f'disable playlist and sync third party\n{eps_error}') # total_sec 没有,不方便判断进度。
return [data]
logger.error(f'some ep miss path or runtime data, may leak error\n{eps_error}')
if data['media_source_id'] in ids_error:
logger.error(f'disable playlist and sync third party') # total_sec 没有,不方便判断进度。
data['eps_error'] = True
return [data]
episodes = [i for i in episodes['Items'] if 'Path' in i and 'RunTimeTicks' in i]
episodes = version_filter(data['file_path'], episodes) if data['server'] == 'emby' else episodes
episodes = [parse_item(i) for i in episodes]
Expand Down
2 changes: 2 additions & 0 deletions utils/player_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def update_playback_for_eps(self):
ep['_stop_sec'] = _stop_sec
need_update_eps.append(ep)
for provider in 'trakt', 'bangumi':
if self.data.get('eps_error'):
break
if configs.raw.get(provider, 'enable_host', fallback=''):
threading.Thread(target=sync_third_party_for_eps,
kwargs={'eps': need_update_eps, 'provider': provider}, daemon=True).start()
Expand Down
1 change: 1 addition & 0 deletions utils/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def chapters_info_gen(_event_data):
chapter_skipped.append(chapter_unique)
time.sleep(0.5)
except Exception:
stop_sec = stop_sec and int(stop_sec)
logger.info(f'mpv exit, return stop sec, {stop_sec=}')
return stop_sec if stop_sec_only else name_stop_sec_dict

Expand Down

0 comments on commit 0ee89c9

Please sign in to comment.