mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-21 20:29:27 +00:00
Bug fixes: ascii errors? NZBs.org categories
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user