Skip verifying local data when adding torrents

Feature requests not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
el8latspq
Posts: 5
Joined: Sat Feb 26, 2011 2:53 am

Skip verifying local data when adding torrents

Post by el8latspq »

Firstly, in the previous 2.1x version of Transmission, I found a trick to do this. I just wrote a script to build a .resume file corresponding to the torrent I wanted to add *BEFORE* I really added it to Transmission and moved that .resume file to the directory where it should be. The .resume file I built is almost identical to the one Transmission would made for a seeding torrent, therefore when I added the torrent by transmission-remote, Transmission thought the torrent was already in the seeding list and kept on seeding *WITHOUT* any local data verifying. This trick just worked fine in the pre-2.2x version.
However, after 2.2x released, as a result of the new patch, the structure of .resume file is slightly changed. The 'mtime' key is gone and replaced by the 'time-checked' key. I looked into the new version of .resume file and tried to build it nearly the same way I previously did, except for replacing the 'mtime' with 'time-checked'. Unfortunately, it failed. I hadn't enough time to read the source code of Transmission, and I wondered if I could possibly do this trick again in the 2.2x version. If so, which step of the trick should be improved? If not, why? Could any developer give me some suggestion? Thank you.
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Skip verifying local data when adding torrents

Post by Jordan »

Yes, if you read libtransmission/resume.c's saveProgress() file you'll see how to make it work in 2.2x.

However I'm not sure why you would want to. The old "recheck entire torrents at startup" behavior that you're trying to avoid doesn't exist anymore.
el8latspq
Posts: 5
Joined: Sat Feb 26, 2011 2:53 am

Re: Skip verifying local data when adding torrents

Post by el8latspq »

Thanks Jordan. I'll take a look at it and hope I can understand...
The reason why I need this trick is that I write a seed robot and it uploads a lot of new torrents to a tracker frequently. Some of the files are really huge, and the verifying progress will slow down the machine.
el8latspq
Posts: 5
Joined: Sat Feb 26, 2011 2:53 am

Re: Skip verifying local data when adding torrents

Post by el8latspq »

I found that I had read the saveProgress() before and I don't think it's the point.
Actually I really wonder how this trick could work in the previous version. Yes, I build the .resume file and move it into the right directory, but the session don't read the .resume file for checking duplicated torrent but do read the memory when I add the torrent. So Transmission MUST be adding the torrent like a new one. Now it's just the situation that Transmission find the files already exist in the download location and start verifying the data. If this process is right, why Transmission *DO NOT* play the verifying? Could someone tell me which step I described above is wrong? I think that step is the key to this problem.
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Skip verifying local data when adding torrents

Post by Jordan »

It seems like it generating the .resume files by hand is a lot more work than, say, going into resume.c and adding a line or two to make libtransmission think that all pieces have an up-to-date timestamp...
el8latspq
Posts: 5
Joined: Sat Feb 26, 2011 2:53 am

Re: Skip verifying local data when adding torrents

Post by el8latspq »

Jordan wrote:It seems like it generating the .resume files by hand is a lot more work than, say, going into resume.c and adding a line or two to make libtransmission think that all pieces have an up-to-date timestamp...
I have read the loadProgress() and saveProgress() code. It seems that if the time-checked is just an interger, the timeChecked of all pieces will be set equal to it. So if the value equals the file's mtime, libtransmission will think that *all* of the pieces are tested , right? This is just what I do by simply replacing the "mtimes" list with "time-checked". I even have tried adding several seconds to the mtimes to simulate the "real" value they might be, but it still failed. That's why I think it's nothing about the resume.c
Jordan
Transmission Developer
Posts: 2312
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Skip verifying local data when adding torrents

Post by Jordan »

Why try to "fix" this at the .resume level at all? Why not just replace most of loadProgress() with a simple for loop that sets all of the pieces' mtimes to the current time or something?

Anyway I think this .resume file hacking is a bad idea and I'm not going to get sucked into debugging it. :)
el8latspq
Posts: 5
Joined: Sat Feb 26, 2011 2:53 am

Re: Skip verifying local data when adding torrents

Post by el8latspq »

Jordan wrote:Why try to "fix" this at the .resume level at all? Why not just replace most of loadProgress() with a simple for loop that sets all of the pieces' mtimes to the current time or something?
As you can see in the source code, loadProgress() actually sets all of the pieces' timeChecked to a same time for each file if the .resume file's 'time-checked' is a list of interger. Isn't that enough?
Jordan wrote:Anyway I think this .resume file hacking is a bad idea and I'm not going to get sucked into debugging it. :)
I'm trying to do this trick without doing anything ugly to the source code, so this hacking may be the cleanest way I can imagine.
Post Reply