diff --git a/TimeToTrakt.py b/TimeToTrakt.py index 4f544be..42e21cb 100644 --- a/TimeToTrakt.py +++ b/TimeToTrakt.py @@ -72,6 +72,18 @@ def get_configuration() -> Config: config = get_configuration() +# Check if the user has provided the folder path or file paths +if config.movie_path == config.show_path and os.path.isdir(config.movie_path): + config.movie_path = os.path.join(config.movie_path, "tracking-prod-records.csv") + config.show_path = os.path.join(config.show_path, "tracking-prod-records-v2.csv") + + for path in (config.movie_path, config.show_path): + if not os.path.isfile(path): + logging.error( + "Oops! The files provided do not exist on the local system. Please ensure the paths provided are to the specific files and not the folder they are in, and try again." + ) + break + WATCHED_SHOWS_PATH = config.show_path WATCHED_MOVIES_PATH = config.movie_path diff --git a/processor.py b/processor.py index 0ca0fa6..6f7229b 100644 --- a/processor.py +++ b/processor.py @@ -156,7 +156,7 @@ def _process(self, tv_time_show: TVTimeTVShow, trakt_show: TraktItem, progress: syncedEpisodesTable.insert({"episodeId": tv_time_show.episode_id}) logging.info( f"'{tv_time_show.name} Season {tv_time_show.season_number}," - f" Episode {tv_time_show.episode_number}' marked as seen" + f" Episode {tv_time_show.episode_number}' marked as seen at {tv_time_show.date_watched.strftime('%Y-%m-%d %H:%M:%S')}" ) def _handle_index_error(self, tv_time_show: TVTimeTVShow, trakt_show: TraktTVShow, progress: str) -> None: @@ -214,7 +214,7 @@ def _process(self, tv_time_movie: TVTimeMovie, trakt_movie: TraktMovie, progress syncedMoviesTable.insert( {"movie_name": tv_time_movie.name, "type": "watched"} ) - logging.info(f"'{tv_time_movie.name}' marked as seen") + logging.info(f"'{tv_time_movie.name}' marked as seen at {tv_time_movie.date_watched.strftime('%Y-%m-%d %H:%M:%S')}") elif len(movies_in_watchlist) == 0: trakt_movie.add_to_watchlist() # Add the episode to the local database as imported, so it can be skipped,