feat(db): add session-vector capture queries; LikeTrack returns row count
ListRecentSessionTracks + UpdatePlayEventVector for the vector capture path inside RecordPlayStarted. LikeTrack switches to :execrows so the contextual-likes capture can detect insert vs already-exists. Existing callers updated to ignore the count for now; later tasks consume it.
This commit is contained in:
@@ -76,7 +76,7 @@ func (q *Queries) LikeArtist(ctx context.Context, arg LikeArtistParams) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const likeTrack = `-- name: LikeTrack :exec
|
||||
const likeTrack = `-- name: LikeTrack :execrows
|
||||
INSERT INTO general_likes (user_id, track_id)
|
||||
VALUES ($1, $2)
|
||||
ON CONFLICT (user_id, track_id) DO NOTHING
|
||||
@@ -87,9 +87,12 @@ type LikeTrackParams struct {
|
||||
TrackID pgtype.UUID
|
||||
}
|
||||
|
||||
func (q *Queries) LikeTrack(ctx context.Context, arg LikeTrackParams) error {
|
||||
_, err := q.db.Exec(ctx, likeTrack, arg.UserID, arg.TrackID)
|
||||
return err
|
||||
func (q *Queries) LikeTrack(ctx context.Context, arg LikeTrackParams) (int64, error) {
|
||||
result, err := q.db.Exec(ctx, likeTrack, arg.UserID, arg.TrackID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return result.RowsAffected(), nil
|
||||
}
|
||||
|
||||
const listLikedAlbumIDs = `-- name: ListLikedAlbumIDs :many
|
||||
|
||||
Reference in New Issue
Block a user