Merge branch 'master' into develop

This commit is contained in:
Adam 2015-05-25 11:06:09 +08:00
commit 821e38adf7
3 changed files with 10 additions and 9 deletions

View file

@ -9,6 +9,11 @@
* Change to consolidate cache database migration code
### 0.9.1 (2015-05-25 03:03:00 UTC)
* Fix erroneous multiple downloads of torrent files which causes snatches to fail under certain conditions
### 0.9.0 (2015-05-18 14:33:00 UTC)
* Update Tornado webserver to 4.2.dev1 (609dbb9)

View file

@ -151,7 +151,6 @@ class GenericClient(object):
if len(result.hash) == 32:
result.hash = b16encode(b32decode(result.hash)).lower()
else:
result.content = result.provider.getURL(result.url)
info = bdecode(result.content)['info']
result.hash = sha1(bencode(info)).hexdigest()
@ -171,7 +170,6 @@ class GenericClient(object):
# Sets per provider seed ratio
result.ratio = result.provider.seedRatio()
# lazy fix for now, I'm sure we already do this somewhere else too
result = self._get_torrent_hash(result)
if result.url.startswith('magnet'):

View file

@ -133,13 +133,11 @@ def snatchEpisode(result, endStatus=SNATCHED):
dlResult = _downloadResult(result)
else:
# make sure we have the torrent file content
if not result.content:
if not result.url.startswith('magnet'):
result.content = result.provider.getURL(result.url)
if not result.content:
logger.log(
u"Torrent content failed to download from " + result.url, logger.ERROR
)
if not result.content and not result.url.startswith('magnet'):
result.content = result.provider.getURL(result.url)
if not result.content:
logger.log(u'Torrent content failed to download from ' + result.url, logger.ERROR)
return False
# Snatches torrent with client
client = clients.getClientIstance(sickbeard.TORRENT_METHOD)()
dlResult = client.sendTORRENT(result)