From bfd099a82ee7eb734f0136d23b35f05597ac99d5 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 21 May 2014 22:10:22 +0000 Subject: [PATCH] update auto-expiry with new options git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1919 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 4 +- webif/html/browse/aexpiry.jim | 37 ++++++++++--- webif/html/browse/assets.jim | 70 +++++++++++++++++++++---- webif/html/browse/script.js | 55 +++++++++++++++----- webif/html/css/style.css | 8 ++- webif/lib/bin/auto | 97 +++++++++++++++++++++++++---------- webif/lib/browse.class | 29 ++++++----- webif/lib/system.class | 1 + webif/lib/ts.class | 4 ++ 9 files changed, 231 insertions(+), 74 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index e4fc37b..6477391 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,11 +1,11 @@ Package: webif Priority: optional Section: web -Version: 1.0.13-1 +Version: 1.0.13-2 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.11),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose Conflicts: tvdiary(<0.0.2-6) Suggests: -Description: An evolving web interface for the Humax. [Switch web server software] +Description: An evolving web interface for the Humax. [Enhance auto-expiry options] Tags: http://hummy.tv/forum/threads/5031/ diff --git a/webif/html/browse/aexpiry.jim b/webif/html/browse/aexpiry.jim index e625898..3c1de77 100755 --- a/webif/html/browse/aexpiry.jim +++ b/webif/html/browse/aexpiry.jim @@ -2,23 +2,48 @@ package require cgi source /mod/webif/lib/setup - -httpheader +require browse.class # dir=%2Fmedia%2FMy+Video%2FWeatherview # aexpiry_days=13 set dir [cgi_get dir "-"] -set days [cgi_get aexpiry_days 7] if {$dir eq "-"} exit +set act [cgi_get act "update"] + +if {$act eq "fetch"} { + httpheader "application/json" + set data [{dir expiry} $dir] + puts "{" + puts " \"days\": \"$data(days)\"," + puts " \"keep\": \"$data(keep)\"," + puts " \"type\": \"$data(type)\"," + puts " \"keepnew\": \"$data(keepnew)\"" + puts "}" + exit +} + +if {$act eq "remove"} { + httpheader + if {[file exists "$dir/.autoexpire"]} { + file delete "$dir/.autoexpire" + } + exit +} + +httpheader + +set data(days) [cgi_get aexpiry_days 0] +set data(keep) [cgi_get aexpiry_min 0] +set data(type) [cgi_get aexpiry_timetype recorded] +set data(keepnew) [cgi_get aexpiry_unwatched 0] + if {![file isdirectory $dir]} { puts "Not a directory." exit } -set fd [open "$dir/.autoexpire" w] -puts $fd $days -$fd close +{dir expiry} $dir $data puts "Ok." diff --git a/webif/html/browse/assets.jim b/webif/html/browse/assets.jim index 4b90144..a1f3e43 100755 --- a/webif/html/browse/assets.jim +++ b/webif/html/browse/assets.jim @@ -80,7 +80,7 @@ if $flatten { } puts { -
  • Auto-Expire
  • +
  • Auto-Expire Options
  • } if {[system pkginst ffmpeg]} { @@ -259,28 +259,76 @@ puts { -