Skip to content

Commit

Permalink
Fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiRigal committed Apr 30, 2022
1 parent c5bebb1 commit 9187cda
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,8 @@ def process_timeline(self, timeline: dict):
return

# Check if the item has been added recently
if item.addedAt < datetime.now() - timedelta(minutes=2):
return

if item_id in self.newly_added and self.newly_added[item_id] == item.addedAt:
if item.addedAt < datetime.now() - timedelta(minutes=2) or \
(item_id in self.newly_added and self.newly_added[item_id] == item.addedAt):
return
self.newly_added[item_id] = item.addedAt

Expand Down Expand Up @@ -281,7 +279,7 @@ def change_default_tracks_if_needed(self, username: str, episode: Episode, episo
# Get changes to perform
changes = PlexUtils.get_track_changes(episode, episodes)
if len(changes) == 0:
logger.debug(f"[Language Update] No changes to perform for show {episode.show()}")
logger.debug(f"[Language Update] No changes to perform for show {episode.show()} and user '{username}'")
return

# Perform changes
Expand All @@ -302,12 +300,6 @@ def change_default_tracks_if_needed(self, username: str, episode: Episode, episo
self.notify_changes(username, episode, episodes, nb_updated_episodes, nb_total_episodes)


def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config_file", type=str, help="Config file path")
return parser.parse_args()


if __name__ == "__main__":
logger = init_logger()

Expand Down

0 comments on commit 9187cda

Please sign in to comment.