mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 21:14:55 +00:00
[Core] Fix renaming folder not updating torrent name
The new get_name method needs to function as it did in 1.3-stable so when renaming a torrent file or top-level folder update torrent name to reflect that. If UI supports renaming the torrent then the options value with be used instead.
This commit is contained in:
parent
0e69b9199c
commit
dcb3dad435
@ -933,7 +933,16 @@ class Torrent(object):
|
||||
|
||||
"""
|
||||
if not self.options['name']:
|
||||
handle_name = self.handle.name()
|
||||
# Use the top-level folder as torrent name.
|
||||
if self.has_metadata:
|
||||
handle_name = (
|
||||
self.torrent_info.file_at(0)
|
||||
.path.replace('\\', '/', 1)
|
||||
.split('/', 1)[0]
|
||||
)
|
||||
else:
|
||||
handle_name = self.handle.name()
|
||||
|
||||
if handle_name:
|
||||
name = decode_bytes(handle_name)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user