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

Use fanart.tv API to query cover/background if song has no meta-tags #50

Open
bohning opened this issue Dec 17, 2022 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@bohning
Copy link
Owner

bohning commented Dec 17, 2022

Not sure if this is possible, but maybe fanart.tv could be queried automatically for missing cover/background artwork.

https://fanarttv.docs.apiary.io/#

@bohning bohning added the enhancement New feature or request label Dec 17, 2022
@randompersona1
Copy link

randompersona1 commented Aug 24, 2024

As far as I can tell, the fanart api does not support searching and is quite basic anyways. Besides, I have no idea how we would even choose an image from a particular artist.

Instead, I propose merging this issue with #56 and using musicbrains api: https://musicbrainz.org/doc/MusicBrainz_API. It could supply the album cover image (not perfect, but far better than nothing), the release date, the language, and the genre of the song, as well as tons of information for potential future use. A python wrapper for the api already exists that implements rate limiting fairly elegantly, as musicbrainz is quite strict about that: https://musicbrainz.org/doc/MusicBrainz_API/Rate_Limiting. From my initial testing, the wrapper works perfectly, and while downloading cover images is a bit slow, as it uses the internet archive, but usable for the fallback cases where this would be used. Here's a tiny example: https://gist.github.com/randompersona1/955928e3fe10d5fe420dd8ca948954b2

The hardest part would probably be finding the song in the first place, because we might need to filter strings like "(Album Version)" or "(Live Edition)" as not to confuse the search. Since their database is so comprehensive, there are also often several artists or songs with the same name (e.g. three Adele's), further complicating this.

Unfortunately, I don't see any way of getting a background for a given song with any service.

also refers to #20

@randompersona1
Copy link

Ah, this is a problem - we can't have multithreaded api requests, as that could put us over the allowed api limit. That could make the implementation tricky

@bohning
Copy link
Owner Author

bohning commented Aug 24, 2024

In the meantime, pretty much all songs contain metatags, so I'd say this is not worth the effort.

@randompersona1
Copy link

Not genre though - there are currently 13000 songs without. tbf, it doesn't make sense for all of them, but a good chunk of those is just missing one. And there's ~1000 songs without a release date

@bohning
Copy link
Owner Author

bohning commented Aug 24, 2024

Agreed, harmonizing #GENRE by lookup (be it musicbrainz or something else) would be a great improvement (not only for those missing #GENRE, but also to verify/supplement/correct existing #GENRE tags), the same goes for the release year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants