Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: albumart #67

Open
rain0r opened this issue Mar 31, 2021 · 1 comment
Open

Feature request: albumart #67

rain0r opened this issue Mar 31, 2021 · 1 comment
Assignees

Comments

@rain0r
Copy link
Contributor

rain0r commented Mar 31, 2021

It would be very cool if javampd would support the MPD command albumart.

From the docs:

albumart {URI} {OFFSET}

Locate album art for the given song and return a chunk of an album art image file at offset OFFSET.

This is currently implemented by searching the directory the file resides in for a file called cover.png, cover.jpg, cover.tiff or cover.bmp.

Returns the file size and actual number of bytes read at the requested offset, followed by the chunk requested as raw bytes (see Binary Responses), then a newline and the completion code.

I can imagine an additional method in MPDArtworkFinder that takes the file path of a track and returns the cover that resides inside the same directory.

Though I'm not sure if it work's with the current implementation of MPDSocket#sendBytes() since that uses readLine() and the cover returned by MPD will be in bytes.

@rain0r rain0r changed the title Feature request. albumart Feature request: albumart Mar 31, 2021
@finnyb finnyb self-assigned this Apr 2, 2021
@rain0r
Copy link
Contributor Author

rain0r commented Feb 13, 2025

Hey there, just wanted to give you a little heads-up.

I implemented the command readpicture {URI} {OFFSET} which works similar to albumart {URI} {OFFSET}:

https://github.com/rain0r/ampd/blob/master/src/main/java/org/hihn/ampd/server/javampd/EmbeddedCoverService.java

The code is very rough around the edges but it works.

You may (or may not) take some inspiration from that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants