mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Wrong behavior while renaming a folder #1633
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#1633
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @reyaz006 on GitHub (Aug 20, 2014).
Example: I have a torrent "Funny_Things", finished 100% and seeding atm:
Someone updates the torrent on the source with edited/updated content. "Photos" are updated.
I'm adding that updated torrent, but I just want to check new Photos, while preserving old ones. Thus, I'm not deleting the first torrent from the list. In the New Torrent dialog, I'm renaming the folder manually before starting the new torrent, so it looks like this now:
Next thing that happens, the app moves files from [Funny_Things] to [Funny_Things 2] (!), so now my first torrent contains only
Then, after second torrent gets downloaded, here is what I have:
Files from my first torrent got wiped, and now I have files in [Funny_Things 2] that I specifically requested not to download.
That's quite a problem.
@chrishirst commented on GitHub (Aug 20, 2014):
Torrent payloads are NOT currently "mutable" in ANY other BT clients than SOME versions of uTorrent and BitTorrent and they HAVE to be created specifically
Read the BEP on mutable payloads - http://www.bittorrent.org/beps/bep_0039.html
If you load an new or updated job over an existing payload it WILL overwrite the data, that's the nature of the protocol.
@reyaz006 commented on GitHub (Aug 20, 2014):
Thanks. If I got you right, this is a basic limitation of the most default protocol implementations. I can understand that.
Am I wrong in presuming that even though this behavior may be correct from this point, it still feels unintuitive and inadequate to regular user?
As a user, I'd like to think that each torrent is a separate entity and the last thing I want is that some new torrent steals the files from different completed jobs. Some kind of explanation or notification before touching things I didn't request to touch could really help.
@chrishirst commented on GitHub (Aug 21, 2014):
It's quite simple really.
The bittorrent protocol does not understand what 'folders' and 'files' are, it simply does not use them. A torrent payload is simply an amount of data that is split into several equally sized blocks called pieces and a piece may contain part of a file, all of a file or more than one file.
http://lifehacker.com/285489/a-beginners-guide-to-bittorrent
https://wiki.theory.org/BitTorrentSpecification
http://qbforums.shiki.hu/index.php/topic,2481
But yes each task is a 'new' task, but if the folder and files names 'clash' BT clients does not know that and simply 'trusts' the information that the underlying disc filing system gives it.
@sledgehammer999 commented on GitHub (Aug 22, 2014):
one possible workaournd: you remove the first torrent without removing the data files from disk. Then you add the second one and SELECT the already downloaded files too. Then you just wait for the file recheck to finish and the old files should be recognised as 100% complete.
Also this will help in the future when implemented: http://qbforums.shiki.hu/index.php/topic,2294.0.html
@reyaz006 commented on GitHub (Aug 22, 2014):
Then I'd need to also move out old files from [Photos] or I'll lose them as soon as I choose Recheck.
There should be a possibility for the client to rely on user-defined filenames before checking with the disk file system, I think.
It allows us to rename anything, afterall. Even though it may not be a part of specification.
@sledgehammer999 commented on GitHub (Aug 22, 2014):
Not if in the new torrent the same files exist under the same path. If you enable them in the new torrent too they should recheck.
@reyaz006 commented on GitHub (Aug 22, 2014):
Sorry but did you read my original comment? I said I wanted to have both versions of those files, old and new. Or are you saying that the client would backup old versions of files somewhere before overwriting them with new files from the new torrent?
I'll try to make it more clear.
Here is what I'm expecting to get after my actions described in my original comment:
Here is what I'm getting instead:
@sledgehammer999 commented on GitHub (Aug 22, 2014):
So you want to have the new torrent in a new/different base folder?
@reyaz006 commented on GitHub (Aug 23, 2014):
Yes, and I also want to keep the old base folder where it was, with its contents. What it's doing instead is moving files from old torrent folder to new chosen folder without asking me. And I've renamed folder inside the content/options dialog, before it could start the torrent.
The fact that it also moves files marked for skipping is not important here, since it should not be the case when the issue is fixed properly.
@chrishirst commented on GitHub (Aug 23, 2014):
And did you read the bit about that is how the protocol works.
Exactly as it will do, because BitTorrent ISN'T eDonkey or GNutella.
Then simply rename the original in the client first.
The simple fact is that if you load a job that has changed slightly into the same 'space' as the original, BT clients WILL use whatever blocks of data match the original metadata hashes and replace the ones that don't.
BT Clients use the hash ID to identify what behaviour should be applied to a particular task, the 'new' task has a different ID so whatever was applied to task 'A' will NOT EVER apply to task 'B'.
@sledgehammer999 commented on GitHub (Aug 23, 2014):
If I understand him correctly, he changes the base folder name of the 2nd torrent in the "Add new torrent" dialog, but qbt instead of creating everything in the new base folder name it moves everything from the old base folder name to the new base folder name.
This bug is exposed in this scenario because the 2 torrents have originally the same base folder name. What I suspect is happening is that qbt instead of taking the new folder name and creating everything under it, it gets the unchanged name and then performs a move/set location to the new name.
@reyaz006 Can you confirm?
@reyaz006 commented on GitHub (Aug 24, 2014):
I've tried to read your links but haven't found much about renaming. I think transfer protocol has little to do with how any client deal with file system and user preferences. I'm talking about files and folders, not data blocks or hashes.
Well, in my case the client at least touched files from the old torrent, which hashes were not mentioned in new torrent at all. Namely, it moved
to
then if I let the new torrent dowload, it'll overwrite those with
All correct. Your conclusion is the same as mine. It seemed like default behavior for this case is "create under default name, then move into renamed location", and qbt forgot to check if files already exist for a different torrent job. It should be "create under user-defined name from the start".
Also, I can't confirm this for sure, but with some torrents I remember that qbt left empty folders with original names after I've performed a rename operation, also in "Add new torrent" dialog. I think when this happened I thought it may have something to do with unicode characters or big amount of files in the torrent. Not sure if this also involved skipping (do not download) any files. I'll write more details if I encounter that again.
@chrishirst commented on GitHub (Aug 24, 2014):
And??? You obviously missed the bit about bittorrent client NOT using folder and files.
The BT protocol is ABSOLUTELY nothing to do with naming or renaming which is why you will find nothing.
File and folder names are defined in the metadata NOT the payload and are passed to the operating system's file manager.
@reyaz006 commented on GitHub (Aug 24, 2014):
Sorry, I'm not getting your point.
Qbt handles metadata too, and you will find plenty of results for "rename" query here in the code. I don't see why qbt can not or should not operate with folders as my previous comment suggested.
@sledgehammer999 commented on GitHub (Aug 24, 2014):
@chrishirst
The real problem is descripted here:
and here:
Let's not talk about offtopic things.
@reyaz006 commented on GitHub (Jan 26, 2015):
I found another renaming bug(s) and it seems related.
Example: I add a torrent "Videos_long" with "Add new torrent" dialog. Its contents are:
I rename "Videos_long" to "Videos_long_NEW" to make it download into different folder and uncheck the "Videos_long\Old_videos" folder to skip it. It looks like this now:
I click OK to start downloading.
When it's finished (checked on it several days later), I can see the following files got downloaded:
Note 2 things:
Furthermore, I can also see these folders got created:
Those are empty folders, under name I asked to not use. Their creation dates are same as on previously mentioned folders.
Here is the last thing:
I went to that torrent's Content view in qbt to make sure I disabled the folder I did not want and renamed the main folder. I did both things correctly. After that I did not mark any files anymore, but maybe expanded/collapsed them to see actual content and compare to what I got on hdd. Strangely enough, after that I could no longer find
It was silently moved to
I checked its properties - it was a sparse file.
I see that modification date of this folder
was changed to that moment few minutes ago. And
has creation date of same moment. So it was really created when I was browsing completed torrent in qbt, not when it was started few days ago.
I really think renaming feature needs some work. I never had such issues with ut.
(In my real case, there were 3 subfolders that I unchecked and those included some subfolders with some files of various types too.)
@xavier2k6 commented on GitHub (May 23, 2025):
ANNOUNCEMENT!
For anybody coming across this "Feature Request" & would like/love to see a potential implementation in the future!
Here are some options available to you:
Please select/click the 👍 &/or ❤
reactionsin the original/opening post of this ticket.Please feel free (If you have the "skillset") to create a "Pull Request" implementing what's being requested in this ticket.
(new/existing contributors/developers are always welcome)
DO:
DO NOT:
(These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)