From 526075cd5eb4332108d557e9777aeb910672260e Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 7 Dec 2015 09:17:45 -0500 Subject: [PATCH] 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 --- lbrynet/lbrynet_daemon/LBRYDaemon.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py index cb9e6e54c..887531d65 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemon.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py @@ -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):