Commits

Anonymous committed c1ff5b1

Fix smartplaylist to use lib param from cli_exit

  • Participants
  • Parent commits 7a2b3bb

Comments (0)

Files changed (1)

File beetsplug/smartplaylist.py

 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):
 
 @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)