From 9e685245b99c4718e409f25f0fda426a9e5c1ac5 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Fri, 11 Nov 2016 20:49:39 +0000 Subject: [PATCH] allow multiple operations of the same type. Leave recording in the list if file size is changing git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3341 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- webif/cgi-bin/status.jim | 66 +++++++++++++++++++---------- webif/html/browse/crop/execute.jim | 8 ++-- webif/html/img/cut.png | Bin 0 -> 648 bytes webif/lib/system.class | 10 +++-- 5 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 webif/html/img/cut.png diff --git a/CONTROL/control b/CONTROL/control index 62ddfa9..cbbfbb0 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.3.2-13 +Version: 1.3.2-14 Architecture: mipsel Maintainer: af123@hpkg.tv Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.76-2),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95) diff --git a/webif/cgi-bin/status.jim b/webif/cgi-bin/status.jim index dd0986b..45dd220 100755 --- a/webif/cgi-bin/status.jim +++ b/webif/cgi-bin/status.jim @@ -45,6 +45,9 @@ set statusops { shrink { "Shrinking" "/img/compress.png style=\"padding: 0 0.2em 0 0.5em\"" } + crop { "Cropping" + "/img/cut.png style=\"padding: 0 0.2em 0 0.5em\"" + } } proc register_statusop {op name icon} { @@ -98,13 +101,32 @@ proc get_data {} { } } foreach file [dict keys $::ops] { - if {![dict exists $ret $file] && [file exists $file]} { - set ret($file) [file size $file] + if {![dict exists $ret $file]} { + if {[file exists $file]} { + set ret($file) [file size $file] + } else { + set ret($file) 0 + } } } return $ret } +proc add_output {icon mode name} { + global runmode output + + if {$runmode eq "cgi"} { + lappend output [concat \ + "\n" \ + " \n" \ + " $mode $name\n" \ + "\n" \ + ] + } else { + lappend output "$mode $name" + } +} + set play 0 set rec 0 set output {} @@ -164,9 +186,14 @@ if {[llength $data]} { foreach file [array names data] { set bname [file rootname [file tail $file]] - if {[dict exists $ops $file]} { - set mode $ops($file) - } elseif {$data($file) == -1} { + set name [string map { + "/mnt/hd2/My Video/" "" + "/media/drive1/Video/" "" + "/media/" "" + ".ts" "" + } $file] + + if {$data($file) == -1} { set mode chase } elseif {$rr} { if {$file in $recs} { @@ -183,6 +210,17 @@ if {[llength $data]} { } } + if {[dict exists $ops $file]} { + if {$mode eq "rec"} { + set mode "Recording" + set icon "745_1_11_Video_1REC.png" + add_output $icon $mode $name + } + set mode $ops($file) + } + + regexp -- {^([^0-9]+)} $mode x mode + switch $mode { chase { incr rec @@ -214,23 +252,7 @@ if {[llength $data]} { set icon "/images/$icon" } - set name [string map { - "/mnt/hd2/My Video/" "" - "/media/drive1/Video/" "" - "/media/" "" - ".ts" "" - } $file] - - if {$runmode eq "cgi"} { - lappend output [concat \ - "\n" \ - " \n" \ - " $mode $name\n" \ - "\n" \ - ] - } else { - lappend output "$mode $name" - } + add_output $icon $mode $name } } diff --git a/webif/html/browse/crop/execute.jim b/webif/html/browse/crop/execute.jim index 01bd50f..37d719c 100755 --- a/webif/html/browse/crop/execute.jim +++ b/webif/html/browse/crop/execute.jim @@ -60,13 +60,11 @@ if {$invert} { lappend cmd "-cutBookMarks" } -puts "CMD: $cmd" +#puts "CMD: $cmd" +system startop crop $rfile puts [exec {*}$cmd] -#puts [exec /mod/bin/nicesplice \ -# -in "$origdir/$shname" \ -# -out "$dir/$shname" \ -# -cutBookMarks] +system endop crop set newname "$shname-[clock seconds]" puts "Renaming file group to $newname" diff --git a/webif/html/img/cut.png b/webif/html/img/cut.png new file mode 100644 index 0000000000000000000000000000000000000000..f215d6f6b7c81ab344a3e53e0e5e756c58c82d90 GIT binary patch literal 648 zcmV;30(bq1P)Sxb0Y6MkDSd{nPwTp^L>b`TxVmKBiF^NLQ>My+_!0?|)hBPe_#}P$?rlUF;M20U z`oNWE|K(DrsR+gN%g)?+`OfqmmmiA8O_U(YfPnV(E$8mN{jZQVJ-L7LxzmTQJ^!PS zHqDyoKn&^H)Oq>Q$Nzns&wsn~^6P)|vPC&W#R9Kw95|FC`?q!91!~-K_R;^uDLWSs zj7A}sG%2IZxvQP(HeS-nn71T-`ku2F9(?#8KXKbp!Qe&~yaot4r%3=c-cDF`=YPn& z3!hUrzxqFO*Ny)VU;p?Y-nniMuVuI+UIUD>=B$ZZdhM^2Z-JeJcbDl-H)3?9>AG_?ve_7A86r2Wlb?y7)ShoTkzeah}rl)Oq{=a0=sekDkpZ?d4n{v>% zcgJPxg7sgx4Lmup8sO5j^?B5iYcCv|)*VgT_U6A?-trsfIcr`APCfD&B(EM;R_0K# z{lAb!kTg~UrQ ilDgypkCC?sx*7n