forked from hummypkg/webif
Merge branch 'master' into df-commandcheck-patch
This commit is contained in:
commit
11e010ed3b
@ -1,7 +1,7 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 1.4.8-10
|
||||
Version: 1.4.8-11
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hpkg.tv
|
||||
Depends: tcpfix,webif-channelicons(>=1.1.27),lighttpd(>=1.4.39-1),jim(>=0.79),jim-pack(>=0.79),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-2),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),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.13),webif-charts(>=1.2-1),stripts(>=1.4.2),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.98),sqlite3(>=3.15.1),jim-xconv,zip(>=3.0-1),wget
|
||||
|
@ -26,6 +26,9 @@ if {[file isdirectory $file]} {
|
||||
set new [string map {"\n" ""} [
|
||||
string trim [cgi_get "rename_$attr"]]]
|
||||
set old [$ts get $attr]
|
||||
if {$attr eq "title" || $attr eq "synopsis"} {
|
||||
set new "\025$new"
|
||||
}
|
||||
if {$new ne $old} {
|
||||
if {$attr eq "guidance" ||
|
||||
[string length $new] > 0} {
|
||||
|
@ -54,6 +54,28 @@ class settings {
|
||||
rtschedule 0
|
||||
}
|
||||
|
||||
proc {settings _safer_query} { queryText args } {
|
||||
global settingsdb
|
||||
|
||||
# allow 4 tries from 0.5s delay, doubling, to get access
|
||||
for {set lockCnt 4; set delay 0.5} {true} {sleep $delay; set delay $(2*$delay)} {
|
||||
try {
|
||||
return [$settingsdb query $queryText {*}$args]
|
||||
} on error {msg opts} {
|
||||
if {[string first "database is locked" $msg] >= 0} {
|
||||
if {[incr lockCnt -1] > 0} {
|
||||
continue
|
||||
} else {
|
||||
# raise error from caller
|
||||
set msg "Persistently unable to access Settings: database locked"
|
||||
incr opts(-level)
|
||||
}
|
||||
}
|
||||
return {*}$opts $msg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settings method hostname {{name ""}} {
|
||||
if {$name == ""} {
|
||||
# Get
|
||||
@ -104,11 +126,10 @@ settings method smtp_server {{server ""}} {
|
||||
}
|
||||
|
||||
settings method _nval_setting {name {val -1}} {
|
||||
global settingsdb
|
||||
|
||||
if {$val == -1} {
|
||||
# Get
|
||||
set res [$settingsdb query "
|
||||
set res [settings _safer_query "
|
||||
select nval from settings
|
||||
where name = '$name'
|
||||
"]
|
||||
@ -118,7 +139,7 @@ settings method _nval_setting {name {val -1}} {
|
||||
return 0
|
||||
} else {
|
||||
# Set
|
||||
$settingsdb query "
|
||||
settings _safer_query "
|
||||
replace into settings(name,nval)
|
||||
values('$name', $val)
|
||||
"
|
||||
@ -127,11 +148,10 @@ settings method _nval_setting {name {val -1}} {
|
||||
}
|
||||
|
||||
settings method _tval_setting {name {val -1} {def 0}} {
|
||||
global settingsdb
|
||||
|
||||
if {$val eq "-1"} {
|
||||
# Get
|
||||
set res [$settingsdb query "
|
||||
set res [settings _safer_query "
|
||||
select tval from settings
|
||||
where name = '$name'
|
||||
"]
|
||||
@ -141,7 +161,7 @@ settings method _tval_setting {name {val -1} {def 0}} {
|
||||
return $def
|
||||
} else {
|
||||
# Set
|
||||
$settingsdb query "
|
||||
settings _safer_query "
|
||||
replace into settings(name,tval)
|
||||
values('$name', '%s')
|
||||
" $val
|
||||
|
@ -354,13 +354,14 @@ ts method mkbmps {{offset 0}} {
|
||||
|
||||
ts method mkbmp {{offset 0} {ext ""}} {
|
||||
set bfile [file rootname $file]
|
||||
set bmpfile "$bfile$ext.bmp"
|
||||
set cmd [list /mod/bin/ffmpeg -loglevel fatal -ss $offset -i $file \
|
||||
-frames 1 -pix_fmt argb -vf vflip -s 140x78 "$bfile$ext.bmp"]
|
||||
if {[catch { exec {*}$cmd } msg]} {
|
||||
puts "ERROR: $msg"
|
||||
return 0
|
||||
-frames 1 -pix_fmt argb -vf vflip -s 140x78 -y $bmpfile]
|
||||
catch { exec {*}$cmd }
|
||||
if {![catch { file stat $bmpfile stbmp }]} {
|
||||
if {[dict get $stbmp size] != 0} { return 1 }
|
||||
}
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
ts method mkthm {{offset 0}} {
|
||||
|
Loading…
Reference in New Issue
Block a user