Fix resume-data code to be able to use multi-file torrents.
parent
3de1a28a97
commit
f4c76b1ebf
|
@ -491,6 +491,7 @@ class Libtorrent:
|
|||
self.session.stop_dht()
|
||||
|
||||
def resume_data(self):
|
||||
wasPaused=self.session.is_paused()
|
||||
self.session.pause()
|
||||
self.save_resume_data=None
|
||||
|
||||
|
@ -504,7 +505,7 @@ class Libtorrent:
|
|||
return
|
||||
|
||||
log('[save_resume_data]: waiting for alert...')
|
||||
self.torrentHandle.save_resume_data()
|
||||
self.torrentHandle.save_resume_data(self.lt.save_resume_flags_t.flush_disk_cache)
|
||||
received=False
|
||||
while not received:
|
||||
self.session.wait_for_alert(1000)
|
||||
|
@ -528,6 +529,7 @@ class Libtorrent:
|
|||
log('[save_resume_data]: done.')
|
||||
|
||||
finally:
|
||||
if not wasPaused:
|
||||
self.session.resume()
|
||||
|
||||
def debug(self):
|
||||
|
|
|
@ -289,7 +289,7 @@ class TorrentPlayer(xbmc.Player):
|
|||
#self.torrent.torrentHandle.flush_cache()
|
||||
#self.torrent.session.remove_torrent(self.torrent.torrentHandle)
|
||||
self.torrent.resume_data()
|
||||
self.torrent.session.remove_torrent(self.torrent.torrentHandle)
|
||||
#self.torrent.session.remove_torrent(self.torrent.torrentHandle)
|
||||
progressBar.update(0)
|
||||
progressBar.close()
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue