summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@wirdorange.org>2011-01-14 04:05:04 +0000
committerOthmar Gsenger <otti@wirdorange.org>2011-01-14 04:05:04 +0000
commitecee5d336457d0c14d887abf054b990b3705a5ea (patch)
treef76990ac867b4cf43932601331423b6036dd5276
parentadded database support (diff)
first working mutli user version
-rwxr-xr-xenqueue.pl2
-rwxr-xr-xgroups.pl6
-rwxr-xr-xmydl.pl4
-rwxr-xr-xsearch.pl3
4 files changed, 12 insertions, 3 deletions
diff --git a/enqueue.pl b/enqueue.pl
index 1e5d30d..7861073 100755
--- a/enqueue.pl
+++ b/enqueue.pl
@@ -16,7 +16,7 @@ my $category = $cat->name();
my ($size) = param('description') =~ m/<b>(.*)<\/b>/;
$size = 0;
-my $download = local::db::download->insert({owner=>$user->get_id(),name=>param('name'),category=>param('cat'),description=>param('title'),size=>$size});
+my $download = local::db::download->insert({owner=>$user->get_id(),name=>param('name'),category=>$cat->category_id(),description=>param('title'),size=>$size});
use LWP::Simple;
my $nzb = get(param('url'));
die "Couldn't get ".param('url') unless defined $nzb;
diff --git a/groups.pl b/groups.pl
index 4636c80..f810659 100755
--- a/groups.pl
+++ b/groups.pl
@@ -8,6 +8,12 @@ print header;
print start_html('nzbget groups');
my $cli = new local::nzbget;
+print <<LALALA
+<script type="text/javascript" language="JavaScript"><!--
+ window.setTimeout('document.location.reload()', 10000);
+ //--></script>
+LALALA
+;
print hr();
print CGI::start_table();
my $status = $cli->send_request('status') or die "Can't connect to nubget";
diff --git a/mydl.pl b/mydl.pl
index cfa3896..5c46937 100755
--- a/mydl.pl
+++ b/mydl.pl
@@ -17,12 +17,12 @@ if (param('only_me'))
{
@downloads = local::db::download->search(owner=>$user->get_id(),{ order_by => 'time DESC'});
} else {
- @downloads = local::db::download->retrieve_all({ order_by => 'time DESC'});
+ @downloads = reverse local::db::download->retrieve_all();
}
foreach my $dl ( @downloads)
{
print Tr(td([
- $dl->category->name,a({title=>$dl->description,href=>$dl->category->name.'/'.$dl->download_id},$dl->name),$dl->size.'MB'
+ $dl->category->name,a({title=>$dl->description,href=>'/'.$dl->category->name.'/'.$dl->download_id},$dl->name),$dl->size.'MB'
]));
}
diff --git a/search.pl b/search.pl
index 7767401..529d2dd 100755
--- a/search.pl
+++ b/search.pl
@@ -13,6 +13,9 @@ print CGI::start_table();
print CGI::start_form(-action=>'/cgi-bin/nzbget/search.pl');
print table(
+ Tr(td([a({href=>'/cgi-bin/nzbget/mydl.pl?only_me=1'},'My Downloads'),a({href=>'/cgi-bin/nzbget/mydl.pl'},'All Downloads')]))
+),
+ table(
Tr(td(['Search',textfield('q'),])),
Tr(td(['min Size',textfield('minsize')])),
Tr(td(['max Size',textfield('maxsize').hidden('more',1)])),