From 976cb66b250837dc4e8d058f0d8eca71ad7efe14 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 8 Mar 2010 15:31:56 +0100 Subject: speed manager fix --- module/thread_list.py | 4 +++- module/web/templates/default/base.html | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/module/thread_list.py b/module/thread_list.py index d8a05a41d..13dba309e 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -294,11 +294,13 @@ class Thread_List(object): if speed[2].plugin.req.isSlow: slowCount += 1 slowSpeed += speed[2].plugin.req.maxSpeed/1024 - + stat = {} stat["slow_downloads"] = slowCount stat["each_speed"] = eachSpeed eachSpeed = (maxSpeed - slowSpeed) / (threadCount - slowCount) stat["each_speed_optimized"] = eachSpeed + self.stat = stat + for speed in speeds: if speed[2].plugin.req.isSlow: continue diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 27a50a018..7aa6267a3 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -28,9 +28,13 @@ document.addEvent("domready", function(){ add_box = new Fx.Tween($('add_box')); $('add_form').onsubmit=function() { - if ($('add_name').value == "" && $('add_file'.value != "")) alert("{% trans "Please Enter a packagename." %}") - $('add_form').target = 'upload_target'; //'upload_target' is the name of the iframe + $('add_form').target = 'upload_target'; + if ($('add_name').value == "" && $('add_file').value != " "){ + alert("{% trans "Please Enter a packagename." %}"); + return false + }else{ out(); + } } $('add_reset').addEvent('click', function(){ -- cgit v1.2.3