diff --git a/api/v1_track.go b/api/v1_track.go index cdc9d311..a8d24fd2 100644 --- a/api/v1_track.go +++ b/api/v1_track.go @@ -201,9 +201,10 @@ func (app *ApiServer) v1Track(c *fiber.Ctx) error { tracks, err := app.queries.Tracks(c.Context(), dbv1.TracksParams{ GetTracksParams: dbv1.GetTracksParams{ - MyID: myId, - Ids: []int32{int32(trackId)}, - AuthedWallet: app.tryGetAuthedWallet(c), + MyID: myId, + Ids: []int32{int32(trackId)}, + AuthedWallet: app.tryGetAuthedWallet(c), + IncludeUnlisted: true, }, }) if err != nil { diff --git a/api/v1_track_download.go b/api/v1_track_download.go index 7dcaca30..ef0a6454 100644 --- a/api/v1_track_download.go +++ b/api/v1_track_download.go @@ -27,9 +27,10 @@ func (app *ApiServer) v1TrackDownload(c *fiber.Ctx) error { tracks, err := app.queries.Tracks(c.Context(), dbv1.TracksParams{ GetTracksParams: dbv1.GetTracksParams{ - MyID: myId, - Ids: []int32{int32(trackId)}, - AuthedWallet: app.tryGetAuthedWallet(c), + MyID: myId, + Ids: []int32{int32(trackId)}, + AuthedWallet: app.tryGetAuthedWallet(c), + IncludeUnlisted: true, }, }) if err != nil { diff --git a/api/v1_track_inspect.go b/api/v1_track_inspect.go index 6b45ba8b..a5b24504 100644 --- a/api/v1_track_inspect.go +++ b/api/v1_track_inspect.go @@ -75,9 +75,10 @@ func (app *ApiServer) v1TrackInspect(c *fiber.Ctx) error { tracks, err := app.queries.Tracks(c.Context(), dbv1.TracksParams{ GetTracksParams: dbv1.GetTracksParams{ - MyID: myId, - Ids: []int32{int32(trackId)}, - AuthedWallet: app.tryGetAuthedWallet(c), + MyID: myId, + Ids: []int32{int32(trackId)}, + AuthedWallet: app.tryGetAuthedWallet(c), + IncludeUnlisted: true, }, }) if err != nil { @@ -106,9 +107,10 @@ func (app *ApiServer) v1TracksInspect(c *fiber.Ctx) error { tracks, err := app.queries.Tracks(c.Context(), dbv1.TracksParams{ GetTracksParams: dbv1.GetTracksParams{ - MyID: myId, - Ids: ids, - AuthedWallet: app.tryGetAuthedWallet(c), + MyID: myId, + Ids: ids, + AuthedWallet: app.tryGetAuthedWallet(c), + IncludeUnlisted: true, }, }) if err != nil { diff --git a/api/v1_track_remixing.go b/api/v1_track_remixing.go index e7955983..09df26d6 100644 --- a/api/v1_track_remixing.go +++ b/api/v1_track_remixing.go @@ -23,11 +23,9 @@ func (app *ApiServer) v1TrackRemixing(c *fiber.Ctx) error { SELECT pt.track_id FROM tracks pt JOIN remixes r ON r.parent_track_id = pt.track_id AND r.child_track_id = @trackId - JOIN tracks ct ON ct.track_id = @trackId + JOIN tracks ct ON ct.track_id = @trackId AND ct.is_current = true AND ct.is_stream_gated = false WHERE pt.is_current = true AND pt.is_unlisted = false - AND ct.is_current = true - AND ct.is_stream_gated = false ORDER BY pt.created_at DESC, pt.track_id DESC LIMIT @limit OFFSET @offset ` diff --git a/api/v1_track_remixing_test.go b/api/v1_track_remixing_test.go index 4e26d65f..e5fa39cc 100644 --- a/api/v1_track_remixing_test.go +++ b/api/v1_track_remixing_test.go @@ -1,6 +1,7 @@ package api import ( + "context" "testing" "api.audius.co/database" @@ -93,6 +94,9 @@ func TestV1TrackRemixing(t *testing.T) { database.Seed(app.pool.Replicas[0], fixtures) + _, err := app.pool.Replicas[0].Exec(context.Background(), `UPDATE tracks SET is_unlisted = true WHERE track_id = 2`) + assert.NoError(t, err) + status, body := testGet(t, app, "/v1/full/tracks/"+trashid.MustEncodeHashID(10)+"/remixing") assert.Equal(t, 200, status) diff --git a/api/v1_track_stream.go b/api/v1_track_stream.go index 0d9d2fb5..bbae56dc 100644 --- a/api/v1_track_stream.go +++ b/api/v1_track_stream.go @@ -11,9 +11,10 @@ func (app *ApiServer) v1TrackStream(c *fiber.Ctx) error { tracks, err := app.queries.Tracks(c.Context(), dbv1.TracksParams{ GetTracksParams: dbv1.GetTracksParams{ - MyID: myId, - Ids: []int32{int32(trackId)}, - AuthedWallet: app.tryGetAuthedWallet(c), + MyID: myId, + Ids: []int32{int32(trackId)}, + AuthedWallet: app.tryGetAuthedWallet(c), + IncludeUnlisted: true, }, }) if err != nil {