ehh unicode bug fixes, changed libraryscan interval to 5 hours

This commit is contained in:
Remy
2011-08-17 02:08:26 -07:00
parent 59a07ce49e
commit 882e01a8d2
3 changed files with 7 additions and 21 deletions

View File

@@ -261,7 +261,7 @@
<h2>Re-Encoding Options:</h2>
<br>
<h3><input type="checkbox" name="encode" value="1" ${config['encode']}/>Convert Lossless to mp3</h3>
<i class="smalltext">Note: this option requires the lame or ffdshow encoder</i>
<i class="smalltext">Note: this option requires the lame or ffmpeg encoder</i>
<br><br>
<%
if config['encoder'] == 'lame':

View File

@@ -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', '')

View File

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