rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.05k stars 412 forks source link

`d.directory.set` and `d.directory_base.set` stops an active/seeding torrent. #1203

Closed sktt closed 1 year ago

sktt commented 1 year ago

I've made a script to move a download to a new directory, and it's using xmlrpc to update the directory for rtorrent. Essentially this:

server.d.directory.set(INFO_HASH, DEST)
os.rename(FROM, full_path)

While it seems to work, the torrent is no longer active after d.directory.set. Trying to start it again using d.start does not do anything. To restart it, I first do a hash recheck. While this works, I would rather not do it, because I want to move several files and it runs on a slow raspberry pi.

Any idea how to force start a torrent after d.directory.set? Is this a bug?

kannibalox commented 1 year ago

Make sure you stop and close it first:

server.d.stop(INFO_HASH)
server.d.close(INFO_HASH)

Then you can change the directory and move the data, and then start it with a regular d.start

sktt commented 1 year ago

Thank you @kannibalox , this fixes the issue! By the way, this is Rakshasa's BitTorrent client version 0.9.8. on ARM v7, and the xmlrpc client is rtorrent_xmlrpc. The only slight difference is that I issued these two after moving instead.

        server.d.stop(INFO_HASH)
        server.d.start(INFO_HASH)