Skip to content
4 changes: 2 additions & 2 deletions lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export async function selectCatalogSongsWithArtists(
album,
notes,
updated_at,
song_artists!inner (
song_artists (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0: Removing !inner breaks the artistName filter — with left joins, .eq("songs.song_artists.accounts.name", artistName) only filters which nested accounts rows appear, not which top-level catalog_songs are returned. All songs will be returned regardless of the artistName parameter.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/supabase/catalog_songs/selectCatalogSongsWithArtists.ts, line 58:

<comment>Removing `!inner` breaks the `artistName` filter — with left joins, `.eq("songs.song_artists.accounts.name", artistName)` only filters which nested accounts rows appear, not which top-level catalog_songs are returned. All songs will be returned regardless of the artistName parameter.</comment>

<file context>
@@ -55,9 +55,9 @@ export async function selectCatalogSongsWithArtists(
         notes,
         updated_at,
-        song_artists!inner (
+        song_artists (
           artist,
-          accounts!inner (
</file context>
Suggested change
song_artists (
song_artists!inner (

artist,
accounts!inner (
accounts (
id,
name,
timestamp
Expand Down
Loading