-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
discogs: Fetch a few more metadata fields #465
Comments
Thanks for this idea! We do already appear to be fetching the country and release year, but the full date and genre/style would be cool to add. We also get the URL (as |
I've tried doing this myself, but I am unsure if what I have done is correct. Here is the code I changed / updated in the discogs.py file def get_album_info(self, result): """Returns an AlbumInfo object for a discogs Release object. """ album = re.sub(r' +', ' ', result.title) album_id = result.data['id'] artist, artist_id = self.get_artist(result.data['artists']) # Use `.data` to access the tracklist directly instead of the convenient # `.tracklist` property, which will strip out useful artist information # and leave us with skeleton `Artist` objects that will each make an API # call just to get the same data back. tracks = self.get_tracks(result.data['tracklist']) albumtype = ', '.join( result.data['formats'][0].get('descriptions', [])) or None va = result.data['artists'][0]['name'].lower() == 'various' year = result.data['year'] releasedate = result.data['released'] genre = result.data['genres'] style = result.data['styles'] label = result.data['labels'][0]['name'] mediums = len(set(t.medium for t in tracks)) catalogno = result.data['labels'][0]['catno'] if catalogno == 'none': catalogno = None country = result.data.get('country') media = result.data['formats'][0]['name'] data_url = result.data['uri'] return AlbumInfo(album, album_id, artist, artist_id, tracks, asin=None, albumtype=albumtype, va=va, year=year, month=None, day=None, label=label, mediums=mediums, artist_sort=None, releasegroup_id=None, catalognum=catalogno, script=None, language=None, country=country, albumstatus=None, media=media, albumdisambig=None, artist_credit=None, original_year=None, original_month=None, original_day=None, data_source='Discogs', data_url=data_url, releasedate=releasedate, genre=genre, style=style) I'm not sure how to apply this newly obtained data to tag fields... Also i'd love to be able to get the image from discogs as well. How would I go about doing that? |
Looks cool! Would you mind opening a Pull Request for easy reviewing/merging? Images will require a bit more effort, and probably collaboration with the fetchart plugin (see #429). |
I have no idea what I am doing with this so I'm not sure it's worth me opening a pull request. I don't know if what I wrote up there is correct or if it will break the plugin. I was hoping someone else would take the lead on this and I could pitch in some help if needed. |
Well, opening a PR is free, and it's probably the best way to collaborate on this (we can run tests, add commits, etc. to iterate toward a final solution). This seems like a perfect start! |
This looks interesting. How does the discogs genre metadata compare with the genre metadata being extracted from last.fm by |
Good question, @gwern! It would be interesting to see a comparison between Last.fm data and Discogs data for a few representative examples. |
Last.fm is useful for obtain genres with popular artist/albums. In other case, it's useless. |
It would be good to fetch Discogs Release ID as well. It could be useful in case an "update tags" feature is planned. |
+1 on the idea to store Release ID. These identifiers are stable, so they are definitely worth storing, just like MBIDs. |
Is this still something that is pending development? Would love to also have the styles from discogs. |
I guess it is, but someone needs to help and add this functionality. Also, Discogs now provides composition identifiers that would be nice to add too, for example https://www.discogs.com/composition/0ad990be-3414-479f-8c9b-73ed43619781-The-Nine |
K, started looking into this and started some development. As I am new to python it may take some time. |
Will start working on this to retrieve and store additional discogs values for the attributes listed above. |
Hey Guys,
I've recently begun using the Discogs plugin for beets. I am wondering if the information obtained by the plugin could be extended? I am looking to get the following information for each release I tag:
Discogs URL
Release Date (YYYY-MM-DD)
Genre
Style
Country
I tried playing with the plugin to get this information, but I am not well-versed in python.
Having the ability to specify what tag fields this information is applied to would also be amazing.
Thanks guys!
The text was updated successfully, but these errors were encountered: