diff --git a/lbry/extras/daemon/storage.py b/lbry/extras/daemon/storage.py index a36f7e969..65e7cfcd1 100644 --- a/lbry/extras/daemon/storage.py +++ b/lbry/extras/daemon/storage.py @@ -638,7 +638,8 @@ class SQLiteStorage(SQLiteMixin): async def get_all_torrent_files(self) -> typing.List[typing.Dict]: def _get_all_torrent_files(transaction): - cursor = transaction.execute("select * from file join torrent on file.bt_infohash=torrent.bt_infohash") + cursor = transaction.execute( + "select file.ROWID as rowid, * from file join torrent on file.bt_infohash=torrent.bt_infohash") return map(lambda row: dict(zip(list(map(itemgetter(0), cursor.description)), row)), cursor.fetchall()) return list(await self.db.run(_get_all_torrent_files)) diff --git a/lbry/torrent/torrent_manager.py b/lbry/torrent/torrent_manager.py index ce873b07c..a6e9c8941 100644 --- a/lbry/torrent/torrent_manager.py +++ b/lbry/torrent/torrent_manager.py @@ -183,7 +183,7 @@ class TorrentManager(SourceManager): claim = await self.storage.get_content_claim_for_torrent(file['bt_infohash']) file['download_directory'] = bytes.fromhex(file['download_directory'] or '').decode() or None file['file_name'] = bytes.fromhex(file['file_name'] or '').decode() or None - await self._load_stream(None, claim=claim, **file) + await self._load_stream(claim=claim, **file) async def start(self): await super().start()