From cffa6cca1bef909ee71888ccdaf619e521afeefa Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 16 Sep 2015 21:07:39 +0000 Subject: [PATCH] ts flag hook git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2467 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 4 +-- webif/html/browse/index.jim | 57 ++++---------------------------- webif/html/diag/channel.jim | 4 +-- webif/lib/browse.class | 65 ++++++++++++++++++++++++++++++++++++- webif/lib/ts.class | 17 ++++++++-- 5 files changed, 88 insertions(+), 59 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 39005c0a..fe72f85b 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.2.4-4 +Version: 1.2.4-6 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.35-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=2.0.5),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),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7) +Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.35-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=2.0.7),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),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7) Suggests: Description: An evolving web interface for the Humax. Tags: http://hummy.tv/forum/threads/6484/ diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim index b4849c6a..dcde48f4 100755 --- a/webif/html/browse/index.jim +++ b/webif/html/browse/index.jim @@ -177,13 +177,7 @@ proc entry {file} {{i 0}} { # Icons - set locked 0 - set encd 0 - set odencd 1 - set def unknown - set bx 0 - set dlna 0 - set shrunk 0 + set attrs {} if {$type eq "ts"} { if {$bfile in $dinuse} { icon "/img/inuse.png" @@ -204,47 +198,9 @@ proc entry {file} {{i 0}} { icon "/images/173_3_00_G3_$img.png" $txt "" "va genre" } - # HD / SD - if {[$ts get definition] eq "HD"} { - set def HD - set img "172_1_00_HD" - } else { - set def SD - set img "172_1_26_SD" - } - icon "/images/$img.png" + lassign [ts iconset $ts] icons attrs - # Locked - if {[$ts flag "Locked"] > 0} { - set locked 1 - icon "/images/178_1_00_Icon_Lock.png" "Locked" - } - - # Encrypted - if {[$ts flag "Encrypted"] > 0} { - set encd 1 - icon "/images/749_1_26_Video_Encryption.png" "" - } - if {![$ts flag "ODEncrypted"]} { - set odencd 0 - icon "/img/Decrypted.png" "Decrypted" - } - - # Guidance - if {[$ts flag "Guidance"] > 0} { - icon "/img/Guidance_purple.png" - } - if {[$ts flag "GGuidance"] > 0} { - icon "/img/Guidance_blue.png" - } - - # Shrunk - if {[$ts flag Shrunk]} { - icon "/img/compress.png" "Shrunk" - set shrunk 1 - } - - set bx [$ts get bookmarks] + puts [join $icons ""] } # Indexed @@ -259,9 +215,8 @@ proc entry {file} {{i 0}} { puts "
@@ -274,7 +229,7 @@ proc entry {file} {{i 0}} { source assets.jim -if {!$dlnaok} { +if {!$dlnaok && ![system instandby]} { puts { Note: Content Sharing is disabled on this system. diff --git a/webif/html/diag/channel.jim b/webif/html/diag/channel.jim index 40c16ca8..bf4d7ed4 100755 --- a/webif/html/diag/channel.jim +++ b/webif/html/diag/channel.jim @@ -78,13 +78,11 @@ foreach tw [$db query { "Channel 4 HD" - "BBC ONE HD" { set mux "PSB3/BBC B" } "5 USA" - - "CITV" - "ITV3" { set mux "COM4/SDN" } "Really" - "Dave" { set mux "COM5/ARQ A" } "4Music" - - "Yesterday" - - "ITV4" { set mux "COM6/ARQ B" } + "Yesterday" { set mux "COM6/ARQ B" } "BBC FOUR HD" - "BBC NEWS HD" { set mux "COM7/ARQ C" } "Made In *" - diff --git a/webif/lib/browse.class b/webif/lib/browse.class index dea3e2e4..f356cab8 100644 --- a/webif/lib/browse.class +++ b/webif/lib/browse.class @@ -49,7 +49,6 @@ proc {dir iconset} {dir} { lappend attrs "autoshrink=1" } - set autodedup 0 if {[file exists "$dir/.autodedup"]} { set autodedup 1 @@ -98,3 +97,67 @@ proc {dir iconset} {dir} { return [list $icons $attrs] } +proc {ts iconset} {ts} { + set icons {} + set attrs {} + + # HD / SD + if {[$ts get definition] eq "HD"} { + set def HD + set img "172_1_00_HD" + } else { + set def SD + set img "172_1_26_SD" + } + lappend icons [_addicon "/images/$img.png"] + lappend attrs "def=$def" + + # Locked + set locked 0 + if {[$ts flag "Locked"] > 0} { + set locked 1 + lappend icons [_addicon "/images/178_1_00_Icon_Lock.png" + "Locked"] + } + lappend attrs "locked=$locked" + + # Encrypted + set encd 0 + if {[$ts flag "Encrypted"] > 0} { + set encd 1 + lappend icons [_addicon "/images/749_1_26_Video_Encryption.png" + ""] + } + lappend attrs "encd=$encd" + + # Encrypted on disk + set odencd 1 + if {![$ts flag "ODEncrypted"]} { + set odencd 0 + lappend icons [_addicon "/img/Decrypted.png" "Decrypted"] + } + lappend attrs "odencd=$odencd" + + # Guidance + if {[$ts flag "Guidance"] > 0} { + lappend icons [_addicon "/img/Guidance_purple.png"] + } + if {[$ts flag "GGuidance"] > 0} { + lappend icons [_addicon "/img/Guidance_blue.png"] + } + + # Shrunk + set shrunk 0 + if {[$ts flag Shrunk]} { + set shrunk 1 + lappend icons [_addicon "/img/compress.png" "Shrunk"] + } + lappend attrs "shrunk=$shrunk" + + lappend attrs "bx=[$ts get bookmarks]" + + eval_plugins tsiconset + + return [list $icons $attrs] +} + diff --git a/webif/lib/ts.class b/webif/lib/ts.class index 0689a7be..290c3417 100644 --- a/webif/lib/ts.class +++ b/webif/lib/ts.class @@ -105,12 +105,21 @@ ts method lock {} { return 1 } +set ::ts::flagmap { + detectads Addetection + dedup Deduped +} + ts method setflag {flag} { set cmd [list /mod/bin/hmt +$flag $file] if {[catch {exec {*}$cmd}]} { throw 20 "Unknown flag." } - ladd flags $flag + if {[dict exists $::ts::flagmap $flag]} { + ladd flags $::ts::flagmap($flag) + } else { + ladd flags [string totitle $flag] + } return 1 } @@ -120,7 +129,11 @@ ts method unsetflag {flag} { if {[catch {exec {*}$cmd}]} { throw 20 "Unknown flag." } - lremove flags $flag + if {[dict exists $::ts::flagmap $flag]} { + lremove flags $::ts::flagmap($flag) + } else { + lremove flags [string totitle $flag] + } return 1 }