Opened 9 years ago

Closed 7 years ago

#690 closed bug (Fixed)

Renaming folders do not delete olds

Reported by: axet Owned by: Cas
Priority: minor Milestone: 1.3.2
Component: GTK UI Version: 1.3.1
Keywords: Cc: cameron@…, nicorac

Description

With already loaded torrent try to rename root folder.

Change History (12)

comment:1 Changed 9 years ago by axet

  • Version changed from 1.1.0_RC2 to 1.1.0_RC3

same for rc_3

comment:2 Changed 9 years ago by axet

  • Version changed from 1.1.0_RC3 to 1.1.0

same for 1.1.0

comment:3 Changed 9 years ago by andar

  • Resolution set to fixed
  • Status changed from new to closed

comment:4 Changed 7 years ago by cinderblock

  • Cc cameron@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 1.1.0 to 1.3.0

I'm still seeing this issue in 1.3.0. I have not tried 1.3.1 but as this bug is claiming to be resolved before 1.3.0 was released, I'm guess it was never actually fixed or the change accidentally reverted.

Sorry if this has been fixed in 1.3.1 but I found no evidence towards that in the change logs. (Without the ability to easily test it)

comment:5 Changed 7 years ago by axet

it never been fixed.

comment:6 Changed 7 years ago by Cas

what is the exact problem. the original post does not have enough details of what is trying to be achieved and the steps needed to reproduce it.

comment:7 Changed 7 years ago by axet

i made this video several years ago, and post it as another bug.

http://www.youtube.com/watch?v=DRo0zRPKdDw

it been successively closed as current one.

comment:8 Changed 7 years ago by cinderblock

  • Component changed from other to core
  • Priority changed from major to minor

Cas, The initial description is perfectly concise, while maybe not exhaustive.

Rename a folder in a torrent that has already been added. Open your favorite folder viewer to the download location. The old folder is still there, and empty.

As I regularly rename folders, I had to add a cron job that runs this: find /mnt/downloads -depth -type d -empty -exec rmdir -v {} \;

The video shows the problem pretty well. Although I must disagree with axet's second point that un-started torrents shouldn't create the empty directories. They are quite useful if trying to add a torrent with existing data.

comment:9 Changed 7 years ago by cinderblock

  • Version changed from 1.3.0 to 1.3.1

I've been looking into the code a little for references to folder renaming and I think I found the bug. First off, the comments in the rename_folder function in core.py say that file and folder renaming are handled by libtorrent as an asynchronous operation so maybe it's something in libtorrent that needs to get fixed.

However, the source indicates a call to torrent.py's rename_folder function. The comments in that function say that a folder rename is really just renaming each file in that path and the code in that function seems to agree with the comment. I'm betting this is where the old folder gets orphaned. Hopefully someone that knows deluge/python better can fix this easily?

comment:10 Changed 7 years ago by nicorac

  • Cc nicorac added

comment:11 Changed 7 years ago by Cas

  • Component changed from core to gtkui
  • Milestone set to 1.3.2
  • Owner changed from andar to Cas
  • Status changed from reopened to assigned

comment:12 Changed 7 years ago by Cas

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in 1.3-stable: 2354eeca7b

Note: See TracTickets for help on using tickets.