qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
26.96k stars 3.88k forks source link

Change default naming format when exporting torrents #19380

Open superbonaci opened 1 year ago

superbonaci commented 1 year ago

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):

Set export names for torrents (default):

%v-%H-%U.%e

Or set by user adding custom strings:

(backups)_%u.torrentfile

qBittorrent-bug-19380

Use case

Name as is now:

Free music *BEST* "workout" ¯\_(ツ)_/¯ dance

%U formatted:

Free+music+%2ABEST%2A+%22workout%22+%C2%AF%5C_%28%E3%83%84%29_%2F%C2%AF+dance

%v-%H-%U.%e formatted (default):

v1-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD-Free+music+%2ABEST%2A+%22workout%22+%C2%AF%5C_%28%E3%83%84%29_%2F%C2%AF+dance.torrent

When importing/opening torrents this would also restore the custom torrent name, which does not happen now.

Extra info/examples/attachments

Export .torrent... error:

LOG:
7/10/2023 10:28 PM - Export .torrent file failed. Torrent: "[abc / music] rock". Save path: "G:\[abc \ music] rock.torrent". Reason: "The system cannot find the path specified."
7/10/2023 10:28 PM - Export .torrent file failed. Torrent: "Cooking Season 1: 6". Save path: "G:\Cooking Season 1: 6.torrent". Reason: "QSaveFile cannot open 'G:\Cooking Season 1: 6.torrent' without direct write fallback enabled."
superbonaci commented 1 year ago

Issues affected by this feature request:

stalkerok commented 1 year ago
superbonaci commented 1 year ago

@stalkerok I don't think that issue is related to this.

stalkerok commented 1 year ago

@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.

stalkerok commented 1 year ago

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.