mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
fix VA inference for small (1-track) albums
This commit is contained in:
parent
45383eced2
commit
951e4eec86
2 changed files with 8 additions and 1 deletions
|
|
@ -135,7 +135,8 @@ def _infer_album_fields(task):
|
|||
if task.choice_flag == action.ASIS:
|
||||
# Taking metadata "as-is". Guess whether this album is VA.
|
||||
plur_artist, freq = plurality([i.artist for i in task.items])
|
||||
if freq > 1 and float(freq) / len(task.items) >= SINGLE_ARTIST_THRESH:
|
||||
if freq == len(task.items) or (freq > 1 and
|
||||
float(freq) / len(task.items) >= SINGLE_ARTIST_THRESH):
|
||||
# Single-artist album.
|
||||
changes['albumartist'] = plur_artist
|
||||
changes['comp'] = False
|
||||
|
|
|
|||
|
|
@ -360,6 +360,12 @@ class InferAlbumDataTest(unittest.TestCase):
|
|||
self.assertEqual(self.items[0].mb_albumartistid,
|
||||
'some album artist id')
|
||||
|
||||
def test_small_single_artist_album(self):
|
||||
self.items = [self.items[0]]
|
||||
self.task.items = self.items
|
||||
self.task.set_choice(importer.action.ASIS)
|
||||
self._infer()
|
||||
self.assertFalse(self.items[0].comp)
|
||||
|
||||
class DuplicateCheckTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue