From cd78ebfec21926f231f7b5f1430d31baee4b60c4 Mon Sep 17 00:00:00 2001 From: kaliko Date: Sun, 1 Dec 2013 19:13:04 +0100 Subject: [PATCH] Avoid randomizing in album queue mode --- sima/core.py | 1 - sima/plugins/internal/lastfm.py | 2 ++ sima/utils/config.py | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sima/core.py b/sima/core.py index 87501e8..7decbb2 100644 --- a/sima/core.py +++ b/sima/core.py @@ -82,7 +82,6 @@ class Sima(Daemon): pl_callback = getattr(plugin, 'callback_need_track_fb')() if pl_callback: to_add.extend(pl_callback) - random.shuffle(to_add) for track in to_add: self.player.add(track) diff --git a/sima/plugins/internal/lastfm.py b/sima/plugins/internal/lastfm.py index b28d34e..bff015b 100644 --- a/sima/plugins/internal/lastfm.py +++ b/sima/plugins/internal/lastfm.py @@ -387,6 +387,8 @@ class Lastfm(Plugin): self.queue_mode() candidates = self.to_add self.to_add = list() + if self.plugin_conf.get('queue_mode') != 'album': + random.shuffle(candidates) return candidates def callback_player_database(self): diff --git a/sima/utils/config.py b/sima/utils/config.py index 5d62505..46bddf6 100644 --- a/sima/utils/config.py +++ b/sima/utils/config.py @@ -43,17 +43,19 @@ DEFAULT_CONF = { 'MPD': { 'host': "localhost", #'password': "", - 'port': "6600"}, + 'port': "6600", + }, 'sima': { 'internal': "Crop, History, MpdOptions, Lastfm, RandomFallBack", 'contrib': "", 'user_db': "false", 'history_duration': "8", 'queue_length': "1", - 'consume': "0",}, + }, 'daemon':{ 'daemon': "false", - 'pidfile': "",}, + 'pidfile': "", + }, 'log': { 'verbosity': "info", 'logfile': "", -- 2.39.5