Skip to content

Commit

Permalink
Fixed some typos and logging, thanks to @JaiZed! ;-)
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Nov 21, 2024
1 parent d0fca47 commit 5e552a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bazarr/api/episodes/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def get(self):

item.update(postprocess(item))

# Mark upgradeable and get original_id
# Mark upgradable and get original_id
item.update({'original_id': upgradable_episodes_not_perfect.get(item['id'])})
item.update({'upgradable': bool(item['original_id'])})

# Mark not upgradable if score or if video/subtitles file doesn't exist anymore
# Mark not upgradable if video/subtitles file doesn't exist anymore or if language isn't desired anymore
if item['upgradable']:
if (item['subtitles_path'] not in item['external_subtitles'] or item['video_path'] != item['path'] or
not still_desired):
Expand Down
4 changes: 2 additions & 2 deletions bazarr/api/movies/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def get(self):

item.update(postprocess(item))

# Mark upgradeable and get original_id
# Mark upgradable and get original_id
item.update({'original_id': upgradable_movies_not_perfect.get(item['id'])})
item.update({'upgradable': bool(item['original_id'])})

# Mark not upgradable if score or if video/subtitles file doesn't exist anymore
# Mark not upgradable if video/subtitles file doesn't exist anymore or if language isn't desired anymore
if item['upgradable']:
if (item['subtitles_path'] not in item['external_subtitles'] or item['video_path'] != item['path'] or
not still_desired):
Expand Down
12 changes: 6 additions & 6 deletions bazarr/subtitles/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def upgrade_subtitles():
if item['subtitles_path'] not in item['external_subtitles']:
continue

# Mark upgradeable and get original_id
# Mark upgradable and get original_id
item.update({'original_id': episodes_to_upgrade.get(item['id'])})
item.update({'upgradable': bool(item['original_id'])})

Expand Down Expand Up @@ -174,7 +174,7 @@ def upgrade_subtitles():
if item['subtitles_path'] not in item['external_subtitles']:
continue

# Mark upgradeable and get original_id
# Mark upgradable and get original_id
item.update({'original_id': movies_to_upgrade.get(item['id'])})
item.update({'upgradable': bool(item['original_id'])})

Expand Down Expand Up @@ -283,7 +283,7 @@ def get_upgradable_episode_subtitles():

minimum_timestamp, query_actions = get_queries_condition_parameters()
logging.debug(f"Minimum timestamp used for subtitles upgrade: {minimum_timestamp}")
logging.debug(f"Those actions are considered for subtitles upgrade: {query_actions}")
logging.debug(f"These actions are considered for subtitles upgrade: {query_actions}")

upgradable_episodes_conditions = [(TableHistory.action.in_(query_actions)),
(TableHistory.timestamp > minimum_timestamp),
Expand Down Expand Up @@ -348,7 +348,7 @@ def get_upgradable_episode_subtitles():
def get_upgradable_movies_subtitles():
if not settings.general.upgrade_subs:
# return an empty set of rows
logging.debug("Subtitles upgrade is disabled so we wont go further.")
logging.debug("Subtitles upgrade is disabled so we won't go further.")
return select(TableHistoryMovie.id) \
.where(TableHistoryMovie.id.is_(None)) \
.subquery()
Expand All @@ -363,7 +363,7 @@ def get_upgradable_movies_subtitles():

minimum_timestamp, query_actions = get_queries_condition_parameters()
logging.debug(f"Minimum timestamp used for subtitles upgrade: {minimum_timestamp}")
logging.debug(f"Those actions are considered for subtitles upgrade: {query_actions}")
logging.debug(f"These actions are considered for subtitles upgrade: {query_actions}")

upgradable_movies_conditions = [(TableHistoryMovie.action.in_(query_actions)),
(TableHistoryMovie.timestamp > minimum_timestamp),
Expand Down Expand Up @@ -411,7 +411,7 @@ def get_upgradable_movies_subtitles():
for potential_parent in potential_parents:
if potential_parent.action in query_actions_without_upgrade:
confirmed_parent = potential_parent.id
logging.debug(f"This ID is the first one to match selected query actions so it's been selected as "
logging.debug(f"This ID is the newest one to match selected query actions so it's been selected as "
f"original subtitles ID: {potential_parent.id}")
break

Expand Down

0 comments on commit 5e552a9

Please sign in to comment.