feat(subsonic): wire contextual_likes capture/soft-delete into star/unstar

handleStar's track branch calls playevents.CaptureContextualLikeIfPlaying
when the underlying LikeTrack actually inserted a row. handleUnstar
calls SoftDeleteContextualLikes after every track-id unstar. Same
helpers as the api surface — single source of truth.

mediaHandlers struct gains a logger field threaded through Mount.
This commit is contained in:
2026-04-27 11:25:10 -04:00
parent fe1cc46752
commit bf7c5ad47d
5 changed files with 60 additions and 7 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ func testScrobblePool(t *testing.T) (*pgxpool.Pool, dbq.User, dbq.Track) {
func newScrobbleHandlers(pool *pgxpool.Pool) *mediaHandlers {
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
w := playevents.NewWriter(pool, logger, 30*time.Minute, 0.5, 30000)
return newMediaHandlers(pool, w)
return newMediaHandlers(pool, w, logger)
}
func TestHandleScrobble_SubmissionFalseInsertsOpenPlayEvent(t *testing.T) {