I've made some changes that fixes a few serious annoyances I have when using the GTKUI client with a remote daemon.
- Changed "Move completed" dialog to use a ComboBox. This is a ComboBox are loaded with previously saved paths.
Then I don't have to type in the same paths over and over again. - Made the "Moved completed" text field in the Options pane of each torrent expand when the window is resized. The default width is too small.
- Added "Move completed to" option in the "Add Torrent" dialog. This is a ComboBox which uses the same saved paths as in the "Move Completed" dialog.
- Added right click popup menu in the torrent list with the button "Copy title to clipboard". Sometimes the filenames do not correspond to the title at all, and it's a hassle to go find the title somewhere else and copy/paste to give the files a proper name.
- Added right click popup menu in the files list with two options that greatly eases the work to add torrents.
- Normalize filename
- Place all items in a root directory.
This is function which basically runs a series of regex replaces on the title. I prefer to not have any spaces in the filenames, so I have the following regexes:
It would be easy to have a few different configurations with different regexes, and also have the user provide a custom config.Code: Select all
import re filename = re.sub(" - ", "-", filename) # For sound e.g. 7.1, to replace with "-7.1-" to avoid ".7.1." filename = re.sub(" (\d)\.(\d) ", "-\g<1>.\g<2>-", filename) # If last in name filename = re.sub(" (\d)\.(\d)", "-\g<1>.\g<2>", filename) # For punctuation with a following space, e.g. when punctuation is in the title. filename = re.sub("\. ", ".-", filename) # Replace all spaces with punctuation filename = re.sub(" ", ".", filename)
Place all items in a root directory
I prefer having all torrents in one root directory. Many torrents have multiple files, and some have simply one file.
This function creates a root directory with the name of the currently selected file (subtracted the extension) and places all the files in this directory (keeping the original tree structure). - Also fixed a bug (or is it intended?) with renaming directories, where a directory renamed to an empty string is actually removed instead of just having an empty name.
Would you consider including any of these changes in Deluge?