artwork fix

fixes #2898
This commit is contained in:
Ade
2017-04-04 22:28:26 +12:00
parent de15f6b632
commit 2841f36d8d
3 changed files with 14 additions and 6 deletions

View File

@@ -132,7 +132,11 @@ def get_image_data(bites):
def getartwork(artwork_path):
artwork = bytes()
minwidth = 0
maxwidth = 0
if headphones.CONFIG.ALBUM_ART_MIN_WIDTH:
minwidth = int(headphones.CONFIG.ALBUM_ART_MIN_WIDTH)
if headphones.CONFIG.ALBUM_ART_MAX_WIDTH:
maxwidth = int(headphones.CONFIG.ALBUM_ART_MAX_WIDTH)
resp = request.request_response(artwork_path, timeout=20, stream=True, whitelist_status_code=404)

View File

@@ -233,8 +233,12 @@ class Rutracker(object):
# self.session.auth = HTTPDigestAuth(headphones.CONFIG.QBITTORRENT_USERNAME, headphones.CONFIG.QBITTORRENT_PASSWORD)
url = base_url + '/login'
r = self.session.post(url, data={'username': headphones.CONFIG.QBITTORRENT_USERNAME,
try:
self.session.post(url, data={'username': headphones.CONFIG.QBITTORRENT_USERNAME,
'password': headphones.CONFIG.QBITTORRENT_PASSWORD})
except Exception as e:
logger.exception('Error adding file to qbittorrent %s', e)
return
url = base_url + '/command/upload'