mirror of
https://github.com/beetbox/beets.git
synced 2025-12-30 12:32:33 +01:00
Adding styles to discogs plugin
This commit is contained in:
parent
4d55e6dfbb
commit
8fcff5ddc7
4 changed files with 14 additions and 2 deletions
|
|
@ -155,6 +155,7 @@ def apply_metadata(album_info, mapping):
|
|||
'script',
|
||||
'language',
|
||||
'country',
|
||||
'style',
|
||||
'albumstatus',
|
||||
'albumdisambig',
|
||||
'releasegroupdisambig',
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ match:
|
|||
track_index: 1.0
|
||||
track_length: 2.0
|
||||
track_id: 5.0
|
||||
style: 5.0
|
||||
preferred:
|
||||
countries: []
|
||||
media: []
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ class Item(LibModel):
|
|||
'albumartist_sort': types.STRING,
|
||||
'albumartist_credit': types.STRING,
|
||||
'genre': types.STRING,
|
||||
'style': types.STRING,
|
||||
'lyricist': types.STRING,
|
||||
'composer': types.STRING,
|
||||
'composer_sort': types.STRING,
|
||||
|
|
@ -495,7 +496,7 @@ class Item(LibModel):
|
|||
}
|
||||
|
||||
_search_fields = ('artist', 'title', 'comments',
|
||||
'album', 'albumartist', 'genre')
|
||||
'album', 'albumartist')
|
||||
|
||||
_types = {
|
||||
'data_source': types.STRING,
|
||||
|
|
@ -915,6 +916,7 @@ class Album(LibModel):
|
|||
'albumartist_credit': types.STRING,
|
||||
'album': types.STRING,
|
||||
'genre': types.STRING,
|
||||
'style': types.STRING,
|
||||
'year': types.PaddedInt(4),
|
||||
'month': types.PaddedInt(2),
|
||||
'day': types.PaddedInt(2),
|
||||
|
|
|
|||
|
|
@ -302,6 +302,13 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
mediums = [t.medium for t in tracks]
|
||||
country = result.data.get('country')
|
||||
data_url = result.data.get('uri')
|
||||
style = result.data.get('styles')
|
||||
if style is None:
|
||||
self._log.info('Style not Found')
|
||||
elif len(style) == 0:
|
||||
return style
|
||||
else:
|
||||
style = ' - '.join(sorted(style))
|
||||
|
||||
# Extract information for the optional AlbumInfo fields that are
|
||||
# contained on nested discogs fields.
|
||||
|
|
@ -339,7 +346,8 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
day=None, label=label, mediums=len(set(mediums)),
|
||||
artist_sort=None, releasegroup_id=master_id,
|
||||
catalognum=catalogno, script=None, language=None,
|
||||
country=country, albumstatus=None, media=media,
|
||||
country=country, style=style,
|
||||
albumstatus=None, media=media,
|
||||
albumdisambig=None, artist_credit=None,
|
||||
original_year=original_year, original_month=None,
|
||||
original_day=None, data_source='Discogs',
|
||||
|
|
|
|||
Loading…
Reference in a new issue