Unicode changes

This commit is contained in:
Remy
2011-08-19 15:32:30 -07:00
parent b869f4a017
commit 1d362bcd5e
2 changed files with 14 additions and 10 deletions
+7 -8
View File
@@ -8,6 +8,13 @@ from headphones import db, logger, helpers, importer
def libraryScan(dir=None):
# Clean up bad filepaths
tracks = myDB.select('SELECT Location, TrackID from tracks WHERE Location IS NOT NULL')
for track in tracks:
if not os.path.isfile(track['Location']):
myDB.action('UPDATE tracks SET Location=? WHERE TrackID=?', [None, track['TrackID']])
if not dir:
dir = headphones.MUSIC_DIR
@@ -162,14 +169,6 @@ def libraryScan(dir=None):
continue
logger.info('Done checking empty filepaths')
# Clean up bad filepaths
tracks = myDB.select('SELECT Location, TrackID from tracks WHERE Location IS NOT NULL')
for track in tracks:
if not os.path.isfile(track['Location']):
myDB.action('UPDATE tracks SET Location=? WHERE TrackID=?', [None, track['TrackID']])
logger.info('Done syncing library with directory: %s' % dir)
# Clean up the new artist list