Skip to content

Commit

Permalink
fix: Make report more robust.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico-AP committed Sep 2, 2023
1 parent 97fe8fe commit b05faa9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions digital_meal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ def get_context_data(self, **kwargs):
fav_video['title'] = video_titles.get(fav_video['id'])

channels = yt_data.get_channels_from_history(watched_videos)

n_videos_jun_to_aug = yt_data.filter_jun_to_aug(watched_videos).shape[0]
n_ads_jun_to_aug = yt_data.filter_jun_to_aug(seen_ads).shape[0]
try:
n_videos_jun_to_aug = yt_data.filter_jun_to_aug(watched_videos).shape[0]
except:
n_videos_jun_to_aug = None

try:
n_ads_jun_to_aug = yt_data.filter_jun_to_aug(seen_ads).shape[0]
except:
n_ads_jun_to_aug = None

context.update({
'dates_plot': yt_plots.get_timeseries_plot(dates),
Expand Down

0 comments on commit b05faa9

Please sign in to comment.