feat(#402): publish album/artist like events on the SSE bus

#392 shipped track.liked / track.unliked but skipped the album +
artist symmetric pairs. Closes that gap so the Flutter Liked tab's
albums and artists sub-lists can listen for changes the same way
the tracks sub-list will (#402 wire-up lands next commit).

publishLikeEvent already handles the entity_type dispatch; the four
handler call sites just need the new lines.

For #402 follow-up to #392.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 14:27:23 -04:00
parent bb9e979876
commit 89ded7b46c
+4
View File
@@ -113,6 +113,7 @@ func (h *handlers) handleLikeAlbum(w http.ResponseWriter, r *http.Request) {
return
}
h.logLikeChange(r, syncpkg.EntityLikeAlbum, user.ID, id, syncpkg.OpUpsert)
h.publishLikeEvent(user.ID, id, "album", true)
w.WriteHeader(http.StatusNoContent)
}
@@ -131,6 +132,7 @@ func (h *handlers) handleUnlikeAlbum(w http.ResponseWriter, r *http.Request) {
return
}
h.logLikeChange(r, syncpkg.EntityLikeAlbum, user.ID, id, syncpkg.OpDelete)
h.publishLikeEvent(user.ID, id, "album", false)
w.WriteHeader(http.StatusNoContent)
}
@@ -159,6 +161,7 @@ func (h *handlers) handleLikeArtist(w http.ResponseWriter, r *http.Request) {
return
}
h.logLikeChange(r, syncpkg.EntityLikeArtist, user.ID, id, syncpkg.OpUpsert)
h.publishLikeEvent(user.ID, id, "artist", true)
w.WriteHeader(http.StatusNoContent)
}
@@ -177,6 +180,7 @@ func (h *handlers) handleUnlikeArtist(w http.ResponseWriter, r *http.Request) {
return
}
h.logLikeChange(r, syncpkg.EntityLikeArtist, user.ID, id, syncpkg.OpDelete)
h.publishLikeEvent(user.ID, id, "artist", false)
w.WriteHeader(http.StatusNoContent)
}