qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

Delete copy of .torrent file created by qbittorrent

Open pixy-misa opened this issue 11 years ago • 33 comments
trafficstars

Give qbittorrent the ability for qbittorrent to delete copies of .torrent files that it creates. Copies are created in the "Copy .torrent files to:" and "Copy .torrent files for finished download to:" folders when those options are used. When deleting a torrent from the list, there should also be an option to delete the copy of the .torrent file just like there is an option to "Also delete the files on the hard disk". Both the files and the copy of the .torrent file are entities that the operator may wish to have removed and forcing the operator to go outside qbittorrent to remove the .torrent file is a potential source of error that I have seen created a situation for others where that person deleted the wrong .torrent file and then is faced with the issue of recovering the state of the bit torrent client so that deleted .torrent files is recovered and the files that it referenced may continue to seed or leech.

pixy-misa avatar Apr 23 '14 22:04 pixy-misa

Just so you know it is a little strange to want to copy the .torrent files and then delete it. qbt always copies the torrent files for internal use, so there isn't a possibility to lose them unless the whole disk fails. (look for the BT_backup folder. its torrent is named afte its infohash).

sledgehammer999 avatar Apr 24 '14 10:04 sledgehammer999

The main reason for copying the .torrent file into an user defined folder rather than relying on an internal system folder is for the sake of portability in reconstructing the bit torrent state. It frees me of having to rely on internal knowledge of where the bit torrent client may store things from release to release. It frees me from knowing how different bit torrent clients (e.g. qbittorrent, utorrent, ... etc.) store things internally. It can allow me to name the .torrent file using the same name as the destination folder that I choose to use in my collection area rather than the infohash. In the event that I need to rebuild the state of the bit torrent client from scratch, regardless of which bit torrent client I choose to use, I will know from the folder where the .torrent file is located whether I have a completed download or not, and which completed download were being shared because those that were removed from the list for sharing would have had their .torrent file deleted.

There are many features that I can easily do without such as support for a proxy server, a scheduler and the ability to toggle between two sets of UL/DL limits, but to me more important that those previous feature (which are probably important to many people) is the ability to keep a copy of the .torrent files in a separate "in-process" and "complete" folder, the ability to change the name of the .torrent file to match the destination folder that I use, and the ability to removed the .torrent files from the "in-process" and "complete" folders when they are removed from the torrent list.

For now, it sounds like I will have to use a different technique such as renaming the folders to distinguish those that are being shared from those that are no longer being shared since the .torrent files of those that are not being shared are not being deleted.

Thanks for your time.

  • pixymisa

