diff --git a/app/models.py b/app/models.py index 60a1878..78185df 100644 --- a/app/models.py +++ b/app/models.py @@ -718,7 +718,11 @@ class Tracks(Base): """Search case-insenstively for titles containing str""" return ( session.execute( - select(cls).where(cls.title.like(f"{text}%")).order_by(cls.title) + select(cls) + .join(Playdates, isouter=True) + .where(cls.title.like(f"{text}%")) + .group_by(cls.title) + .order_by(cls.title) ) .scalars() .all()