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

#2579 Adding styles to discogs plugin #3251

Merged
merged 16 commits into from
Jun 10, 2019

Conversation

thedevilisinthedetails
Copy link

@thedevilisinthedetails thedevilisinthedetails commented May 5, 2019

Adding styles to discogs plugin. Closes #2579.

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

@sampsyo sampsyo left a comment

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!

beetsplug/discogs.py Outdated Show resolved Hide resolved
beetsplug/discogs.py Outdated Show resolved Hide resolved
beets/config_default.yaml Outdated Show resolved Hide resolved
Copy link
Member

@sampsyo sampsyo left a comment

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.

beetsplug/discogs.py Outdated Show resolved Hide resolved
beetsplug/discogs.py Outdated Show resolved Hide resolved
beetsplug/discogs.py Outdated Show resolved Hide resolved
test/test_discogs.py Outdated Show resolved Hide resolved
test/test_discogs.py Outdated Show resolved Hide resolved
@@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py27-test, py37-test, py38-test, py27-flake8, docs
envlist = py27-test, py37-test, py27-flake8, docs
Copy link
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.

if style is None:
self._log.debug('Style not Found')
elif not style:
return style
Copy link
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.

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
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.

Choose a reason for hiding this comment

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

👍 fixed

@sampsyo
Copy link
Member

sampsyo commented Jun 10, 2019

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
@thunderousleader10
Copy link

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

@jordanbs
Copy link

jordanbs commented Jan 5, 2022

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
Copy link
Member

sampsyo commented Jan 5, 2022

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

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

Successfully merging this pull request may close these issues.

discogs: Fetch "style" field
4 participants