diff --git a/app/api/api_v2/shows.rb b/app/api/api_v2/shows.rb index b2da4fae..6a5319c6 100644 --- a/app/api/api_v2/shows.rb +++ b/app/api/api_v2/shows.rb @@ -1,4 +1,4 @@ -class ApiV2::Shows < ApiV2::Base +class ApiV2::Shows < ApiV2::Base # rubocop:disable Metrics/ClassLength SORT_COLS = %w[date likes_count duration updated_at] helpers do diff --git a/app/api/api_v2/years.rb b/app/api/api_v2/years.rb index 4e1452cd..af808c3f 100644 --- a/app/api/api_v2/years.rb +++ b/app/api/api_v2/years.rb @@ -43,7 +43,7 @@ def stats_for(period) else shows.during_year(period) end - cover_art_urls = shows.order(date: :desc).first.cover_art_urls + cover_art_urls = shows.order(date: :desc).first&.cover_art_urls [ shows.count, shows.select(:venue_id).distinct.count, shows.sum(:duration), cover_art_urls ] end end diff --git a/app/javascript/components/Eras.jsx b/app/javascript/components/Eras.jsx index 2871421a..79db637d 100644 --- a/app/javascript/components/Eras.jsx +++ b/app/javascript/components/Eras.jsx @@ -110,7 +110,7 @@ const Eras = () => { const renderGridItem = ({ period, shows_count, venues_count, cover_art_urls }) => ( -
  • +
  • {period}