Fix for #2271: Scanning an empty directory with DETECT_BITRATE turned on

This commit is contained in:
rembo10
2015-07-08 21:58:41 -07:00
parent 464db79c04
commit 0ebba8d17c

View File

@@ -334,7 +334,7 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None,
for artist in artist_list:
myDB.action('INSERT OR IGNORE INTO newartists VALUES (?)', [artist])
if headphones.CONFIG.DETECT_BITRATE:
if headphones.CONFIG.DETECT_BITRATE and bitrates:
headphones.CONFIG.PREFERRED_BITRATE = sum(bitrates) / len(bitrates) / 1000
else: