mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 04:23:56 +01:00
Allow missing fields in %aunique (#1775)
This commit is contained in:
parent
b25b4db9e1
commit
ed9b5ef9cb
2 changed files with 4 additions and 2 deletions
|
|
@ -1421,7 +1421,7 @@ class DefaultTemplateFunctions(object):
|
|||
# Find matching albums to disambiguate with.
|
||||
subqueries = []
|
||||
for key in keys:
|
||||
value = getattr(album, key)
|
||||
value = album.get(key, '')
|
||||
subqueries.append(dbcore.MatchQuery(key, value))
|
||||
albums = self.lib.albums(dbcore.AndQuery(subqueries))
|
||||
|
||||
|
|
@ -1434,7 +1434,7 @@ class DefaultTemplateFunctions(object):
|
|||
# Find the first disambiguator that distinguishes the albums.
|
||||
for disambiguator in disam:
|
||||
# Get the value for each album for the current field.
|
||||
disam_values = set([getattr(a, disambiguator) for a in albums])
|
||||
disam_values = set([a.get(disambiguator, '') for a in albums])
|
||||
|
||||
# If the set of unique values is equal to the number of
|
||||
# albums in the disambiguation set, we're done -- this is
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ Fixes:
|
|||
did. :bug:`1657`
|
||||
* :doc:`/plugins/scrub`: Also in ``auto`` mode, album art is now correctly
|
||||
restored. :bug:`1657`
|
||||
* Possibly allow flexible attributes to be used with the ``%aunique`` template
|
||||
function. :bug:`1775`
|
||||
|
||||
.. _Emby Server: http://emby.media
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue