TorrentFlux.com Welcome, Guest. Please login or register.
03-12-2010, 01:22:48
Home Help Search Login Register donate
TorrentFlux Home | TorrentFlux Hosting

+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  persistent torrent-totals hack
« previous next »
Pages: 1 [2]  All Go Down Print
Author Topic: persistent torrent-totals hack  (Read 4022 times)
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 543



View Profile WWW
« Reply #15 on: 05-08-2006, 16:37:49 »

One other thing, when deleting, the torrent should prob be removed from the database to clean up after itself and not just have the totals updated.

this was intentional as i dont want to loose my seeding-stats when reseeding "old" torrents.
it should even work if you rename torrents.
maybe i integrate an option to flush stats on demand.
Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 543



View Profile WWW
« Reply #16 on: 05-08-2006, 16:45:38 »

Have the bits of this I wanted hacked into my code and came across a small maths bug.

Code:
This line
$sharekill = (int) ($sharekill - (($upTotal / $upWanted) * 100));

should be
$sharekill = (int) ($sharekill - (($upTotal / $torrentSize) * 100));

Was causing the wrong percentages to be generated.

oops. must have been a cut+paste thingy because i have it correct in downloaddetails.
(and i didnt notice it on my 100% test-cases of course Cheesy)
thanks for seeing it and giving me feedback about it.
Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
ryaner
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 919





View Profile
« Reply #17 on: 05-08-2006, 17:18:45 »

this was intentional as i dont want to loose my seeding-stats when reseeding "old" torrents.
it should even work if you rename torrents.
maybe i integrate an option to flush stats on demand.

Very good point. Hadn't thought about that.
Logged

SERVER: Debian Sarge 2.6.16| AMD XP2000+ | 1.5GB Ram  | 1.6T - Raid 5 | TF 2.1 | Apache 2.0.54 | PHP 4.3.10 | MySQL 4.1.11 | Mod/Hacks: XFER Transfer Stats/Multi Torrent Delete/Seed Time Hack/Ajax Details/Torrent Details/RSS Hack
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 543



View Profile WWW
« Reply #18 on: 05-08-2006, 18:27:32 »


one thing just came in mind about the hack... the checkbox is kinda useless.
because you never set the sharekill-commandline-param direct anymore.
so just no checkbox should behave exactly like having one. (in what is really the result of operations)

btw i just tested things with transmission-client and works as well.
so i moved the param-recalc code from tornado-handler to the clienthandler-baseclass Wink
Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
ryaner
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 919





View Profile
« Reply #19 on: 05-08-2006, 18:37:10 »

Thought the idea behind the checkbox was to force it to send the sharekill value ignoring the previous saved data? Personally I removed it since a) I just want to seed 200% total and b) I was too lazy to hack it in Wink
Logged

SERVER: Debian Sarge 2.6.16| AMD XP2000+ | 1.5GB Ram  | 1.6T - Raid 5 | TF 2.1 | Apache 2.0.54 | PHP 4.3.10 | MySQL 4.1.11 | Mod/Hacks: XFER Transfer Stats/Multi Torrent Delete/Seed Time Hack/Ajax Details/Torrent Details/RSS Hack
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 543



View Profile WWW
« Reply #20 on: 05-08-2006, 19:07:21 »

Thought the idea behind the checkbox was to force it to send the sharekill value ignoring the previous saved data? Personally I removed it since a) I just want to seed 200% total and b) I was too lazy to hack it in Wink

yeah but stripped down to what it does:
in case you dont change it its the same if you pass 200 as param or if you reload it from the db (ignoring passed value).
and in case you change it.. you want a "force-set" anyway.
Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
Pages: 1 [2]  All Go Up Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP