From 275a6c2e041cf20059a0306738eee02c821b67d4 Mon Sep 17 00:00:00 2001 From: Remy Date: Fri, 19 Aug 2011 23:43:58 -0700 Subject: [PATCH] Fixed db referenced before assignment in library scan --- headphones/librarysync.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/headphones/librarysync.py b/headphones/librarysync.py index b63e340f..208d2b26 100644 --- a/headphones/librarysync.py +++ b/headphones/librarysync.py @@ -8,6 +8,8 @@ from headphones import db, logger, helpers, importer def libraryScan(dir=None): + myDB = db.DBConnection() + # Clean up bad filepaths tracks = myDB.select('SELECT Location, TrackID from tracks WHERE Location IS NOT NULL') @@ -27,8 +29,7 @@ def libraryScan(dir=None): new_artists = [] bitrates = [] - - myDB = db.DBConnection() + myDB.action('DELETE from have') for r,d,f in os.walk(dir):