#2466 closed patch (Fixed)
[AutoAdd] Error in copy torrent code if inital rename fails
Reported by: | Doadin | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 2.0.0 |
Component: | Plugin | Version: | develop |
Keywords: | Cc: |
Description
Since the change to the autoadd plugin for watching folders the added torrent does not get removed from the watch folder and in the autoadd options you can only select one or the other either delete .torrent folder or copy the .torrent to a folder. I believe this behavior should change as its probably going to try to repeatedly add it which is a waste and if you remove the torrent it will probably get added back right after since it never moved. I think that all three options for "Torrent File Action" should be options separate from each other at the very least so the user can choose.
Keeping in mind if this is the case you would probably have to add checks or something for deleting the torrent after its done or something so the client can use it? Not sure how that works in deluge but i know in other clients if you delete the torrent file you added while its still in the torrent list it will give an error.
Attachments (2)
Change History (13)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Component: | Packaging → Plugin |
---|
comment:3 by , 10 years ago
I think if you add under line 340 "os.remove(filepath)" It will fix this as it should first copy the torrent(line 340) which works, then removes the torrent from its original location? It seems like this is what it trys if there is an error with the operation but im guessing the operation is considered successful since the copy works but loops back from another spot causing the error shown in deluged-debug? Because it just keeps trying to add and copy over and over again?
Or maybe a easyer option would be to just use shutil.move(src, dst). Which would be "shutil.move(filepath, copy_torrent_file)" ? In place of line 340 Although shutil seems like a poor options as its not a fery nice module and it would be one more module to add.
comment:4 by , 10 years ago
Type: | feature-request → patch |
---|
comment:6 by , 10 years ago
Summary: | Options for Torrent After AutoAdding → [AutoAdd] Error in copy torrent code if inital rename fails |
---|
Replacing that whole try..except section with shutil.move is the solution. There is nothing wrong with using shutil and it is actually more robust.
comment:7 by , 10 years ago
From what i had read and maybe its changed now but using shutil doesnt copy other file properties like owner/permissions/ACL. Which doesnt seem like a good option to me unless im mistaken or its unneeded for some reason?
by , 10 years ago
comment:8 by , 10 years ago
It does work in windows to use the shutils.move both patches are wrong here but the one that uses shutils is closest just in the patch i forgot to add import shutils to the top so id just change it manually its easy anyways.
comment:10 by , 9 years ago
Milestone: | 2.0.x → 2.0 |
---|
It appears the the problem is that the copy torrent option in AutoAdd is broken.
error during update: [Failure instance: Traceback: <type 'exceptions.NameError'>: global name 'errno' is not defined twisted/internet/base.py:1192:run twisted/internet/base.py:1201:mainLoop twisted/internet/base.py:824:runUntilCurrent twisted/internet/task.py:218:_call_ ---<exception caught here> --- twisted/internet/defer.py:140:maybeDeffered build\bdist.win32\egg\deluge\plugins\autoadd\core.py:341:update_watchdir
enableing the copy torrent in main preferences and the delete option in AutoAdd gives the desired out come and the delete option is probably not necessary however since they are not checkboxes and they are radio options one has to be chosen.
The append extention after adding works so im guessing its not a permisions issue?