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

web: View album art #2272

Closed
claman opened this issue Nov 19, 2016 · 6 comments
Closed

web: View album art #2272

claman opened this issue Nov 19, 2016 · 6 comments
Labels
feature features we would like to implement

Comments

@claman
Copy link
Contributor

claman commented Nov 19, 2016

I'm not sure if this has been brought up before, but I really like being able to view album art. Is there a way to add that to the web interface, or possibly through a plugin?

@sampsyo sampsyo added the feature features we would like to implement label Nov 19, 2016
@sampsyo sampsyo changed the title View album art in beet web web: View album art Nov 19, 2016
@sampsyo
Copy link
Member

sampsyo commented Nov 19, 2016

Seems like a good idea! We'd really like to move to a new architecture for the web plugin so it could be extensible in this way (c.f. #718), but if you're interested, there's also no reason we couldn't hack it onto the current web interface.

@claman
Copy link
Contributor Author

claman commented Nov 20, 2016

I don't think that I know enough python to be of much help here, but I'll take a look soon

@claman
Copy link
Contributor Author

claman commented Nov 20, 2016

This seems like a good repo to pull ideas from: https://github.com/tkem/mopidy-local-images

Has development on https://github.com/jtemplet/beets-web stalled?

Related: how do I run beets from the code in the repo?

@irskep
Copy link

irskep commented Jan 16, 2017

To answer your last question about running code in the repo, I typically create a virtualenv, and then run code like this:

python setup.py install && beet <cmd>

It's a little slow but you always get the freshest version of your code.

@claman
Copy link
Contributor Author

claman commented Feb 25, 2017

So I was (finally) poking around the code a bit more, and it looks like flask is exposing the albumart if the item has it available, but I can't figure out how to access it.

I'm looking at these lines:

271 @app.route('/album/<int:album_id>/art')
272 def album_art(album_id):
273     album = g.lib.get_album(album_id)
274     if album.artpath:
275         return flask.send_file(album.artpath)
276     else:
277         return flask.abort(404)

@sampsyo
Copy link
Member

sampsyo commented Feb 26, 2017

Just use an image tag like <img src="/album/(id)/art">, given the id of the album. That should do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

No branches or pull requests

3 participants