From 9187cdac260bcb0e741cfcf0c65d1efc5246c78a Mon Sep 17 00:00:00 2001 From: RemiRigal Date: Sat, 30 Apr 2022 12:23:14 +0200 Subject: [PATCH] Fix minor issues --- main.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index b47c654..5ed5e4d 100644 --- a/main.py +++ b/main.py @@ -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 @@ -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 @@ -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()