From ea75881d4759f3dc670b4f6fc845cbc4c2769f85 Mon Sep 17 00:00:00 2001 From: Darko Date: Thu, 11 Jun 2015 13:19:29 +0200 Subject: [PATCH] Fix zipped downloads --- www/pages/getnzb.php | 2 +- www/templates/nntmux/scripts/utils.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/www/pages/getnzb.php b/www/pages/getnzb.php index b8fb3508e..798466260 100644 --- a/www/pages/getnzb.php +++ b/www/pages/getnzb.php @@ -66,7 +66,7 @@ if (isset($_GET["id"]) && isset($_GET["zip"]) && $_GET["zip"] == "1") { $page->users->incrementGrabs($uid, count($guids)); foreach ($guids as $guid) { $rel->updateGrab($guid); - $page->users->addDownloadRequest($uid, $rel['id']); + $page->users->addDownloadRequest($uid, $guid); if (isset($_GET["del"]) && $_GET["del"] == 1) { $page->users->delCartByUserAndRelease($guid, $uid); diff --git a/www/templates/nntmux/scripts/utils.js b/www/templates/nntmux/scripts/utils.js index 841e83725..1a4ef3808 100644 --- a/www/templates/nntmux/scripts/utils.js +++ b/www/templates/nntmux/scripts/utils.js @@ -38,7 +38,7 @@ jQuery(function ($) { }); $('.nzb_check_all').change(function () { - $('table.browsetable tr td input:checkbox').prop('checked', $(this).prop('checked')); + $('table#browsetable tr td input:checkbox').prop('checked', $(this).prop('checked')); }); $('.nzb_check_all_season').change(function () { @@ -155,15 +155,15 @@ jQuery(function ($) { /* nzb_multi_operations_form */ $('#nzb_multi_operations_form').submit(function(){return false;}); - $('button.nzb_multi_operations_download').click(function(){ - var newFormName = 'nzbmulti' + Math.round(+new Date()/1000); - var newForm = $("
", {'action': SERVERROOT + 'getnzb?zip=1', 'method':'post', 'target': '_top', 'id':newFormName}); - $("table.data INPUT[type='checkbox']:checked").each( function(i, row) { + $('button.nzb_multi_operations_download').click(function () { + var ids = ""; + $("table.data INPUT[type='checkbox']:checked").each( function (i, row) { if ($(row).val()!="on") - $("", {'name':'id[]', 'value':$(row).val(), 'type':'hidden'}).appendTo(newForm); + ids += $(row).val()+','; }); - newForm.appendTo($('body')); - $('#'+newFormName).submit(); + ids = ids.substring(0,ids.length-1); + if (ids) + window.location = SERVERROOT + "getnzb?zip=1&id="+ids; }); $('button.nzb_multi_operations_cart').click(function(){ var guids = new Array(); @@ -180,7 +180,7 @@ jQuery(function ($) { icon: 'fa-icon-info-sign' }); } - $(this).attr('checked', false); + $(this).prop('checked', false); }); $.post( SERVERROOT + "cart?add", { 'add': guids }); }); @@ -249,7 +249,7 @@ jQuery(function ($) { var ids = new Array(); $("table.data INPUT[type='checkbox']:checked").each( function(i, row) { if ($(row).val()!="on") - ids.push($(row).val()); + ids += '&id[]='+$(row).val(); }); if (ids) {