Add support for binary responses#146
Open
breitnw wants to merge 8 commits into
Open
Conversation
breitnw
marked this pull request as draft
June 8, 2026 15:36
breitnw
marked this pull request as ready for review
June 8, 2026 16:43
Author
|
The last two commits add support for the |
Author
|
I changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #98.
This PR adds a foundation for handling MPD's binary responses. The central change I made was introducing a union data structure (
ResponseEntry) which represents a single entry in an MPD response (either a line of text or a block of binary data).[ResponseEntry]ends up replacing[ByteString]in many signatures, most notably those ofParserandmpdSend. I felt that introducing a new type to distinguish text from bytes was the right choice because binary entries must be parsed immediately (inmpdSend) to prevent them from being split across multiple lines.I've implemented the
albumartcommand (requested in #98), as well as thereadpictureandbinarylimitcommands.Since I'm new to the project, I'm very open to feedback if you think anything should be improved here! Specifically, I wasn't sure whether it was the right choice to expose the
ByteStringas a member ofAlbumArtChunk, or if some other way of exposing the raw data would be preferred.