Skip to content

Filter out removed and unavailable tracks from user listening history#763

Merged
dylanjeffers merged 1 commit intomainfrom
claude/exclude-removed-tracks-history-OhSwL
Apr 14, 2026
Merged

Filter out removed and unavailable tracks from user listening history#763
dylanjeffers merged 1 commit intomainfrom
claude/exclude-removed-tracks-history-OhSwL

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Updated the user listening history endpoint to exclude deleted tracks, unavailable tracks, and tracks from deactivated users from the results.

Changes

  • Added three filter conditions to the v1UsersHistory endpoint:
    • tracks.is_delete = false - excludes tracks marked as deleted
    • tracks.is_available = true - excludes tracks marked as unavailable
    • users.is_deactivated = false - excludes tracks from deactivated users
  • Added comprehensive test case TestUserListeningHistoryExcludesRemovedTracks that verifies:
    • Active tracks are included in the history
    • Deleted tracks are filtered out
    • Unavailable tracks are filtered out
    • Tracks from deactivated users are filtered out

Implementation Details

The filters are applied at the database query level in the listening history endpoint, ensuring that only valid, accessible tracks are returned to users. This prevents users from seeing tracks that have been removed or are no longer available.

https://claude.ai/code/session_01PZcVKSnX4KGMcL9zmQvsC9

…ing history

The history endpoint was returning tracks that had been removed (is_delete),
made unavailable (is_available=false), or owned by deactivated users. Add
filters consistent with other track-listing endpoints.

https://claude.ai/code/session_01PZcVKSnX4KGMcL9zmQvsC9
@dylanjeffers dylanjeffers merged commit b60b9ba into main Apr 14, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the claude/exclude-removed-tracks-history-OhSwL branch April 14, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants