From f7933beaf86bc66b84fb3daa79d8a17f6a1e4e34 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Mon, 7 Jan 2013 21:32:06 +0000 Subject: [PATCH] tweak genre code, table in ts.class git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1320 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 4 ++-- var/mongoose/cgi-bin/browse.jim | 25 +++++++++++----------- var/mongoose/cgi-bin/browse/assets.jim | 29 ++++++++++++++++++-------- var/mongoose/lib/ts.class | 14 +++++++++++++ 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 4d62b88..8347c34 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,9 @@ Package: webif Priority: optional Section: web -Version: 0.10.2 +Version: 0.10.2-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.5),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.9-1),hmt(>=1.1.8),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.04) +Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.5),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.9-1),hmt(>=1.1.10),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.04) Suggests: ffmpeg Description: An evolving web interface for the Humax. diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index 80ec0b0..51c7d2d 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -148,20 +148,19 @@ proc entry {file} {{i 0}} { set bx 0 set dlna 0 if {$type eq "ts"} { - # Genre - switch [$ts get genre] { - 16 { set img "Movie" } - 32 { set img "News" } - 48 { set img "Special" } - 64 { set img "Sports" } - 80 { set img "Children" } - 96 { set img "Education" } - 160 { set img "Leisure" } - 240 { set img "Show" } - default { set img "Unclassified" } + set genre [$ts get genre] + set glist [ts genrelist] + if {[dict exists $glist $genre]} { + set ret $glist($genre) + } else { + set ret $glist(0) + } + lassign $ret txt img + if {$img eq "Unclassified"} { + icon "/images/173_3_26_G3_$img.png" $txt + } else { + icon "/images/173_3_00_G3_$img.png" $txt } - #icon "/images/173_1_00_G1_$img.png" - icon "/images/173_3_00_G3_$img.png" $img # HD / SD if {[$ts get definition] eq "HD"} { diff --git a/var/mongoose/cgi-bin/browse/assets.jim b/var/mongoose/cgi-bin/browse/assets.jim index 0cc3a3f..1b8c837 100755 --- a/var/mongoose/cgi-bin/browse/assets.jim +++ b/var/mongoose/cgi-bin/browse/assets.jim @@ -129,16 +129,27 @@ puts { diff --git a/var/mongoose/lib/ts.class b/var/mongoose/lib/ts.class index efd68c2..688e9d2 100644 --- a/var/mongoose/lib/ts.class +++ b/var/mongoose/lib/ts.class @@ -249,3 +249,17 @@ proc {ts renamegroup} {from to} { } } +proc {ts genrelist} {} { + return { + 0 { Unclassified Unclassified } + 16 { Film Movie } + 32 { "News & Factual" News } + 64 { Sport Sports } + 80 { Children Children } + 96 { Entertainment Special } + 144 { Education Education } + 160 { Lifestyle Leisure } + 240 { Drama Show } + } +} +