diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a04bbc5b..e06db5d1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ at anytime. * fix recursion depth error upon failed blob * call stopProducing in reflector client file_sender when uploading is done * ensure streams in stream_info_manager are saved in lbry_file_manager + * [#470](https://github.com/lbryio/lbry/issues/470) ## [0.8.1] - 2017-02-01 ### Changed diff --git a/lbrynet/lbryfilemanager/EncryptedFileManager.py b/lbrynet/lbryfilemanager/EncryptedFileManager.py index cfb4b679a..7bf21c769 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileManager.py +++ b/lbrynet/lbryfilemanager/EncryptedFileManager.py @@ -281,8 +281,10 @@ class EncryptedFileManager(object): @rerun_if_locked def _get_count_for_stream_hash(self, stream_hash): - return self.sql_db.runQuery("select count(*) from lbry_file_options where stream_hash = ?", + d = self.sql_db.runQuery("select count(*) from lbry_file_options where stream_hash = ?", (stream_hash,)) + d.addCallback(lambda r: (r[0][0] if r else 0)) + return d @rerun_if_locked def _get_rowid_for_stream_hash(self, stream_hash):