Skip to content

Commit

Permalink
Remove Unused Variable / Add Note on vid.display_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
natyusha committed Oct 22, 2024
1 parent dff981f commit f2c5de1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 3 additions & 4 deletions Contents/Scanners/Series/Shoko Relay Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f2c5de1

Please sign in to comment.