From: kaliko Date: Sun, 2 Feb 2014 14:41:01 +0000 (+0100) Subject: Avoid unnecessary method call X-Git-Tag: mpd-sima/0.12.0pr3~16 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=47ec78a3de8e2280849ec3ab70df3371514bf0ac;p=mpd-sima.git Avoid unnecessary method call Call get_recursive_similar_artist() when useful --- diff --git a/sima/plugins/internal/lastfm.py b/sima/plugins/internal/lastfm.py index f8672d6..28bb3a4 100644 --- a/sima/plugins/internal/lastfm.py +++ b/sima/plugins/internal/lastfm.py @@ -235,7 +235,8 @@ class Lastfm(Plugin): ret = self.get_artists_from_player(similar) ret_extra = None if len(self.history) >= 2: - ret_extra = self.get_recursive_similar_artist() + if self.plugin_conf.getint('depth') > 1: + ret_extra = self.get_recursive_similar_artist() if ret_extra: ret = list(set(ret) | set(ret_extra)) if not ret: