Bug fixes: ascii errors? NZBs.org categories

This commit is contained in:
Remy
2011-07-20 21:57:30 -07:00
parent 0596de1d38
commit cd2fa841dc
3 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
from lib.pyItunes import *
from lib.configobj import ConfigObj
import time
import os
from lib.beets.mediafile import MediaFile
@@ -14,6 +13,9 @@ def scanMusic(dir=None):
if not dir:
dir = headphones.MUSIC_DIR
if type(dir) != unicode:
dir = unicode(dir)
results = []
for r,d,f in os.walk(dir):

View File

@@ -127,11 +127,11 @@ def searchNZB(albumid=None, new=False):
if headphones.NZBSORG:
if headphones.PREFERRED_QUALITY == 3:
categories = "3010"
categories = "5"
maxsize = 10000000000
term = altterm
elif headphones.PREFERRED_QUALITY:
categories = "5,3010"
categories = "5"
maxsize = 2000000000
else:
categories = "5"
@@ -191,8 +191,8 @@ def searchNZB(albumid=None, new=False):
try:
albumlength = sum([pair[0] for pair in tracks])
targetsize = albumlength/1000 * headphones.PREFERRED_BITRATE * 128
lgger.debug('Album length = %s' % albumlength)
targetsize = albumlength/1000 * int(headphones.PREFERRED_BITRATE) * 128
logger.info('Target size: %s' % helpers.bytes_to_mb(targetsize))
newlist = []

View File

@@ -292,7 +292,7 @@ class WebInterface(object):
myDB.upsert("albums", newValueDict, controlValueDict)
import searcher
threading.Thread(target=searcher.searchNZB, args=[AlbumID, new]).start()
searcher.searchNZB(AlbumID, new)
raise cherrypy.HTTPRedirect("artistPage?ArtistID=%s" % ArtistID)