Fix get_downloads function

get_downloads would throw an error when it tried to open a file that
had already been downloaded, now it just ignores these duplicates
This commit is contained in:
Jack 2015-12-07 09:17:45 -05:00
parent 441d3c1220
commit 526075cd5e

View file

@ -242,9 +242,15 @@ class LBRYDaemon(xmlrpc.XMLRPC):
Get downloads
"""
downloads = [{'stream_hash': stream.stream_hash,
'path': os.path.join(stream.downloader.download_directory, stream.downloader.file_name)}
for stream in self.download_deferreds]
downloads = []
for stream in self.download_deferreds:
try:
downloads.append({'stream_hash': stream.stream_hash,
'path': os.path.join(stream.downloader.download_directory, stream.downloader.file_name)})
except:
pass
return downloads
def xmlrpc_download_name(self, name):