mirror of
https://github.com/beetbox/beets.git
synced 2026-02-24 16:23:04 +01:00
use equality for media comparisons again
This commit is contained in:
parent
fa40fd9108
commit
1eb588f743
1 changed files with 10 additions and 8 deletions
|
|
@ -419,14 +419,16 @@ def distance(items, album_info, mapping):
|
|||
# Album.
|
||||
dist.add_string('album', likelies['album'], album_info.album)
|
||||
|
||||
# Preferred media.
|
||||
patterns = config['match']['preferred']['media'].as_str_seq()
|
||||
options = [re.compile(r'(\d+x)?(%s)' % pat, re.I) for pat in patterns]
|
||||
if album_info.media and options:
|
||||
dist.add_priority('media', album_info.media, options)
|
||||
# Media.
|
||||
elif likelies['media'] and album_info.media:
|
||||
dist.add_string('media', likelies['media'], album_info.media)
|
||||
# Current or preferred media.
|
||||
if album_info.media:
|
||||
# Preferred media options.
|
||||
patterns = config['match']['preferred']['media'].as_str_seq()
|
||||
options = [re.compile(r'(\d+x)?(%s)' % pat, re.I) for pat in patterns]
|
||||
if options:
|
||||
dist.add_priority('media', album_info.media, options)
|
||||
# Current media.
|
||||
elif likelies['media']:
|
||||
dist.add_equality('media', album_info.media, likelies['media'])
|
||||
|
||||
# Mediums.
|
||||
if likelies['disctotal'] and album_info.mediums:
|
||||
|
|
|
|||
Loading…
Reference in a new issue