Welcome,
Guest
. Please
login
or
register
.
03-19-2010, 18:02:16
TorrentFlux Home
|
TorrentFlux Hosting
TorrentFlux Forums
Code Hacks and Tools
TorrentFlux 2.1 Hacks
persistent torrent-totals hack
« previous
next »
Pages:
1
[
2
]
All
Author
Topic: persistent torrent-totals hack (Read 4040 times)
b4rt
Hero Member
Offline
TF Base: Linux 2.x
Posts: 543
Re: persistent torrent-totals hack
«
Reply #15 on:
05-08-2006, 16:37:49 »
Quote from: ryaner on 05-08-2006, 16:07:39
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
TF Base: Linux 2.x
Posts: 543
Re: persistent torrent-totals hack
«
Reply #16 on:
05-08-2006, 16:45:38 »
Quote from: ryaner on 05-08-2006, 15:49:42
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
)
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
TF Base: Linux 2.x
Posts: 919
Re: persistent torrent-totals hack
«
Reply #17 on:
05-08-2006, 17:18:45 »
Quote from: b4rt on 05-08-2006, 16:37:49
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
TF Base: Linux 2.x
Posts: 543
Re: persistent torrent-totals hack
«
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
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
TF Base: Linux 2.x
Posts: 919
Re: persistent torrent-totals hack
«
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
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
TF Base: Linux 2.x
Posts: 543
Re: persistent torrent-totals hack
«
Reply #20 on:
05-08-2006, 19:07:21 »
Quote from: ryaner 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
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
TorrentFlux
-----------------------------
=> TorrentFlux News
=> TorrentFlux Search Engine Modules and Updates
=> Forum/Website Problems
-----------------------------
TorrentFlux Support
-----------------------------
=> Linux Installations Support
=> Windows Installations (Limited Support)
=> International Support
-----------------------------
Bugs, Fixes, and Feature Requests
-----------------------------
=> Linux Bugs
=> Windows Bugs
=> Feature Requests
-----------------------------
Code Hacks and Tools
-----------------------------
=> TorrentFlux Tools
=> TorrentFlux 2.3 Hacks
=> TorrentFlux 2.1 Hacks
=> TorrentFlux 2.0 Hacks
=> TorrentFlux 1.x Hacks
=> TorrentFlux Themes (skins)
-----------------------------
Off The Wall
-----------------------------
=> Off Topic Discussion
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.1
|
SMF © 2006, Simple Machines LLC