feat(subsonic): an artist's top songs, and the play queue carried between devices
release / go (push) Successful in 1m50s
release / web (push) Successful in 1m14s
release / govulncheck (push) Successful in 44s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 6m15s
release / Build signed APK (push) Successful in 7m51s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
release / go (push) Successful in 1m50s
release / web (push) Successful in 1m14s
release / govulncheck (push) Successful in 44s
release / integration (push) Successful in 4m11s
release / android (push) Successful in 6m15s
release / Build signed APK (push) Successful in 7m51s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
getTopSongs ranks the named artist's songs by how often they were played through on this server, then by likes, then in album order, so an artist nobody has played yet still has songs to offer. Missing files and the listener's quarantined songs are left out. savePlayQueue keeps one queue per listener: the songs in order, the one playing, how far into it, and the app that saved it. getPlayQueue gives it back to that listener only; a song no longer in the library drops out. Saving no songs clears it. The queue lives in a new play_queues table, which backups carry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,8 @@ func TestARestoredInstanceHoldsWhatTheBackupHeld_Integration(t *testing.T) {
|
||||
session := mustID(t, pool, `INSERT INTO play_sessions (user_id, started_at, last_event_at) VALUES ($1, now(), now()) RETURNING id::text`, user)
|
||||
mustExec(t, pool, `INSERT INTO play_events (user_id, track_id, session_id, started_at) VALUES ($1, $2, $3, now())`, user, track, session)
|
||||
mustExec(t, pool, `INSERT INTO general_likes (user_id, track_id) VALUES ($1, $2)`, user, track)
|
||||
mustExec(t, pool, `INSERT INTO play_queues (user_id, track_ids, current_track_id, position_ms, changed_by)
|
||||
VALUES ($1, ARRAY[$2::uuid, $2::uuid], $2, 61000, 'an app')`, user, track)
|
||||
playlist := mustID(t, pool, `INSERT INTO playlists (user_id, name) VALUES ($1, 'Mine') RETURNING id::text`, user)
|
||||
mustExec(t, pool, `INSERT INTO playlist_tracks (playlist_id, position, track_id, title, artist_name, album_title, duration_sec)
|
||||
VALUES ($1, 0, $2, 'Track', 'Artist', 'Album', 180)`, playlist, track)
|
||||
@@ -172,7 +174,7 @@ func TestARestoredInstanceHoldsWhatTheBackupHeld_Integration(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, tbl := range []string{"users", "tracks", "play_events", "general_likes", "playlist_tracks", "library_changes"} {
|
||||
for _, tbl := range []string{"users", "tracks", "play_events", "general_likes", "play_queues", "playlist_tracks", "library_changes"} {
|
||||
if len(first.Tables[tbl]) == 0 {
|
||||
t.Errorf("the backup holds no %s", tbl)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user