diff --git a/vcinema_utils/VCinemaUtils.py b/vcinema_utils/VCinemaUtils.py index 5b03626..9de968b 100644 --- a/vcinema_utils/VCinemaUtils.py +++ b/vcinema_utils/VCinemaUtils.py @@ -42,12 +42,8 @@ def filter_viewings(viewings, pivot_field, remove_duplicates=True): for viewing in viewings: viewing_field = viewing[pivot_field] if viewing_field in viewings_filtered.keys(): - try: - if not remove_duplicates or (remove_duplicates and not any(x['imdb_id'] == viewing['imdb_id'] for x in viewings_filtered[viewing_field])): - viewings_filtered[viewing_field] += [viewing] - except KeyError as e: - print(e) - print(viewing) + if not remove_duplicates or (remove_duplicates and not any(x['imdb_id'] == viewing['imdb_id'] for x in viewings_filtered[viewing_field])): + viewings_filtered[viewing_field] += [viewing] else: viewings_filtered[viewing[pivot_field]] = [viewing]