bogem/id3v2 Save() renames a temp file over the original, which Windows
denies when Winamp holds the file open (no FILE_SHARE_DELETE). Fix:
- Use tag.WriteTo(&buf) to encode tag+audio into memory while the read
handle is still open
- Close the read handle
- Reopen the original file with O_WRONLY|O_TRUNC and write the buffer
Winamp opens MP3s with FILE_SHARE_WRITE so the in-place overwrite succeeds.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backend:
- winamp.GetCurrentFile() reads file path via IPC_GETPLAYLISTFILE (211)
+ ReadProcessMemory, same pattern as playlist titles
- internal/rating: Get/Set POPM frame via bogem/id3v2
- Email: rating@winamp.com (Winamp standard)
- Byte scale: 0/1/64/128/196/255 = 0-5 stars
- Compatible with Windows Explorer and Winamp
- GET /api/rating -> {stars: N}
- POST /api/rating {stars: N} -> writes POPM, returns {stars: N}
Frontend:
- 5 stars in track-info, gold when lit
- Fetched automatically on track change
- Tap to rate; tap same star again to remove rating
- Optimistic update with revert on error
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>