You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a consumer of lastfm-client-ts, I want track.updateNowPlaying to announce the current track with the complete documented metadata, so that players can update Last.fm state without abusing scrobble or hand-signing requests.
Require non-empty artist/track and validate optional scalar fields using compatible base schemas.
Preserve exact public/wire names trackNumber and albumArtist; do not silently rename to snake case.
Omit undefined optional values from body and signature.
Resolve request/config session and delegate to shared signed POST.
Build a faithful endpoint-specific response schema for nowplaying, corrected attributes/text, and ignored message.
Reuse scrobble corrected-field components only after confirming identical JSON shape; otherwise keep them separate.
Do not introduce a timestamp parameter.
Add official JSDoc and verify root/track/track-schema exports.
Preserve all existing track methods/aliases.
Security and side effects
The method mutates the account's current now-playing state. Do not log session/signature/body/signed URL. Unit tests are mocked. The later manual workflow documents this transient state and uses a stable test track; there is no official undo endpoint.
Out of scope
Scrobbling the play or adding a timestamp.
Guaranteeing access to restricted context for every API key.
Polling Last.fm until now-playing expires.
Track tag/love/correction methods owned by other child issues.
Canonical track.updateNowPlaying exists with required/optional params above.
Undefined options are absent from body/signature; minimum and full requests are covered.
Exact wire casing for trackNumber/albumArtist is retained.
timestamp is not accepted/emitted.
Request/config/missing session behavior is shared and tested.
URL has no write fields; body contains method/API/session/signature/format.
Response schema parses corrected fields and ignored message from a verified fixture.
Invalid-session/API errors are normalized.
Public exports work and existing track methods do not regress.
Verification
Mock tests inspect minimum/full bodies and signatures, omission of undefined, numeric/string duration/track number, Unicode, response corrected/ignored fields, invalid session, and exports. Future manual workflow calls the real endpoint using the dedicated account and sanitized logs.
Historical context
Supersedes closed issue #44. See #63 and parent #67. Do not reopen/edit #44.
Parent epic: #67
User story
As a consumer of
lastfm-client-ts, I wanttrack.updateNowPlayingto announce the current track with the complete documented metadata, so that players can update Last.fm state without abusing scrobble or hand-signing requests.Official Last.fm contract
artist,track.album,trackNumber,context,mbid,duration(seconds),albumArtist.method,api_key,api_sig,sk,format=json.nowplaying, including corrected text fields for track/artist/album/albumArtist andignoredMessagewith code/text.timestamp; do not add it;contextis available only to some API keys;Public TypeScript API
Export request/response schemas, inferred types, and small corrected-text/ignored-message components when reusable with verified scrobble wire shapes.
Implementation standard
Primary files:
src/services/track.schemas.tssrc/services/track.tsRequirements:
trackNumberandalbumArtist; do not silently rename to snake case.nowplaying, corrected attributes/text, and ignored message.Security and side effects
The method mutates the account's current now-playing state. Do not log session/signature/body/signed URL. Unit tests are mocked. The later manual workflow documents this transient state and uses a stable test track; there is no official undo endpoint.
Out of scope
contextfor every API key.Dependencies
Blocked by #68 — Unify signed POST transport and migrate track.scrobble shared signed POST transport.
Acceptance criteria
track.updateNowPlayingexists with required/optional params above.trackNumber/albumArtistis retained.timestampis not accepted/emitted.Verification
Mock tests inspect minimum/full bodies and signatures, omission of undefined, numeric/string duration/track number, Unicode, response corrected/ignored fields, invalid session, and exports. Future manual workflow calls the real endpoint using the dedicated account and sanitized logs.
Historical context
Supersedes closed issue #44. See #63 and parent #67. Do not reopen/edit #44.