Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions api/v1_track.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions api/v1_track_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 8 additions & 6 deletions api/v1_track_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions api/v1_track_remixing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

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

why was stream gated removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah wtf

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
`
Expand Down
4 changes: 4 additions & 0 deletions api/v1_track_remixing_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api

import (
"context"
"testing"

"api.audius.co/database"
Expand Down Expand Up @@ -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)

Expand Down
7 changes: 4 additions & 3 deletions api/v1_track_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading