Skip to content

Commit

Permalink
Merge pull request #3389 from devos50/next_to_devel
Browse files Browse the repository at this point in the history
 Next to devel
  • Loading branch information
xoriole authored Jan 24, 2018
2 parents b089468 + 8aac81f commit af35a1f
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 521 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ Submodule notes
:target: https://github.com/Tribler/tribler/releases
:alt: Downloads(6.5.2)

.. |downloads_7_0| image:: https://img.shields.io/github/downloads/tribler/tribler/v7.0.0-rc3/total.svg?style=flat
.. |downloads_7_0| image:: https://img.shields.io/github/downloads/tribler/tribler/v7.0.0-rc5/total.svg?style=flat
:target: https://github.com/Tribler/tribler/releases
:alt: Downloads(7.0.0-rc3)
:alt: Downloads(7.0.0-rc5)

.. |contributors| image:: https://img.shields.io/github/contributors/tribler/tribler.svg?style=flat
:target: https://github.com/Tribler/tribler/graphs/contributors
Expand Down
9 changes: 8 additions & 1 deletion Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,14 @@ def on_metadata_received_alert(self, alert):
metadata["announce"] = trackers[0]

self.tdef = TorrentDef.load_from_dict(metadata)
self.orig_files = [torrent_file.path.decode('utf-8') for torrent_file in lt.torrent_info(metadata).files()]

try:
torrent_files = lt.torrent_info(metadata).files()
except RuntimeError:
self._logger.warning("Torrent contains no files!")
torrent_files = []

self.orig_files = [torrent_file.path.decode('utf-8') for torrent_file in torrent_files]
self.set_corrected_infoname()
self.set_filepieceranges()
self.set_selected_files()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,14 @@ def test_on_metadata_received_alert(self):
def mocked_checkpoint():
test_deferred.callback(None)

mocked_file = MockObject()
mocked_file.path = 'test'

self.libtorrent_download_impl.handle.trackers = lambda: []
self.libtorrent_download_impl.handle.save_resume_data = lambda: None
torrent_dict = {'name': 'test', 'piece length': 42, 'pieces': '', 'files': []}
get_info_from_handle(self.libtorrent_download_impl.handle).metadata = lambda: lt.bencode(torrent_dict)
get_info_from_handle(self.libtorrent_download_impl.handle).files = lambda: []
get_info_from_handle(self.libtorrent_download_impl.handle).files = lambda: [mocked_file]

self.libtorrent_download_impl.checkpoint = mocked_checkpoint
self.libtorrent_download_impl.session = MockObject()
Expand Down
163 changes: 0 additions & 163 deletions Tribler/Test/btconn.py

This file was deleted.

Loading

0 comments on commit af35a1f

Please sign in to comment.