Skip to content

Commit

Permalink
Merge pull request #850 from egbertbouman/checkpoint_recovery
Browse files Browse the repository at this point in the history
Checkpoint recovery fixes
  • Loading branch information
whirm committed Sep 11, 2014
2 parents 8e91f20 + be43f5c commit de5a3ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tribler/Core/APIImplementation/LaunchManyCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def resume_download(self, filename, initialdlstatus=None, initialdlstatus_dict={
save_name = sdef.get_roothash_as_hex()
torrentfile = os.path.join(torrent_dir, save_name)

if torrentfile and os.path.isfile(torrentfile):
if torrentfile and not os.path.isfile(torrentfile):
# normal torrentfile is not present, see if readable torrent is there
save_name = get_readable_torrent_name(infohash, torrent['name'])
torrentfile = os.path.join(torrent_dir, save_name)
Expand Down
5 changes: 3 additions & 2 deletions Tribler/Core/Libtorrent/LibtorrentDownloadImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ def network_create_engine_wrapper(self, lm_network_engine_wrapper_created_callba
self.orig_files[i] = filename_new

atp["ti"] = torrentinfo
if resume_data:
has_resume_data = resume_data and isinstance(resume_data, dict)
if has_resume_data:
atp["resume_data"] = lt.bencode(resume_data)
self._logger.info("%s %s", self.tdef.get_name_as_unicode(), dict((k, v) for k, v in resume_data.iteritems() if k not in ['pieces', 'piece_priority', 'peers']) if resume_data else None)
self._logger.info("%s %s", self.tdef.get_name_as_unicode(), dict((k, v) for k, v in resume_data.iteritems() if k not in ['pieces', 'piece_priority', 'peers']) if has_resume_data else None)
else:
if self.tdef.get_url():
# We prefer to use an url, since it may contain trackers
Expand Down

0 comments on commit de5a3ad

Please sign in to comment.