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,8 +132,12 @@ def get_image_data(bites):
def getartwork(artwork_path):
artwork = bytes()
minwidth = int(headphones.CONFIG.ALBUM_ART_MIN_WIDTH)
maxwidth = int(headphones.CONFIG.ALBUM_ART_MAX_WIDTH)
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

@@ -68,7 +68,7 @@ def checkFolder():
if os.path.exists(album_path):
logger.info('Found "' + folder_name + '" in ' + album[
'Kind'] + ' download folder. Verifying....')
verify(album['AlbumID'], album_path, album['Kind'],single=single)
verify(album['AlbumID'], album_path, album['Kind'], single=single)
else:
logger.info("No folder name found for " + album['Title'])

View File

@@ -6,7 +6,7 @@ from urlparse import urlparse
import re
import requests as requests
#from requests.auth import HTTPDigestAuth
# from requests.auth import HTTPDigestAuth
from bs4 import BeautifulSoup
import headphones
@@ -230,11 +230,15 @@ class Rutracker(object):
host = host[:-4]
base_url = host
#self.session.auth = HTTPDigestAuth(headphones.CONFIG.QBITTORRENT_USERNAME, headphones.CONFIG.QBITTORRENT_PASSWORD)
# 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'