From 7de27275725b5a96fa6b9f0ccdcaa7110c53ca49 Mon Sep 17 00:00:00 2001 From: Dang Mai Date: Thu, 31 Jan 2013 16:41:12 -0500 Subject: [PATCH] Fix smartplaylist to use lib param from cli_exit --- beetsplug/smartplaylist.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/beetsplug/smartplaylist.py b/beetsplug/smartplaylist.py index d20211272..2887fcb6e 100644 --- a/beetsplug/smartplaylist.py +++ b/beetsplug/smartplaylist.py @@ -22,10 +22,9 @@ from beets.util import normpath, syspath from beets.util.functemplate import Template import os -# Global variables so that smartplaylist can detect database changes and run +# Global variable so that smartplaylist can detect database changes and run # only once before beets exits. database_changed = False -library = None def update_playlists(lib): @@ -79,13 +78,11 @@ class SmartPlaylistPlugin(BeetsPlugin): @SmartPlaylistPlugin.listen('database_change') def handle_change(lib): - global library global database_changed - library = lib database_changed = True @SmartPlaylistPlugin.listen('cli_exit') -def update(): +def update(lib): if database_changed: - update_playlists(library) + update_playlists(lib)