diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html
index 29bf848d..0cffeb5d 100644
--- a/data/interfaces/default/config.html
+++ b/data/interfaces/default/config.html
@@ -261,7 +261,7 @@
Re-Encoding Options:
Convert Lossless to mp3
- Note: this option requires the lame or ffdshow encoder
+ Note: this option requires the lame or ffmpeg encoder
<%
if config['encoder'] == 'lame':
diff --git a/headphones/__init__.py b/headphones/__init__.py
index 6d33b038..b31968bd 100644
--- a/headphones/__init__.py
+++ b/headphones/__init__.py
@@ -77,7 +77,7 @@ USENET_RETENTION = None
INCLUDE_EXTRAS = False
NZB_SEARCH_INTERVAL = 360
-LIBRARYSCAN_INTERVAL = 60
+LIBRARYSCAN_INTERVAL = 300
DOWNLOAD_SCAN_INTERVAL = 5
SAB_HOST = None
@@ -224,7 +224,7 @@ def initialize():
INCLUDE_EXTRAS = bool(check_setting_int(CFG, 'General', 'include_extras', 0))
NZB_SEARCH_INTERVAL = check_setting_int(CFG, 'General', 'nzb_search_interval', 360)
- LIBRARYSCAN_INTERVAL = check_setting_int(CFG, 'General', 'libraryscan_interval', 180)
+ LIBRARYSCAN_INTERVAL = check_setting_int(CFG, 'General', 'libraryscan_interval', 300)
DOWNLOAD_SCAN_INTERVAL = check_setting_int(CFG, 'General', 'download_scan_interval', 5)
SAB_HOST = check_setting_str(CFG, 'SABnzbd', 'sab_host', '')
diff --git a/headphones/librarysync.py b/headphones/librarysync.py
index cbcd9d1d..9a4bdaf6 100644
--- a/headphones/librarysync.py
+++ b/headphones/librarysync.py
@@ -22,14 +22,13 @@ def libraryScan(dir=None):
bitrates = []
myDB = db.DBConnection()
+ myDB.action('DELETE from have')
for r,d,f in os.walk(dir):
for files in f:
# MEDIA_FORMATS = music file extensions, e.g. mp3, flac, etc
if any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS):
-
- file = unicode(os.path.join(r, files), "utf-8")
-
+ file = os.path.join(r, files).decode('utf-8')
# Try to read the metadata
try:
f = MediaFile(file)
@@ -75,21 +74,8 @@ def libraryScan(dir=None):
new_artists.append(f_artist)
# The have table will become the new database for unmatched tracks (i.e. tracks with no associated links in the database
- controlValueDict = {"Location": file}
- newValueDict = {"ArtistName": f_artist,
- "AlbumTitle": f.album,
- "TrackNumber": f.track,
- "TrackTitle": f.title,
- "TrackLength": f.length,
- "BitRate": f.bitrate,
- "Genre": f.genre,
- "Date": f.date,
- "TrackID": f.mb_trackid,
- "CleanName": helpers.cleanName(f_artist+' '+f.album+' '+f.title)
- }
-
- myDB.upsert("have", newValueDict, controlValueDict)
-
+ myDB.action('INSERT INTO have VALUES( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [f_artist, f.album, f.track, f.title, f.length, f.bitrate, f.genre, f.date, f.mb_trackid, file, helpers.cleanName(f_artist+' '+f.album+' '+f.title)])
+
# Now check empty file paths to see if we can find a match based on their folder format
tracks = myDB.select('SELECT * from tracks WHERE Location IS NULL')
for track in tracks: