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 0000000..f215d6f Binary files /dev/null and b/webif/html/img/cut.png differ diff --git a/webif/lib/system.class b/webif/lib/system.class index a7a3a52..ac71ab6 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -759,9 +759,13 @@ proc {system checkop} {op} { return $ret } -proc {system startop} {op file} { +proc {system startop} {args op file} { if {![regexp -nocase -- {^[a-z0-9]+$} $op]} { return 0 } - if {[dict exists $::system::ops $op]} { + if {"-multiple" in $args} { + set i 1 + while {[dict exists $::system::ops "$op$i"]} { incr i } + append op $i + } elseif {[dict exists $::system::ops $op]} { system endop $op } if {[catch { @@ -775,7 +779,7 @@ proc {system startop} {op file} { error "Could not lock op file." } }]} { return 0 } - return 1 + return $op } proc {system endop} {op} {