Ticket #1232 (closed defect: worksforme)

Opened 2 years ago

Last modified 16 months ago

Session files for torrents containing their own directories appear to be different between 0.7.x and 0.8.x

Reported by: jdgbolt@gmail.com Owned by: rakshasa
Priority: normal Milestone:
Component: rtorrent Version:
Severity: normal Keywords:
Cc:

Description

I came across when I was upgrading from rtorrent 0.7.9 and libtorrent 0.11.9 to rtorrent 0.8.0 and libtorrent 0.12.0 a peculiar problem. When I started up rtorrent again, for some reason some torrents that had been seeding and that had been within their own directory with multiple files within this directory, it came up with a torrent registered as completed but hash check indicated missing pieces type of message, which commonly happens say if you delete files or whatever. For some reason when I performed a hash check, it tried recreating the files within the root download directory tree, and not checking the files within the directory like it has been doing all this time. I've been working with it, trying the subversion version as well, and it would appear that perhaps within the session information for 0.8.x, it stores the directory information as well inside of the session track, since when I went back to 0.7.x after testing it, with a torrent I had tried with 0.8.x to see if the functionality was fully broken, which it didn't appear to be. I went and checked the info page and saw that the directory tree was inserted twice, so rather than ./downloads/foo it said ./downloads/foo/foo. This makes me think that perhaps 0.7.x didn't save that information within the session information, so when it went and checked for the directories in 0.8.x, it said ./downloads/ only, not ./downloads/foo. So when it tried to do a hash check, it could not find the files. This would seem to be the case, since when I went back to 0.7.x everything was back to normal, but the file that I had been downloading for 0.8.x obviously did not work. Not entirely too sure how the logic on this goes, but thought I should notify you of my weird experience. I have also tried the svn version just to ensure that it wasn't already fixed, it wasn't, so this is the only thing I could think of based off of my experiences. Not sure if this is normal behavior or not. Anyway, thanks.

Attachments

Change History

  Changed 2 years ago by jdgbolt@gmail.com

Okay, I just noticed that there was a duplicate bug at http://libtorrent.rakshasa.no/ticket/1204 , at least it would appear so. I saw at the end of the thread it is suggested to reload torrent files, what should one do if their session directory contains more than 1000 torrents, is there an easy way to reload a mass amount of torrent files? Since I occasionally will choose from that list to seed something, and it's my database of torrents. Is there a better suggested way to do this? Since I have used this session directory for quite some time. Thanks.

  Changed 2 years ago by anonymous

If the downloads are all supposed to be in the same base directory, this will reset the directory (enter after Ctrl-X):

 d.multicall=,d.set_directory=~/downloads/

  Changed 2 years ago by lostnihilist

that solution will not work if your torrents are located in more than one directory, e.g. with multiple watch directories and/or if you move completed torrents to another directory. The python script at the following link SHOULD work:

 http://rssdler.googlecode.com/files/fixSession080.py

in reply to: ↑ description   Changed 2 years ago by jdgbolt@gmail.com

Yeah, one thing with the particular way I have been doing torrent downloads is rather than copying them to a watched directory, they are downloaded from within rtorrent using backspace. So don't exactly have the original torrent files for many of the torrents I don't think.

  Changed 2 years ago by lostnihilist

you do not need the original torrent files, just the session files. If you don't have those, then you have bigger issues shutting down and restarting. on another note, use the latest version of the  fixSession080.py in that list. The other one should've still worked, but this one makes more effort to work well.

  Changed 2 years ago by ipridian@gmail.com

Trying to run that file with python 2.4.4 shows this as error :

$ python fixSession080-c.py /home/username/rtorrent/session Traceback (most recent call last):

File "fixSession080-c.py", line 198, in ?

if name == 'main': main()

File "fixSession080-c.py", line 191, in main

if fn == tordinfo?name?: tordrtorrent?directory? = '%s%s' % (dn, '/')

UnboundLocalError?: local variable 'fn' referenced before assignment

  Changed 2 years ago by ipridian@gmail.com

Correct formatting:

driana@undine ~ $ python fixSession080-c.py /home/driana/rtorrent/session
Traceback (most recent call last):
  File "fixSession080-c.py", line 198, in ?
    if __name__ == '__main__': main()
  File "fixSession080-c.py", line 191, in main
    if fn == tord['info']['name']: tord['rtorrent']['directory'] = '%s%s' % (dn, '/')
UnboundLocalError: local variable 'fn' referenced before assignment

  Changed 2 years ago by pa

i get the same python error.

  Changed 2 years ago by anonymous

Yeah. Looks like a simple error in the script. It seems that fn falls outside of else if statement (python and its stupid spacing rules). I think if you insert 2 extra spaces on line 191, the script should work. Corrected:

            elif action =='undo':
              dn, fn = os.path.split(tord['info']['name'].rstrip('/'))
              if fn == tord['info']['name']: tord['rtorrent']['directory'] = '%s%s' % (dn, '/')

  Changed 23 months ago by lostnihilist

sorry about not seeing this earlier. talk about an obscure place to post an error about the script. use the site at which the script is hosted. I will look into this problem shortly

  Changed 16 months ago by rakshasa

  • status changed from new to closed
  • resolution set to worksforme

Add/Change #1232 (Session files for torrents containing their own directories appear to be different between 0.7.x and 0.8.x)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.