diff --git a/var/mongoose/cgi-bin/dedup.jim b/var/mongoose/cgi-bin/dedup.jim index 13e7199a..4d10c599 100755 --- a/var/mongoose/cgi-bin/dedup.jim +++ b/var/mongoose/cgi-bin/dedup.jim @@ -38,6 +38,7 @@ foreach file [readdir $dir] { set syn [$ts get synopsis] regsub -nocase -all -- {^new series\.* *} $syn "" syn regsub -nocase -all -- {^cbeebies\. *} $syn "" syn + regsub -nocase -all -- {^brand new series - *} $syn "" syn regsub -all -- { *[:].*$} $syn "" syn if {[string length $syn] > 40} { lassign [split $syn "."] v w diff --git a/var/mongoose/html/diag/diag.jim b/var/mongoose/html/diag/diag.jim index 64c1f443..6ec4337b 100755 --- a/var/mongoose/html/diag/diag.jim +++ b/var/mongoose/html/diag/diag.jim @@ -50,6 +50,20 @@ puts { +} + +if {[system model] eq "HDR"} { +puts { + + + + + +} +} + +puts { + diff --git a/var/mongoose/html/diag/script.js b/var/mongoose/html/diag/script.js index f493c2bb..e31b0ff7 100644 --- a/var/mongoose/html/diag/script.js +++ b/var/mongoose/html/diag/script.js @@ -49,6 +49,11 @@ $('#channelinfo').click(function(e) { window.location = '/cgi-bin/channel.jim'; }); +$('#dlna').click(function(e) { + e.preventDefault(); + window.location = '/dlna/dlna.jim'; +}); + $('#reboot').click(function(e) { e.preventDefault(); if (confirm('Are you sure you wish to perform a reboot now?')) diff --git a/var/mongoose/html/dlna/dlna.jim b/var/mongoose/html/dlna/dlna.jim new file mode 100755 index 00000000..be2c793e --- /dev/null +++ b/var/mongoose/html/dlna/dlna.jim @@ -0,0 +1,84 @@ +#!/mod/bin/jimsh + +package require cgi +package require sqlite3 +source /mod/var/mongoose/lib/setup +require ts.class pretty_size + +puts "Content-Type: text/html\r\n\r\n" + +cgi_input +#cgi_dump + +header + +#append dmsfile ".rr" + +set vars { + object.container 0 + object.item.videoItem.movie 0 + object.item.imageItem.photo 0 + object.item.audioItem.musicTrack 0 +} + +if {[file exists $dmsfile] && ![catch {set db [sqlite3.open $dmsfile]}]} { + catch { + foreach ret [$db query " + select class, count(*) from tblObject group by 1 + "] { + lassign $ret x class x num + set vars($class) $num + } + } + $db close +} + +if {[system param DMS_START_ON]} { + set cfgstat "Enabled" +} else { + set cfgstat "Disabled" +} + +if {[system is_listening 9000]} { + set stat "Running." + set img "745_1_10_Video_2Live.png" +} else { + set stat "Not running." + set img "745_1_11_Video_1REC.png" +} + +puts " + +
+DLNA Server Information + + + + + + + + + + + + + + + + + + + +
Server Status$cfgstat - $stat
Folders Indexed$vars(object.container)
Movies Indexed$vars(object.item.videoItem.movie)
Photos Indexed$vars(object.item.imageItem.photo)
Music Tracks Indexed$vars(object.item.audioItem.musicTrack)
+
+
+ +
+ +" + +footer + diff --git a/var/mongoose/html/dlna/reset.jim b/var/mongoose/html/dlna/reset.jim new file mode 100755 index 00000000..dd8eb873 --- /dev/null +++ b/var/mongoose/html/dlna/reset.jim @@ -0,0 +1,27 @@ +#!/mod/bin/jimsh + +source /mod/var/mongoose/lib/setup +require system.class + +puts "Content-Type: text/html" +puts "" + +set menupath "Settings->System->Internet Setting->Content Share" +set dbpath "/mnt/hd2/dms_cds.db" + +if {[system param DMS_START_ON] || [system is_listening 9000]} { + puts "To reset the DLNA Database, disable Content Sharing" + puts " in the Humax menus at
" + puts "$menupath
" + puts "and click the button again." +} elseif {![file exists $dbpath]} { + puts "The DLNA Database does not exist.
" + puts "(already reset?)" +} else { + file delete $dbpath + puts "The DLNA Database has been reset.
" + puts "You can now re-enable Content Sharing in the Humax menus." + puts "
" + puts "$menupath
" +} + diff --git a/var/mongoose/html/dlna/script.js b/var/mongoose/html/dlna/script.js new file mode 100644 index 00000000..62869f88 --- /dev/null +++ b/var/mongoose/html/dlna/script.js @@ -0,0 +1,11 @@ +$(function() { + +$('button').button(); + +$('#dlnareset').click(function(e) { + e.preventDefault(); + $('#results').empty().slideDown().load('reset.jim'); +}); + +}); + diff --git a/var/mongoose/lib/system.class b/var/mongoose/lib/system.class index 841ad38e..1c2a5d8b 100644 --- a/var/mongoose/lib/system.class +++ b/var/mongoose/lib/system.class @@ -119,25 +119,28 @@ proc {system restartpending} {} { close [open /tmp/.restartpending w] } -proc {system padding} {} { - set start 0 - set stop 0 +proc {system param} {param {type Value}} { if {[catch {set db [sqlite3.open /var/lib/humaxtv/setup.db]} msg]} { - return {0 0} + return 0 } - foreach l [$db query " - select itemName, itemValue + set val 0 + set ret [$db query " + select item$type from TBL_MENUCONFIG - where itemName in ('START_PADDING_TIME', 'STOP_PADDING_TIME') - "] { - lassign $l x name x val - switch $name { - "START_PADDING_TIME" { set start $val } - "STOP_PADDING_TIME" { set stop $val } - } + where itemName = '$param' + "] + if {[llength $ret] == 1} { + lassign [lindex $ret 0] x val } $db close - return [list $start $stop] + return $val +} + +proc {system padding} {} { + return [list \ + [system param START_PADDING_TIME] \ + [system param STOP_PADDING_TIME] \ + ] } proc {system mkdir_p} {dir} {