diff --git a/CONTROL/control b/CONTROL/control index 6fd3612..b008bb4 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.3.0-1 +Version: 1.3.0-2 Architecture: mipsel Maintainer: af123@hpkg.tv -Depends: tcpfix,webif-channelicons(>=1.1.22-1),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.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1-1),hmt(>=2.0.9),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.6),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) +Depends: tcpfix,webif-channelicons(>=1.1.22-2),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.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.9),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.7),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) Suggests: Description: An evolving web interface for the Humax. Tags: http://hummy.tv/forum/threads/7116/ diff --git a/webif/cgi-bin/epg/info.jim b/webif/cgi-bin/epg/info.jim index e74d769..84c5465 100755 --- a/webif/cgi-bin/epg/info.jim +++ b/webif/cgi-bin/epg/info.jim @@ -12,7 +12,8 @@ set service [cgi_get service 0] set event [cgi_get event 0] if {![cgi_exists bare]} header else noheader -set record [lindex [epg fetch dump -service $service -event $event] 0] +set record [lindex [\ + epg dbfetch dump -nosort 1 -service $service -event $event] 0] $record get_channel_info set others [$record othertimes] diff --git a/webif/cgi-bin/epg/schedule.jim b/webif/cgi-bin/epg/schedule.jim index 7343f05..1552245 100755 --- a/webif/cgi-bin/epg/schedule.jim +++ b/webif/cgi-bin/epg/schedule.jim @@ -15,7 +15,8 @@ if {$service eq "-" || $event eq "-"} { exit } -set event [lindex [epg fetch dump -service $service -event $event] 0] +set event [lindex [\ + epg dbfetch dump -nosort 1 -service $service -event $event] 0] if {$event eq ""} { puts "Error, cannot find event to schedule." exit diff --git a/webif/html/browse/epgtitle.jim b/webif/html/browse/epgtitle.jim index 46a59e3..ff5616c 100755 --- a/webif/html/browse/epgtitle.jim +++ b/webif/html/browse/epgtitle.jim @@ -2,7 +2,7 @@ package require cgi source /mod/webif/lib/setup -require ts.class +require ts.class escape httpheader "application/json" @@ -10,14 +10,10 @@ set file [cgi_get file] if {$file == 0} exit set ts [ts fetch $file] -proc esc {str} { - return [string map {"\n" " "} $str] -} - puts "{" -puts "\"title\" : \"[esc [$ts get title]]\"," -puts "\"synopsis\" : \"[esc [$ts get synopsis]]\"," -puts "\"guidance\" : \"[esc [$ts get guidance]]\"," -puts "\"genre\" : [esc [$ts get genre]]" +puts "\"title\" : \"[jescape [$ts get title]]\"," +puts "\"synopsis\" : \"[jescape [$ts get synopsis]]\"," +puts "\"guidance\" : \"[jescape [$ts get guidance]]\"," +puts "\"genre\" : [jescape [$ts get genre]]" puts "}" diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim index dd1a16e..3ae1b87 100755 --- a/webif/html/browse/index.jim +++ b/webif/html/browse/index.jim @@ -203,6 +203,9 @@ proc entry {file} {{i 0}} { lassign [ts iconset $ts] icons attrs puts [join $icons ""] + } elseif {$ext eq ".mp3"} { + # Will be completed using an ajax call. + icon "/img/blank.gif" "" "" "va mp3icon" } # Indexed diff --git a/webif/html/browse/mp3.jim b/webif/html/browse/mp3.jim new file mode 100755 index 0000000..416e11b --- /dev/null +++ b/webif/html/browse/mp3.jim @@ -0,0 +1,28 @@ +#!/mod/bin/jimsh + +package require cgi +source /mod/webif/lib/setup +require escape + +httpheader "application/json" + +set dir [cgi_get dir "/media/My Video/test"] + +puts "{" +foreach file [readdir $dir] { + if {[file extension $file] ne ".mp3"} continue + + if {[catch { + set lines [exec ffprobe -v error -show_streams "$dir/$file"] + }]} continue + + foreach line $lines { + if {[string match "codec_name=mp*" $line]} { + puts "\"[jescape $file]\": \"[string range $line 11 end]\"," + } + } +} + +puts "\"dummy\":0" +puts "}" + diff --git a/webif/html/browse/newdir.jim b/webif/html/browse/newdir.jim index a8c7cd6..5839ef8 100755 --- a/webif/html/browse/newdir.jim +++ b/webif/html/browse/newdir.jim @@ -3,6 +3,7 @@ package require cgi package require pack source /mod/webif/lib/setup +require escape httpheader "application/json" @@ -21,7 +22,7 @@ foreach dir [glob -nocomplain "$root"] { set diff $($recs - $plays) if {$diff > 0} { set node [lindex [split $dir /] end] - puts "\"$node\": $diff," + puts "\"[jescape $node]\": $diff," } } } diff --git a/webif/html/browse/script.js b/webif/html/browse/script.js index d00e717..6326c3a 100755 --- a/webif/html/browse/script.js +++ b/webif/html/browse/script.js @@ -894,6 +894,25 @@ $.getJSON('/browse/sizes.jim', {dir: dir}, folder_size_callback); // Flag folders with unwatched items $.getJSON('/browse/newdir.jim', {dir: dir}, new_folder_callback); +// Populate MPĀ3 icons (if any found) +if ($('img.mp3icon')) +{ + $.getJSON('/browse/mp3.jim', {dir: dir}, function(data, status, xhr) { + $.each(data, function(file, type) { + if (type == 'mp2') + alt = 'MPEG-1 Audio Layer III (MP3)'; + else if (type == 'mp3') + alt = 'MPEG-1 Audio Layer II (MP2)'; + else + alt = type; + $('a.bf[file$="/' + encodeURIComponent(file) + '"]') + .siblings('img.mp3icon') + .attr('src', '/img/mp3_' + type + '.png') + .attr('alt', alt).attr('title', alt); + }); + }); +} + // Load clipboard reloadclipboard(); diff --git a/webif/html/browse/shrunk.jim b/webif/html/browse/shrunk.jim index 09b274a..cb72c9d 100755 --- a/webif/html/browse/shrunk.jim +++ b/webif/html/browse/shrunk.jim @@ -2,7 +2,7 @@ package require cgi source /mod/webif/lib/setup -require ts.class +require ts.class escape httpheader "application/json" @@ -27,7 +27,7 @@ foreach file [readdir -nocomplain $dir] { if {!$eit} { $ts set_shrunk } } - puts " \"$file\": $eit," + puts " \"[jescape $file]\": $eit," } puts " \"dummy\": 0" puts "}" diff --git a/webif/html/browse/sizes.jim b/webif/html/browse/sizes.jim index 9413652..143e262 100755 --- a/webif/html/browse/sizes.jim +++ b/webif/html/browse/sizes.jim @@ -32,7 +32,7 @@ foreach file [readdir $dir] { if {[lindex $fields 1] eq $lk} { set node [file tail $file] set size [lindex $fields 0] - puts "\"$node\" : \"@$size\"," + puts "\"[jescape $node]\" : \"@$size\"," } } } diff --git a/webif/html/css/style.css b/webif/html/css/style.css index 8ad8032..d5f206d 100644 --- a/webif/html/css/style.css +++ b/webif/html/css/style.css @@ -109,7 +109,7 @@ div.warningbox top: -2px; left: -2px; font-weight: bold; - #z-index: 30; + z-index: 30; box-shadow: 2px 2px 11px #666; -moz-box-shadow: 2px 2px 11px #666; -webkit-box-shadow: 2px 2px 11px #666; diff --git a/webif/html/img/headphones.png b/webif/html/img/headphones.png new file mode 100644 index 0000000..98233fd Binary files /dev/null and b/webif/html/img/headphones.png differ diff --git a/webif/html/img/mp3_mp2.png b/webif/html/img/mp3_mp2.png new file mode 120000 index 0000000..26309fa --- /dev/null +++ b/webif/html/img/mp3_mp2.png @@ -0,0 +1 @@ +radio.png \ No newline at end of file diff --git a/webif/html/img/mp3_mp3.png b/webif/html/img/mp3_mp3.png new file mode 120000 index 0000000..c273e69 --- /dev/null +++ b/webif/html/img/mp3_mp3.png @@ -0,0 +1 @@ +headphones.png \ No newline at end of file diff --git a/webif/html/sched/list/index.jim b/webif/html/sched/list/index.jim index 645f93e..87633b4 100755 --- a/webif/html/sched/list/index.jim +++ b/webif/html/sched/list/index.jim @@ -26,6 +26,7 @@ if {[llength $conflicts] > 1} { } require epg_popup +puts "" set pkey_tags { 1 "Pending unschedule" diff --git a/webif/html/sched/visual/index.jim b/webif/html/sched/visual/index.jim index b32745b..044292c 100755 --- a/webif/html/sched/visual/index.jim +++ b/webif/html/sched/visual/index.jim @@ -183,7 +183,8 @@ proc showevent {s class &overflow &tomorrow &pxpos start end usedhours daystart set slotid [$s get ulslot] } if {$service > 0} { - set epgs [epg dbfetch dump -service $service -event $event] + set epgs [epg dbfetch dump \ + -nosort 1 -service $service -event $event] if {[llength $epgs] == 1} { lassign $epgs epg set name [$epg get name] diff --git a/webif/html/settings/modules/epg/settings.hook b/webif/html/settings/modules/epg/settings.hook index af3ae1f..12aae39 100755 --- a/webif/html/settings/modules/epg/settings.hook +++ b/webif/html/settings/modules/epg/settings.hook @@ -116,6 +116,7 @@ puts " " +setting_toggle "Grid EPG Fixed Scrolling?" epgscroll $epgscroll setting_toggle "De-duplicate genre search results?" genrededup $genrededup puts " diff --git a/webif/html/settings/settings.jim b/webif/html/settings/settings.jim index 0156213..d13427f 100755 --- a/webif/html/settings/settings.jim +++ b/webif/html/settings/settings.jim @@ -36,6 +36,7 @@ set hostname [$settings hostname] set smtp_server [$settings smtp_server] set channel_group [$settings channel_group] set epg_style [$settings epg_style] +set epgscroll [$settings epgscroll] set service_style [$settings service_style] set notoolbar [$settings notoolbar] set tvdb [$settings tvdb] @@ -93,6 +94,7 @@ handle_str_update hostname $hostname Hostname _handle_update ascii smtp_server $smtp_server "SMTP Server" handle_int_update channel_group $channel_group "Channel Group" handle_int_update xepghours $xepghours "Grid EPG Hours" +handle_int_update epgscroll $epgscroll "Fixed EPG Scrolling" handle_str_update epg_style $epg_style "EPG Type" handle_str_update service_style $service_style "EPG Channel Type" handle_int_update pkgdev $pkgdev "Development Package Display" diff --git a/webif/html/xepg/index.jim b/webif/html/xepg/index.jim index 10af58c..44d972d 100755 --- a/webif/html/xepg/index.jim +++ b/webif/html/xepg/index.jim @@ -12,16 +12,16 @@ require epg.class spinner.class altrow epg_search totop system.class set irinst [system pkginst ir] -set s [settings] +set settings [settings] -if {[$s chanchangenc]} { +if {[$settings chanchangenc]} { puts { } } else { jqplugin confirmAction puts { } } -if {[$s service_style] eq "standard"} { +if {[$settings service_style] eq "standard"} { set surl xservice } else { set surl service @@ -44,7 +44,7 @@ if {$stt <= $now} { set current 0 } -set favgroup [$s channel_group] +set favgroup [$settings channel_group] set hours [cgi_get hours -] if {$hours eq "-"} { @@ -77,13 +77,11 @@ set secpx $($minpx / 60.0) set start [clock milliseconds] if {$::qepg} { + set args [list -trange "$stt:$ett" -ljoin 1] if {$favgroup} { - set records [epg dbfetch dump \ - -trange "$stt:$ett" -fav $favgroup] - } else { - set records [epg dbfetch dump -trange "$stt:$ett"] + lappend args -fav $favgroup } - + set records [epg dbfetch dump {*}$args] } else { require channelsort set records [channelsort [epg fetch dump -trange "$stt:$ett"]] @@ -211,9 +209,14 @@ jscss script.js puts "
-
" +if {[$settings epgscroll]} { + puts "
" +} else { + puts "
" +} + set lim 0 set lcn 0 set bg "odd" diff --git a/webif/html/xepg/style.css b/webif/html/xepg/style.css index ebad09f..a6b1721 100644 --- a/webif/html/xepg/style.css +++ b/webif/html/xepg/style.css @@ -1,6 +1,8 @@ div#xepg { + clear: left; position: relative; + overflow: visible; } div#xepgnow diff --git a/webif/lib/epg.class b/webif/lib/epg.class index 33c90c9..4c66a6d 100644 --- a/webif/lib/epg.class +++ b/webif/lib/epg.class @@ -398,7 +398,7 @@ proc {epg dbfetch} {mode args} { " set from " - from TBL_SVC c left join epg.epg e + from epg.epg e join TBL_SVC c on e.service_id = c.usSvcId " @@ -411,6 +411,12 @@ proc {epg dbfetch} {mode args} { set v $args($arg) switch -- $arg { -debug { set debug $v } + -ljoin { + set from " + from TBL_SVC c left join epg.epg e + on e.service_id = c.usSvcId + " + } -crid { append q \ "and e.event_crid = '$v' " } -scrid { append q \ @@ -428,6 +434,7 @@ proc {epg dbfetch} {mode args} { -before { append q \ "and e.start < $v " } -sort { set sort "order by $v" } + -nosort { set sort "" } -trange { lassign [split $v :] stt ett append q "and (e.start is null or diff --git a/webif/lib/escape b/webif/lib/escape index 4e1afbc..76d3f19 100644 --- a/webif/lib/escape +++ b/webif/lib/escape @@ -1,8 +1,14 @@ -if {![exists -proc escape]} { - proc escape {str} { - regsub -all -- {"} "$str" "\\\"" str - return $str +if {![exists -proc jescape]} { + proc jescape {str} { + return [string map { + "\"" "\\\"" + "\n" " " + } $str] + #regsub -all -- {"} "$str" "\\\"" str + #return $str } + + alias escape jescape } diff --git a/webif/lib/settings.class b/webif/lib/settings.class index c51cff0..be00902 100644 --- a/webif/lib/settings.class +++ b/webif/lib/settings.class @@ -32,6 +32,7 @@ class settings { nounwatchedcount 0 hidevisualota 0 xepghours 4 + epgscroll 0 genrededup 0 autolog 0 changechangenc 0 @@ -143,6 +144,10 @@ settings method xepghours {{hours -1}} { return [$self _nval_setting xepghours $hours] } +settings method epgscroll {{val -1}} { + return [$self _nval_setting epgscroll $val] +} + settings method epg_style {{style -1}} { if {$style != -1} { if {$style eq "grid"} { set style 1 } else { set style 0 }