mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +00:00
[Core] Write torrent file with full magnet metainfo
The use of torrent_info.metadata misses saves trackers and other torrent metainfo fields so use lt.create_torrent generate method to create this data.
This commit is contained in:
parent
cbcf8eb863
commit
6a5bb44d5b
@ -1295,9 +1295,9 @@ class Torrent(object):
|
|||||||
filepath = os.path.join(get_config_dir(), 'state', self.torrent_id + '.torrent')
|
filepath = os.path.join(get_config_dir(), 'state', self.torrent_id + '.torrent')
|
||||||
|
|
||||||
if filedump is None:
|
if filedump is None:
|
||||||
metadata = lt.bdecode(self.torrent_info.metadata())
|
lt_ct = lt.create_torrent(self.torrent_info)
|
||||||
torrent_file = {b'info': metadata}
|
filedump = lt.bencode(lt_ct.generate())
|
||||||
filedump = lt.bencode(torrent_file)
|
|
||||||
write_file(filepath, filedump)
|
write_file(filepath, filedump)
|
||||||
|
|
||||||
# If the user has requested a copy of the torrent be saved elsewhere we need to do that.
|
# If the user has requested a copy of the torrent be saved elsewhere we need to do that.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user