diff --git a/backend/routers/shows.py b/backend/routers/shows.py index f8948fa..40c96a7 100644 --- a/backend/routers/shows.py +++ b/backend/routers/shows.py @@ -49,7 +49,11 @@ def read_shows( session: Session = Depends(get_session) ): from sqlalchemy.orm import joinedload - query = select(Show).options(joinedload(Show.vertical)) + query = select(Show).options( + joinedload(Show.vertical), + joinedload(Show.venue), + joinedload(Show.tour) + ) if tiers and current_user: prefs = session.exec( @@ -106,7 +110,11 @@ def read_recent_shows( """Get the most recent shows ordered by date descending""" from datetime import datetime from sqlalchemy.orm import joinedload - query = select(Show).options(joinedload(Show.vertical)).where(Show.date <= datetime.now()) + query = select(Show).options( + joinedload(Show.vertical), + joinedload(Show.venue), + joinedload(Show.tour) + ).where(Show.date <= datetime.now()) if tiers and current_user: prefs = session.exec( @@ -133,7 +141,11 @@ def read_upcoming_shows( """Get upcoming shows ordered by date ascending""" from datetime import datetime from sqlalchemy.orm import joinedload - query = select(Show).options(joinedload(Show.vertical)).where(Show.date > datetime.now()) + query = select(Show).options( + joinedload(Show.vertical), + joinedload(Show.venue), + joinedload(Show.tour) + ).where(Show.date > datetime.now()) if tiers and current_user: prefs = session.exec( diff --git a/frontend/app/[vertical]/page.tsx b/frontend/app/[vertical]/page.tsx index 7aa4750..ae5fdb4 100644 --- a/frontend/app/[vertical]/page.tsx +++ b/frontend/app/[vertical]/page.tsx @@ -31,7 +31,7 @@ async function getRecentShows(verticalSlug: string) { async function getTopSongs(verticalSlug: string) { try { - const res = await fetch(`${getApiUrl()}/songs/?vertical_slug=${verticalSlug}&limit=5&sort=times_played`, { + const res = await fetch(`${getApiUrl()}/songs/?vertical=${verticalSlug}&limit=5&sort=times_played`, { next: { revalidate: 60 } }) if (!res.ok) return []