From 27f1ff704e9aeb2821ab95b7479dc05f7a4f4284 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 4 Sep 2023 20:41:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BE=AA=E7=8E=AF=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/lib/sonist/window.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr/lib/sonist/window.py b/usr/lib/sonist/window.py index e8668ab..e2f285b 100644 --- a/usr/lib/sonist/window.py +++ b/usr/lib/sonist/window.py @@ -177,17 +177,14 @@ class SonistWindow(Gtk.Window): elif btn == 'mode_btn': # repeat all if self.ctrl_box.curr_mode == 0: - self.mpd.repeat(1) self.mpd.random(0) self.mpd.single(0) # random elif self.ctrl_box.curr_mode == 1: - self.mpd.repeat(0) self.mpd.random(1) self.mpd.single(0) # single else: - self.mpd.repeat(0) self.mpd.random(0) self.mpd.single(1) @@ -262,6 +259,7 @@ class SonistWindow(Gtk.Window): # 首次启动时, 更新数据库 if first: self.mpd.update() + self.mpd.repeat(1) song_num = int(self.mpd.stats().get('songs') or 0) playlist = [it['file'] for it in self.mpd.playlistinfo()] @@ -331,7 +329,7 @@ class SonistWindow(Gtk.Window): self.timebar.update_time() self.update_album() - @idle + def update_album(self, filepath = None): self.set_background_image(filepath or image_dict['disk']) self.disk.update_album(filepath)