summaryrefslogtreecommitdiff
path: root/mydl.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mydl.pl')
-rwxr-xr-xmydl.pl33
1 files changed, 33 insertions, 0 deletions
diff --git a/mydl.pl b/mydl.pl
new file mode 100755
index 0000000..cfa3896
--- /dev/null
+++ b/mydl.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+use strict;
+use CGI qw(:standard);
+use CGI::Carp 'fatalsToBrowser';
+use local::nzbget;
+use local::db;
+use local::user;
+my $user = new local::user($ENV{REMOTE_USER});
+
+
+print header;
+print start_html('my downloads');
+
+print CGI::start_table();
+my @downloads;
+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'});
+}
+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'
+
+ ]));
+}
+;
+print CGI::end_table();
+
+print end_html;
+