remove resume_data
parent
0c67567a6f
commit
82dab260c8
|
@ -45,7 +45,6 @@ class Libtorrent:
|
||||||
downloadThread = None
|
downloadThread = None
|
||||||
threadComplete = False
|
threadComplete = False
|
||||||
lt = None
|
lt = None
|
||||||
save_resume_data = None
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
print '!!!!!!!!!!!!!!!!!! DIED !!! '+self.__class__.__name__
|
print '!!!!!!!!!!!!!!!!!! DIED !!! '+self.__class__.__name__
|
||||||
|
@ -420,9 +419,6 @@ class Libtorrent:
|
||||||
#'auto_managed': False,
|
#'auto_managed': False,
|
||||||
#'duplicate_is_error': True
|
#'duplicate_is_error': True
|
||||||
}
|
}
|
||||||
if self.save_resume_data:
|
|
||||||
log('loading resume data')
|
|
||||||
torrent_info['resume_data']=self.save_resume_data
|
|
||||||
self.torrentHandle = self.session.add_torrent(torrent_info)
|
self.torrentHandle = self.session.add_torrent(torrent_info)
|
||||||
|
|
||||||
self.torrentHandle.set_sequential_download(True)
|
self.torrentHandle.set_sequential_download(True)
|
||||||
|
@ -479,19 +475,6 @@ class Libtorrent:
|
||||||
self.session.stop_lsd()
|
self.session.stop_lsd()
|
||||||
self.session.stop_dht()
|
self.session.stop_dht()
|
||||||
|
|
||||||
def resume_data(self):
|
|
||||||
self.torrentHandle.save_resume_data()
|
|
||||||
received=False
|
|
||||||
while not received:
|
|
||||||
self.session.wait_for_alert(1000)
|
|
||||||
a = self.session.pop_alert()
|
|
||||||
log('[save_resume_data]: ['+str(type(a))+'] the alert '+str(a)+' is received')
|
|
||||||
if type(a) == self.lt.save_resume_data_alert:
|
|
||||||
received = True
|
|
||||||
debug('[save_resume_data]: '+str(dir(a)))
|
|
||||||
self.save_resume_data=self.lt.bencode(a.resume_data)
|
|
||||||
log('[save_resume_data]: the torrent resume data are saved')
|
|
||||||
|
|
||||||
def debug(self):
|
def debug(self):
|
||||||
try:
|
try:
|
||||||
# print str(self.getFilePath(0))
|
# print str(self.getFilePath(0))
|
||||||
|
|
Loading…
Reference in New Issue