Skip to content

#2579 Adding styles to discogs plugin - #3251

Merged
sampsyo merged 16 commits into
beetbox:masterfrom
thedevilisinthedetails:master
Jun 10, 2019
Merged

#2579 Adding styles to discogs plugin#3251
sampsyo merged 16 commits into
beetbox:masterfrom
thedevilisinthedetails:master

Conversation

@thedevilisinthedetails

@thedevilisinthedetails thedevilisinthedetails commented May 5, 2019

Copy link
Copy Markdown

Adding styles to discogs plugin. Closes #2579.

@thedevilisinthedetails thedevilisinthedetails changed the title #2579 #2579 Adding styles to discogs plugin May 5, 2019

@sampsyo sampsyo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are a few suggestions!

Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beets/config_default.yaml Outdated

@sampsyo sampsyo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome; thank you for looking into this! Here are some suggestions.

Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread beetsplug/discogs.py Outdated
Comment thread test/test_discogs.py Outdated
Comment thread test/test_discogs.py Outdated
Comment thread tox.ini

[tox]
envlist = py27-test, py37-test, py38-test, py27-flake8, docs
envlist = py27-test, py37-test, py27-flake8, docs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is showing up in the diff? py38-test is disabled by default on master.

Comment thread beetsplug/discogs.py Outdated
if style is None:
self._log.debug('Style not Found')
elif not style:
return style

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to return [], i.e., an empty list, instead of a string. I think it should be fine to remove this entire elif case: if the string is empty, then 'something'.join(sorted([])) will return '', which is probably what we want.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D Think there was some confusion. When i was checking len == 0 it should have been len== 1. If there is only one style tag in the response then I want to just return that style tag as is with no formatting. So I guess I just needed to chage len == 0 to len == 1. Hope this clarifies what I am trying to achieve. If this makes sense I will make the change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does! But I still don't think this elif case is necessary for that—a single style in the list will still "do nothing" when joined. For example:

>>> ', '.join(['foo'])
'foo'

…so the one-element list case is also handled by the general case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 fixed

@sampsyo

sampsyo commented Jun 10, 2019

Copy link
Copy Markdown
Member

Awesome; thank you!! Merged with a changelog entry.

@sampsyo
sampsyo merged commit 34c2852 into beetbox:master Jun 10, 2019
sampsyo added a commit that referenced this pull request Jun 10, 2019
sampsyo added a commit that referenced this pull request Jun 10, 2019
@ghost

ghost commented Jul 29, 2021

Copy link
Copy Markdown

Hi did this feature ever get added to the plugin? If so how do I use it? Thanks

@jordanbs

jordanbs commented Jan 5, 2022

Copy link
Copy Markdown

Thank you for this feature! One issue to report:

It looks like the styles tag is only being written to the beets library, and not to the id3 tag itself. beets write has no impact.

% beet info -l album:Marius title:"Don't"
[..snip...]
style: Ambient, House, Techno

% eyeD3 "04 Don't.mp3"
04 Don't.mp3                                                                                                                                        [ 8.15 MB ]
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 03:31	MPEG1, Layer III	[ 320 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ID3 v2.4:
title: Don't
artist: Batu
album: Marius EP
album artist: Batu
original release date: 2017
recording date: 2017
track: 4/4		genre: Electronic (id 52)
disc: 1/1
BPM: 0
Publisher/label: Hessle Audio
Unique File ID: [b'http://musicbrainz.org'] : 10446667-B2
Lyrics: [Description: ] [Lang: XXX]

UserTextFrame: [Description: R128_ALBUM_GAIN]
0
UserTextFrame: [Description: R128_TRACK_GAIN]
0
UserTextFrame: [Description: CATALOGNUMBER]
HES030
UserTextFrame: [Description: MusicBrainz Album Id]
10446667
UserTextFrame: [Description: MusicBrainz Artist Id]
2742670
UserTextFrame: [Description: MusicBrainz Album Type]
12", EP
UserTextFrame: [Description: MusicBrainz Album Artist Id]
2742670
UserTextFrame: [Description: MusicBrainz Album Release Country]
UK
UserTextFrame: [Description: MusicBrainz Release Group Id]
1228709
FRONT_COVER Image: [Size: 109541 bytes] [Type: image/jpeg]
Description: 

@sampsyo

sampsyo commented Jan 5, 2022

Copy link
Copy Markdown
Member

Indeed; style is a flexible attribute that currently has no associated tag mapping in MediaFile.

@snejus snejus added the discogs discogs plugin label Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discogs discogs plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

discogs: Fetch "style" field

4 participants