From f2c5de1b4b843011dbc890c6215ecfe22e5a3bf5 Mon Sep 17 00:00:00 2001 From: natyusha <985941+natyusha@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:53:08 -0400 Subject: [PATCH] Remove Unused Variable / Add Note on vid.display_offset --- Contents/Code/__init__.py | 2 +- Contents/Scanners/Series/Shoko Relay Scanner.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index f23fbce..0e56ed5 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -311,7 +311,7 @@ def Update(self, metadata, media, lang, force): # Get Summary ep_summary_mod, tmdb_ep_summary = '(Preferred): ', try_get(tmdb_ep_data, 'Overview', None) - if Prefs['tmdbEpGroupNames'] and tmdb_ep_group > 1 and tmdb_ep_summary: ep_summary_mod, episode_summary = '(TMDB Ep Group): ', tmdb_ep_summary + if Prefs['tmdbEpGroupNames'] and tmdb_ep_group > 1 and tmdb_ep_summary: ep_summary_mod, episode_summary = '(TMDB Ep Group): ', tmdb_ep_summary # If TMDB episode group names are enabled and a group is present override the summary else: episode_summary = try_get(episode_data, 'Description', None) episode_obj.summary = summary_sanitizer(episode_summary) Log('Summary %s %s' % (ep_summary_mod, episode_obj.summary)) diff --git a/Contents/Scanners/Series/Shoko Relay Scanner.py b/Contents/Scanners/Series/Shoko Relay Scanner.py index f5604a2..4d00934 100644 --- a/Contents/Scanners/Series/Shoko Relay Scanner.py +++ b/Contents/Scanners/Series/Shoko Relay Scanner.py @@ -148,15 +148,14 @@ def Scan(path, files, mediaList, subdirs, language=None, root=None): elif episode_type == 'Parody' : season = -3 elif episode_type == 'Other' : season = -4 if not Prefs['SingleSeasonOrdering'] and tmdb_ep_data: episode_source, season, episode_number = '(TMDB Ep Group): ' if tmdb_ep_group > 1 else '(TMDB): ', tmdb_ep_data['SeasonNumber'], tmdb_ep_data['EpisodeNumber'] # Grab TMDB info when possible and SingleSeasonOrdering is disabled - else: tmdb_multi, episode_number = 1, episode_data['AniDB']['EpisodeNumber'] # Fallback to AniDB info + else: episode_number = episode_data['AniDB']['EpisodeNumber'] # Fallback to AniDB info Log.info(' Season %s %s%s' % (episode_source, season , episode_multi_log)) Log.info(' Episode %s %s%s' % (episode_source, episode_number, episode_multi_log)) vid = Media.Episode(show_title, season, episode_number) - if episode_multi > 1 or tmdb_ep_group > 1: # Required for multi episode files - vid.display_offset = (ep_part * 100) / (episode_multi * tmdb_ep_group) # Divide episode part by the total parts - ep_part+=1 + # Required for multi episode files and/or TMDB episode groups the display offset is equal to the part count's percentage of the total parts + if episode_multi > 1 or tmdb_ep_group > 1: vid.display_offset, ep_part = (ep_part * 100) / (episode_multi * tmdb_ep_group), ep_part + 1 Log.info(' Mapping: %s' % vid) Log.info('-' * 300) vid.parts.append(file)