----- Original Message ----- From: "sledgehammer999" [email protected] To: "qbittorrent/qBittorrent" [email protected] Cc: "pixymisa" [email protected] Sent: Thursday, April 24, 2014 6:44:09 AM Subject: Re: [qBittorrent] [Wishlist] Delete copy of .torrent file created by qbittorrent (#1606)

Just so you know it is a little strange to want to copy the .torrent files and then delete it. qbt always copies the torrent files for internal use, so there isn't a possibility to lose them unless the whole disk fails. (look for the BT_backup folder. its torrent is named afte its infohash).

— Reply to this email directly or view it on GitHub .

pixy-misa avatar Apr 24 '14 12:04 pixy-misa

I totally agree with this. Back in the days when I used uTorrent this would be my default delete option.

The reason torrent files are there is to maintain a copy state as pixymisa said. But I don't need the torrent file once I deleted the content from the disk.

dmlemos avatar Mar 22 '15 19:03 dmlemos

But I don't need the torrent file once I deleted the content from the disk.

Then just delete them. In point of fact, you can delete the metadata (.torrent) files as soon as they are loaded, if you don't need them to maintain an 'archive' of your downloads. They are only kept for your convenience, as qBT/libtorrent use the hash ID named metadata files in BT_Backup for reference

And if you do not want two copies, simply uncheck "Move completed .torrent files to, then it will not move or copy them.

chrishirst avatar Mar 23 '15 08:03 chrishirst

I always use this feature in uTorrent. Really miss it after moving to qBittorrent. Is it that we have only a BT_backup with obscure filenames or folder with normal torrent files, but like a trash (if not delete files manually each time).

FreePlague avatar May 20 '15 17:05 FreePlague

I always use this feature in uTorrent. Really miss it after moving to qBittorrent

How??? The feature IS there

Tools -> Options -> Downloads -> Save torrent files in ...

and

Tools -> Options -> Downloads -> Copy torrents for completed jobs to .... If you don't care or don't need to know what is completed don't use the second option, if you want to match file name to payload, wet the "Copy finished" location to the same folder as your completed payloads are located.

The BT_Backup location is where qbittorrent keeps IT'S copy of the metadata, well away from user 'participation' [to put it nicely] and with a file name that only the protocol engine can read and link to the running task, THIS copy will also be removed when the task is removed from the client because it no longer needs the fastresume file OR the metadata file.

chrishirst avatar May 20 '15 20:05 chrishirst

Oh and IF you do not want to keep a copy at all, do not set the "Copy torrent files to"

chrishirst avatar May 20 '15 21:05 chrishirst

"Save torrent files in ..." and "Copy torrents for completed jobs to ...." work fine. Torrent file is stored where it is necessary. But the point is that when I delete torrent by GUI, this torrent in my folder is left. And over time this folder will turn into a dump, if I do not remove them manually every time. Let me explain why I need this folder. If I want to move/copy all my torrent to another BT client or maybe unfortunately qBittorent resume file will be corrupted, I will take torrents from this folder. And instead only the necessary torrents there will be all, including unnecessary and deleted.

FreePlague avatar May 20 '15 23:05 FreePlague

Sorry, but I don't understand your problem, you can do whatever you want, at any time you want with any or all of the files in either of the user defined folders for storing metadata files. once loaded into qbittorrent those files are completely redundant as far as qbittorrent is concerned. You could delete all of them every hour if you wanted to and qbittorrent would continue working, try doing that with uTorrent.

The hash id named files in BT_Backup do NOT need any user managing, they will be created on loading the task, and removed on deleting the task. The user defined locations are for your convenience, delete them, keep them, move them to a different client or machine, whatever you want to do with them ... ... you can, with total alacrity.

I move some tasks and payloads to another machine on a weekly basis for jobs that I want to continue seeding without keeping my 'day to day' machine powered up 24/7 and the ones I don't need get deleted.

chrishirst avatar May 21 '15 10:05 chrishirst

Ok, thanks. I understood you.

FreePlague avatar May 21 '15 11:05 FreePlague

+1

"When deleting a torrent from the list, there should also be an option to delete the copy of the .torrent file just like there is an option to "Also delete the files on the hard disk"."

Please add the option to DELETE .torrent file when removing a torrent from the list. Lots of people use this feature. The fact that you don't use this feature, doesn't mean that other people don't use it.

Ability to delete .torrent files is a feature that a lot of users use to manage their .torrent file collections. Those .torrent file collections can be used by multiple different torrent clients on different trackers etc.

It's a handy feature and lack of ability to manage .torrent files prevents me from migrating from uTorrent and Vuze to qBittorrent.

uTorrent:

utorrent

Vuze:

vuze

Thank you.

student13371 avatar Aug 14 '15 13:08 student13371

https://qbforums.shiki.hu/index.php/topic,3738.0.html

chrishirst avatar Aug 15 '15 08:08 chrishirst

I would also appreciate this feature, one of the two features missing after my migration from ad-infested utorrent.

LittleVulpix avatar Mar 14 '17 19:03 LittleVulpix

+1 I need this, I've been manually going in and comparing download folder with .torrent file directory and have deleted 1000s of files so far selecting one at a time most of the time. How is this not a feature.

Here is why its needed - I download to multiple drives. If something happens and I need to add files back into torrent program to get seeds going again I need the .torrent files to be on the same drive as the data is. This way I just set default drive/directory to that drive and then select all the torrent files and hit enter. All instantly added back in. I have 12 download drives. All the .torrent files for the data on G is in a torrent files directory on G etc. (using the copy .torrent file to feature) Problem is I often delete downloads I dont want seeding anymore but the .torrent files are not deleted. So once a year or so when i have to redo qbit or use another torrent app I have all these .torrent files that don't have data for seeding and I dont want them redownloaded. What a pain. I like this app way better then utorrent but utorrent had this feature and its driving me nuts that I spend 8hours deleting files manually every so often.

japrine avatar Jan 15 '18 10:01 japrine

There are like 20 feature requests for this feature.

witZack avatar Jul 17 '18 06:07 witZack

Hey, I'd also like this. I use magnet links to start downloading, "copy .torrent file to..." checkbox option to keep them around for archival purposes and to re-seed if I were to reformat my machine, but I like to try e.g. 3 different torrents for the same thing to compare their quality or whatever, and later delete all but 1. The .torrent files sticking around even after deleting with "also delete files on hard disk" makes keeping track of what I actually would want to re-seed a nightmare, as someone else in another issue thread already put it

jdnixx avatar Oct 09 '21 01:10 jdnixx

Please add this. I want to move from uTorrent to this but manual .torrent file management after I remove the download from the client is showstopper for me.

DJAlik avatar Nov 06 '21 03:11 DJAlik

Very interested in this feature, alongside with many others it seems.

Fytch avatar Dec 23 '21 22:12 Fytch

Yes would like to see this added. Preventing me from moving to qbittorent.

Mrsash2020 avatar Dec 24 '21 23:12 Mrsash2020

It amazes me that the developers still haven’t implemented this feature after 8 years. How hard can it be?

mat926 avatar Dec 24 '21 23:12 mat926

It amazes me that the developers still haven’t implemented this feature after 8 years. How hard can it be?

I don't think that's the issue. They are definitely capable. I have seen some posts in this forum where people have requested it over the years but have been brushed off. Reminds me of when Microsoft removed classic Menu and insisted we use their product as they want us to. As if we dont have a clue what we are doing.

I remember a friends advice either live with it or move on.......

Anyway not egging anyone on. Its their software and they have the choice so.... I leave it in their court.

Mrsash2020 avatar Dec 26 '21 04:12 Mrsash2020

Coming from uTorrent I miss this feature... is any of the devs looking into it?

mspykerez avatar Feb 19 '22 04:02 mspykerez

This is a must have feature. Given the seeming very large amount of users who are noticing this as a problem and requesting the resolution I don’t understand why it’s taking years to implement. Real shame.

tinysalad avatar Feb 21 '22 13:02 tinysalad

I know that my post is sort of tying a few different issues together, I apologize in advance for this, but I feel they're all related, and people keep on bringing up enabling the option of "copy .torrent file to..."
I'm finding that I am seeing some odd behavior or something I'm not fully understanding.

Running Windows 10.19044.1645 & qbittorrent 4.4.2
When I have the "copy .torrent file" option enabled, it does not copy the file from the watched folder, it removes/moves it from the watched folder. Is this intended?
I also have found that those torrents, when I delete them, the .torrent files do not get removed (whether they came from a watched folder or not)

I have some confusion around removing/deleting torrents as well, sometimes it seems that the files that get removed bypass the recycle bin. I can't provide a solid example right now, but has this behavior been seen before, and could it be somehow tied into the overall issues noted here WRT the .torrent file handling upon addition and removal?

Also, Is there a mismatch with the verbiage used for the option "Delete .torrent files afterwards" ...? To me, it implies that it will delete the .torrent file upon addition to qbittorrent (Tooltip text: Whether the .torrent file should be deleted after adding it)
Does this truly mean what the tooltip says? Because, if so, I have the option unchecked and it still removes torrents from watched folders. This seems to be counter-intuitive and going against what the checkbox option purports to do.

But, opening a .torrent (not from a watched folder) - does not get removed. Why is there a disparity there? Is that intentional?

One last bit... How do these two configuration parameters play into all of this?

[Preferences]
General\DeleteTorrentsFilesAsDefault=true

[Core]
AutoDeleteAddedTorrentFile=Never

To clarify, the behavior I am looking for is this:

  1. Any new .torrent that is added, either manually or via a watched folder will not be removed from the original folder that I have added it from. (or an option to enable/disable that functionality)
  2. When deleting a torrent from the UI, the .torrent that qbittorrent stores will be removed as well, (and the original torrent referenced in my first point will not be affected by the removal)

And, I guess, last thing... It seems that categories are not being applied to the incomplete path for torrents, when the category options show they should be. Is any of this at all possible? I assume there would need to be some sort of state tracking for torrents added via the watch function, as to not trash disks and waste cycles all of the time. I dug around the forums a small bit and found a few threads which seem to fit along the same vein of thinking expressed in this issues...

https://qbforums.shiki.hu/viewtopic.php?t=9795
https://qbforums.shiki.hu/viewtopic.php?t=9574
https://qbforums.shiki.hu/viewtopic.php?t=8691
https://qbforums.shiki.hu/viewtopic.php?t=8661
https://qbforums.shiki.hu/viewtopic.php?p=38034
https://qbforums.shiki.hu/viewtopic.php?p=26822

Again, apologies for sort of mushing up multiple issues and topics into one post, but I feel there is a relationship between many of these options, and things just don't seem to be adding up.

jwshields avatar May 05 '22 01:05 jwshields

When I have the "copy .torrent file" option enabled, it does not copy the file from the watched folder, it removes/moves it from the watched folder. Is this intended?

Yes it's intended, otherwise it would keep trying to add already added torrents. These options are not connected. "Copy..." options generate a .torrent file based on the metadata qBt has about this torrent (from the BT_backup folder).

I also have found that those torrents, when I delete them, the .torrent files do not get removed (whether they came from a watched folder or not)

The original .torrent file is not touched by qBt after it is added except when "Delete .torrent files afterwards" is enabled (this option doesn't apply for watched folders because .torrents are always deleted from there).

it seems that the files that get removed bypass the recycle bin

Everything qBt deletes is final. Recycle bin is not used in any option or operation.

How do these two configuration parameters play into all of this?

DeleteTorrentsFilesAsDefault is for the confirmation dialog when manually deleting torrents. AutoDeleteAddedTorrentFile is for "Delete .torrent files afterwards" option.

And, I guess, last thing... It seems that categories are not being applied to the incomplete path for torrents, when the category options show they should be.

Torrent has to be in Automatic Management Mode for category settings to apply.

I assume there would need to be some sort of state tracking for torrents added via the watch function, as to not trash disks and waste cycles all of the time.

Watched folders are checked on a timer (10-20 sec, don't remember) and if a .torrent or .magnet file is found it is parsed. Leaving such files in the watched folder would force qBt to continually parse and compare if they already exist and naturally, this would start to get taxing if enough such files are accumulated. So qBt simply opts to delete them when they are added.

thalieht avatar May 05 '22 15:05 thalieht

Apologies for the slow response, but thank you for the details on all of my points!

Everything qBt deletes is final. Recycle bin is not used in any option or operation.

uTorrent had an option to either delete to recycle bin or fully remove; is that a feature that could be implemented in qBittorrent? Or has that been definitively decided this is the way it will work? Could I ask that the qBittorent team evaluate this behavior?

Torrent has to be in Automatic Management Mode for category settings to apply.

Understood, and I think I figured that out on my own shortly after posting my original comment. But thank you.

Leaving such files in the watched folder would force qBt to continually parse and compare [...]

Would it be feasible/possible to implement a feature of "Move added torrents to x directory" - if so, could I also ask that the team consider this sort of function? To clarify, I don't mean the currently existing option of Copy .torrent files to: & Copy .torrent files for finished downloads to: - I mean mostly for watched folders; that way a sort of archive can be kept if I need to start from scratch and re-add everything.
The current method where torrents don't have their respective .torrent file removed upon removal of the torrent itself (From the copied dir & completed dir) makes for a bit of a mess, and would be difficult to manage if I did have to start from scratch and re-add all ~6000 torrents that I currently have running.

Thank you again for the detailed response, I truly appreciate it!

jwshields avatar Jul 10 '22 10:07 jwshields

uTorrent had an option to either delete to recycle bin or fully remove; is that a feature that could be implemented in qBittorrent? Or has that been definitively decided this is the way it will work? Could I ask that the qBittorent team evaluate this behavior?

qBt relies on libtorrent for deletions but it doesn't have "Delete to recycle bin" functionallity. To implement it manually, code would have to be written for each OS individually. Ideally libtorrent should implement it but since Qt6 now offers a cross platform way to do it, someone might implement it in qBt using that. There's an open issue about this with many 👍 IIRC.

Would it be feasible/possible to implement a feature of "Move added torrents to x directory"

Maybe you're talking about this #2323. If not, you should make a new issue for it.

The current method where torrents don't have their respective .torrent file removed upon removal of the torrent itself (From the copied dir & completed dir) makes for a bit of a mess, and would be difficult to manage if I did have to start from scratch and re-add all ~6000 torrents that I currently have running.

Sounds to me like you want to backup the currently active torrents and from the sound of it, it's for batch purposes which means torrent names don't matter? If yes you could use some sync utility on the BT_backup folder with somewhere else.

thalieht avatar Jul 10 '22 17:07 thalieht

This is getting off topic & I don't want to derail this issue any more, but thank you for all of the insightful comments-

jwshields avatar Jul 11 '22 02:07 jwshields

I think this is the same issue I've run into. I'm simply not experience enough yet to figure it out or to even find a solution yet.

I keep a "Copy .torrent file for finished downloads to: /home/justchil/downloads/torrents" and I use this directory for my rsync to other seedboxes. I also run a script several times an hour to check for "Unregistered Torrents" and tag them as "UNREG".

When I manually delete the UNREG torrents from the WebUI manually... it doesn't delete the torrent in /home/justchil/downloads/torrents. So my rsync script still pushes the .torrent to other seedboxes.

I would like the torrent to be deleted or moved to another location. I'm not sure this is a feature a ton of people will want... but maybe?

justchil avatar Feb 22 '23 14:02 justchil

I really need this feature but it seems it hasn't been implemented yet. Is there already an existing tool that will cleanup the old .torrent files?

mat926 avatar Oct 26 '23 03:10 mat926