Open superbonaci opened 1 year ago
Issues affected by this feature request:
@stalkerok I don't think that issue is related to this.
@superbonaci, it also mentions the problem of exporting torrent files with the same name.
So the new feature "export .torrent files" doesn't work because duplicate names can't be exported.
It will also be useful to read the whole topic.
Anyway, I consider these issues are related, as the client has a torrent file export feature, but it doesn't work properly and users resort to using the BT_backup folder.
Suggestion
qBittorrent allows to change names for torrents, which may not be within the character set allowed by the filesystem. Users can manually change the torrent name, or such can be provided by a magnet link. No idea if .torrent files can do this.
The issue occurs when exporting one or more torrents, because qBittorrent uses the torrent's name as filename for the torrent file, without checking first if the filesystem supports that or not. And several filesystems can impose different restrictions.
When exporting as magnet link, it takes the name from inside the torrent file instead of torrent's title, so may have the same issue or not.
So I propose a default naming scheme when exporting .torrent files:
info Hash version
-info Hash value
-torrent name as provided by user in URL Encoding format
.extension
This will make it work in all operating systems.Of course a new entry in Preferences/Settings could be added to change this default: Exporting format (no spaces at all by default):
%v
: info Hash version%h
: info Hash value (hex lowercase)%H
: info Hash value (hex uppercase)%n
: torrent name as displayed in top window "as is"%U
: torrent name as displayed in top window "URL encoded" uppercase (default) to avoid issues%u
: torrent name as displayed in top window "URL encoded" lowercase to avoid issues%N
: torrent name as provided by .torrent file (Name displayed in bottom window), where the file list is. This would only work if there's a top folder in the torrent, if not this parameter can't be used. This should have been sanitized upon torrent creation. This value can be renamed also.%m
: same as%N
but the current value and not the one defined in the .torrent. If the user didn't modified this, %m and %N should match.%e
:torrent
extension%E
:TORRENT
extensionSet export names for torrents (default):
Or set by user adding custom strings:
Use case
Name as is now:
%U
formatted:%v-%H-%U.%e
formatted (default):When importing/opening torrents this would also restore the custom torrent name, which does not happen now.
Extra info/examples/attachments
Export .torrent...
error: