From 7a910ce647cc646dc7ca8adbc69e1f0e725761fc Mon Sep 17 00:00:00 2001 From: kaliko Date: Sun, 16 Feb 2014 01:24:27 +0100 Subject: [PATCH] Add "Various Artist" filter in albums search --- sima/client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sima/client.py b/sima/client.py index ff6ca38..2892d5e 100644 --- a/sima/client.py +++ b/sima/client.py @@ -241,8 +241,13 @@ class PlayerClient(Player): if album not in albums: albums.append(Album(name=album, **kwalbart)) for album in self.list('album', 'artist', artist): - arts = set([trk.artist for trk in self.find('album', album)]) - if len(arts) < 2: # TODO: better heuristic, use a ratio instead + album_trks = [trk for trk in self.find('album', album)] + # TODO: add a VA filter option + if 'Various Artists' in [tr.albumartist for tr in album_trks]: + self.log.debug('Discarding {0} ("Various Artists" set)'.format(album)) + continue + arts = set([trk.artist for trk in album_trks]) + if len(set(arts)) < 2: # TODO: better heuristic, use a ratio instead if album not in albums: albums.append(Album(name=album, albumartist=artist)) elif (album and album not in albums): -- 2.39.5