X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fclient.py;h=06ba8961e8a6bcb305fbafd3912986bcd366efaa;hb=c3b27252929e22659babc142e66b0e6244f2a475;hp=0a7f754bfdb03dfeb47de52bb16647f1e0409714;hpb=2ec091faa883ec52e4e42536b1b23a672ecbc64a;p=mpd-sima.git diff --git a/sima/client.py b/sima/client.py index 0a7f754..06ba896 100644 --- a/sima/client.py +++ b/sima/client.py @@ -144,11 +144,12 @@ class PlayerClient(Player): return ans def __skipped_track(self, old_curr): + curr = self.current if (self.state == 'stop' or not hasattr(old_curr, 'id') - or not hasattr(self.current, 'id')): + or not hasattr(curr, 'id')): return False - return self.current.id != old_curr.id # pylint: disable=no-member + return curr.id != old_curr.id # pylint: disable=no-member def _flush_cache(self): """ @@ -297,7 +298,7 @@ class PlayerClient(Player): 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)) + albums.append(Album(name=album, **kwalbart)) elif album and album not in albums: self.log.debug('"{0}" probably not an album of "{1}"'.format( album, artist) + '({0})'.format('/'.join(arts)))