Compare commits

..

25 Commits

Author SHA1 Message Date
hummypkg
a001241c5d remove unecessary css files
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1869 2a923420-c742-0410-a762-8d5b09965624
2014-04-30 21:17:23 +00:00
hummypkg
a8a9f041f0 Upgrade jquery mobile
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1868 2a923420-c742-0410-a762-8d5b09965624
2014-04-30 21:15:31 +00:00
hummypkg
67df756156 add mongoose symlink
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1864 2a923420-c742-0410-a762-8d5b09965624
2014-04-30 14:45:44 +00:00
hummypkg
a73afaf951 relocate var/mongoose
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1863 2a923420-c742-0410-a762-8d5b09965624
2014-04-30 14:44:57 +00:00
hummypkg
fe439ec25a remove webif symlink
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1862 2a923420-c742-0410-a762-8d5b09965624
2014-04-30 14:43:49 +00:00
hummypkg
2fa55d3c90 fix automatic backups and slidedown menu
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1861 2a923420-c742-0410-a762-8d5b09965624
2014-04-30 14:39:25 +00:00
hummypkg
c76e6638a4 fix modversion.jim
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1856 2a923420-c742-0410-a762-8d5b09965624
2014-04-27 14:49:46 +00:00
hummypkg
cd3cbf186c fix mobile interface, settings
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1851 2a923420-c742-0410-a762-8d5b09965624
2014-04-23 12:59:30 +00:00
hummypkg
38956e2669 fix scheduled check
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1850 2a923420-c742-0410-a762-8d5b09965624
2014-04-23 11:56:55 +00:00
hummypkg
62a13e18cc version 1.0.11
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1848 2a923420-c742-0410-a762-8d5b09965624
2014-04-22 00:03:29 +00:00
hummypkg
52d05a7f48 update jquery
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1839 2a923420-c742-0410-a762-8d5b09965624
2014-04-14 23:00:15 +00:00
hummypkg
612a61a5b1 removing legacy directories
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1838 2a923420-c742-0410-a762-8d5b09965624
2014-04-14 22:56:06 +00:00
hummypkg
17ba0bb00e remove SSI
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1837 2a923420-c742-0410-a762-8d5b09965624
2014-04-14 22:54:01 +00:00
hummypkg
5f473c9e72 add ts iterate
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1833 2a923420-c742-0410-a762-8d5b09965624
2014-04-03 20:21:40 +00:00
hummypkg
e0ac834c78 preserve more timestamps
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1832 2a923420-c742-0410-a762-8d5b09965624
2014-04-02 21:14:23 +00:00
hummypkg
604ac65172 fix grid problem
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1828 2a923420-c742-0410-a762-8d5b09965624
2014-03-27 21:34:27 +00:00
hummypkg
dad2a630c7 fix strip et al. with no thumbnail
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1827 2a923420-c742-0410-a762-8d5b09965624
2014-03-26 21:48:09 +00:00
hummypkg
2bf876262f checkbox fixes, glob removal
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1825 2a923420-c742-0410-a762-8d5b09965624
2014-03-24 21:07:32 +00:00
hummypkg
972eab191c fix pretty size
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1819 2a923420-c742-0410-a762-8d5b09965624
2014-03-03 17:30:17 +00:00
hummypkg
9fd84a8938 use file size over file stat, add mp3 type preference
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1814 2a923420-c742-0410-a762-8d5b09965624
2014-03-03 14:00:46 +00:00
hummypkg
ceccfd9c1d update to Jim 0.75
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1811 2a923420-c742-0410-a762-8d5b09965624
2014-03-02 18:44:41 +00:00
hummypkg
c948926cc2 fix typo
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1806 2a923420-c742-0410-a762-8d5b09965624
2014-02-24 19:46:44 +00:00
hummypkg
a087581573 fix scroll position
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1805 2a923420-c742-0410-a762-8d5b09965624
2014-02-23 22:47:01 +00:00
hummypkg
3416d4e9e2 fixes
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1804 2a923420-c742-0410-a762-8d5b09965624
2014-02-23 22:22:07 +00:00
hummypkg
b4af9b62fc fix URL
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1802 2a923420-c742-0410-a762-8d5b09965624
2014-02-21 23:22:19 +00:00
774 changed files with 4827 additions and 2349 deletions

View File

@@ -1,10 +1,11 @@
Package: webif
Priority: optional
Section: web
Version: 1.0.9
Version: 1.0.11-5
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.9),mongoose(>=3.0.11),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6)
Depends: webif-channelicons(>=1.1.10),mongoose(>=3.0.11),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6)
Conflicts: tvdiary(<0.0.2-6)
Suggests:
Description: An evolving web interface for the Humax. [Replacement single-channel view screen (in-progress).]
Tags: http://hummy.tv/forum/threads/webif-version-1-0-8-released.4553/
Description: An evolving web interface for the Humax.
Tags: http://hummy.tv/forum/threads/4723/

View File

@@ -19,7 +19,7 @@ fi
ana=$PKG_ROOT/etc/anacrontab
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
cat $tmpf - << EOM > $ana
1 8 sched_backup /mod/webif/cgi-bin/backup/backup.jim
1 8 sched_backup /mod/webif/html/backup/backup.jim
1 5 diskattrs /mod/webif/lib/bin/diskattrs
EOM

16
CONTROL/preinst Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Handle moving the legacy /var/mongoose directory to /webif..
if [ -h /mod/webif -a -d /var/mongoose ]; then
echo "Relocating web interface files..."
cd /mod
rm webif || exit 1
mv var/mongoose webif || exit 1
cd var
ln -s ../webif mongoose
fi
exit 0

1
var/mongoose Symbolic link
View File

@@ -0,0 +1 @@
../webif

View File

@@ -1,9 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
httpheader "text/plain"
foreach f [dict keys $env] {
puts "$f = $env($f)"
}

View File

@@ -1,4 +0,0 @@
<!--#include virtual="/lib/header.shtml" -->
<!--#exec cmd="/mod/webif/include/backup.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@@ -1 +0,0 @@
../lib/jquery.iphone-style-checkboxes/iphone-style-checkboxes.css

View File

@@ -1,33 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require system.class chunked
cgi_input
#cgi_dump
set diag [cgi_get diag general]
start_chunked
if {[system modversion 1] < 113} {
chunk ">>> Diagnostics only available with customised firmware 1.13 or above."
end_chunked
exit
}
chunk ">>> Beginning diagnostic $diag\r\n"
set bcmd "|/bin/diag $diag"
set fd [open $bcmd r]
while {[gets $fd line] >= 0} {
chunk "$line\r\n"
#chunk_pad
}
close $fd
chunk "\r\n"
chunk ">>> Ending diagnostic $diag\r\n"
end_chunked

View File

@@ -1,4 +0,0 @@
<!--#include virtual="/lib/header.shtml" -->
<!--#exec cmd="/mod/webif/include/epg.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@@ -1 +0,0 @@
../lib/jquery.plugin/easing/easing.js

View File

@@ -1 +0,0 @@
../lib/jquery.plugin/iajax/iajax.js

View File

@@ -1 +0,0 @@
../lib/jquery.iphone-style-checkboxes/iphone-style-checkboxes.js

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
jquery-1.10.2.min.js

View File

@@ -1 +0,0 @@
../lib/jquery.plugin/ui.totop/jquery.ui.totop.js

View File

@@ -1 +0,0 @@
<!--#exec cmd="/mod/webif/html/lib/footer.jim" -->

View File

@@ -1 +0,0 @@
<!--#exec cmd="/mod/webif/html/lib/header.jim" -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@@ -1,36 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- Need to get a proper redirect hooked up. Blech. -->
<meta http-equiv="refresh" content="0;url=demos/">
<meta name="robots" content="noindex, follow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile</title>
<link rel="stylesheet" href="css/themes/default/jquery.mobile-1.3.2.min.css">
<link rel="stylesheet" href="demos/_assets/css/jqm-demos.css">
<link rel="shortcut icon" href="demos/_assets/favicon.ico">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
<script src="js/jquery.js"></script>
<script src="demos/_assets/js/index.js"></script>
<script src="js/jquery.mobile-1.3.2.min.js"></script>
<script>
$( document ).on( "pageshow", function(){
$( "p.message" ).hide().delay( 1500 ).show( "fast" );
});
</script>
</head>
<body>
<div data-role="page" class="jqm-demos">
<div data-role="content" class="jqm-content">
<p class="message">Nothing to see here folks. <a href="demos/">View the demo center home page &rarr;</a></p>
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
jquery.mobile-1.3.2.min.css

View File

@@ -1 +0,0 @@
jquery.mobile-1.3.2.min.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
test

View File

@@ -1 +0,0 @@
test

View File

@@ -1,20 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class
set modver [system modversion]
set modbuild [system modbuild]
if {$modbuild > 0} {
append modver " (build $modbuild)"
}
puts "<font class=blood style=\"font-size: 0.9em; float: right; clear: right\">
Web interface version: [system pkgver webif]<br>
Custom firmware version: $modver
"
if {![catch {set fhtcpversion [system fhtcpversion]}]} {
puts "<br>Humax Version: $fhtcpversion"
}
puts "</font>"

View File

@@ -1,24 +0,0 @@
#!/mod/bin/jimsh
set services [split [exec /mod/bin/service mlist]]
foreach service $services {
lassign [split $service ":"] name installed auto running
puts "<tr><td class=even>$name</td>"
if (!$installed) {
puts "<td colspan=3><i>Not installed</i></td></tr>"
continue
}
puts -nonewline "<td><input type=checkbox class=auto name=\"$name\""
if ($auto) { puts -nonewline " checked" }
puts "></td>"
puts -nonewline "<td><input type=checkbox class=toggle name=\"$name\""
if ($running) { puts -nonewline " checked" }
puts "></td>"
puts "</tr>"
}

View File

@@ -1,59 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class ts.class
proc do_shrink {ts} {
if {[$ts flag "Shrunk"]} { return }
set file [file rootname [$ts get file]]
if {[$ts inuse]} { return }
if {[catch {
set perc [exec /mod/bin/stripts -aq $file]
} msg]} {
return
}
if {[string match {*%} $perc]} {
set perc [string range $perc 0 end-1]
} else {
set perc 0
}
if {$perc == 0} {
puts " Flagging $file as shrunk..."
$ts set_shrunk
}
}
proc entries {dir callback} {
foreach entry [readdir -nocomplain $dir] {
if {![string match {*.ts} $entry} continue
if {[catch {set ts [ts fetch "$dir/$entry"]}]} continue
if {$ts == 0} continue
$callback $ts
}
}
proc scan {dir} {
puts "Scanning $dir..."
file stat "$dir/" st
if {$st(dev) != $::rootdev} { return }
entries $dir do_shrink
foreach entry [readdir -nocomplain $dir] {
if {[file isdirectory "$dir/$entry"]} {
scan "$dir/$entry"
}
}
}
set root [system mediaroot]
file stat "$root/" rootstat
set rootdev $rootstat(dev)
scan $root

1
webif
View File

@@ -1 +0,0 @@
var/mongoose

View File

@@ -2,7 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require system.class chunked pretty_size
require system.class pretty_size
cgi_input
#cgi_dump
@@ -10,16 +10,14 @@ cgi_input
set file [cgi_get file "-"]
if {$file eq "-"} { exit }
start_chunked
httpheader "text/plain"
if {![file exists $file]} {
chunk ">>> File $file does not exist.\r\n"
puts ">>> File $file does not exist.\r\n"
} else {
chunk ">>> Contents of $file [pretty_size [file size $file]]\r\n"
puts ">>> Contents of $file [pretty_size [file size $file]]\r\n"
set fp [open $file r]
chunk [read $fp]
puts [read $fp]
close $fp
}
end_chunked

View File

@@ -63,7 +63,7 @@ proc db_info {db_file} {
if {$fdb == 0} {
puts "Please choose database to view:<ul>"
foreach db $databases {
puts "<li><a href=$::env(REQUEST_URI)?db=[file tail $db]>
puts "<li><a href=$::env(SCRIPT_NAME)?db=[file tail $db]>
$db</a></li>"
}
puts "</ul>"

9
webif/cgi-bin/env.jim Executable file
View File

@@ -0,0 +1,9 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
httpheader
puts "<pre>"
parray env
puts "</pre>"

View File

@@ -13,7 +13,7 @@ set raw [cgi_get raw]
puts "<pre>"
if { $raw == 0 } {
puts [epg exec dump -raw 1 -service $service -event $event]
puts "<a href=$env(REQUEST_URI)?$env(QUERY_STRING)&raw=1>
puts "<a href=$env(SCRIPT_NAME)?$env(QUERY_STRING)&raw=1>
Click here for extended dump</a>"
} else {
puts [epg exec dumpraw -raw 1 -service $service -event $event]

View File

@@ -55,6 +55,7 @@ if {$ct > 0 } {
}
set favlist [epg favlist]
set s [settings]
if {[$s service_style] eq "standard"} {
set surl xservice
} else {
@@ -87,8 +88,10 @@ proc rsort {v1 v2} {
set seen {}
set i 0
foreach record [lsort -command rsort $records] {
set ename [$record get name]
if {$ename eq ""} continue
if {$dedup} {
set ename [$record get name]
if {$ename in $seen} continue
lappend seen $ename
}

View File

@@ -2,7 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require pkg.class chunked
require pkg.class
cgi_input
#cgi_dump
@@ -10,30 +10,27 @@ cgi_input
set cmd [cgi_get cmd update]
proc opkg {cmd} {
chunk ">>> opkg $cmd\r\n"
puts ">>> opkg $cmd\r\n"
set bcmd "|/mod/webif/lib/bin/opkg $cmd"
set fd [open $bcmd r]
while {[gets $fd line] >= 0} {
chunk "$line\r\n"
#chunk_pad
puts "$line\r\n"
}
close $fd
chunk "\r\n"
puts "\r\n"
}
start_chunked
httpheader "text/plain"
if {$cmd eq "upgrade"} { opkg update }
opkg $cmd
if {$cmd eq "update" || $cmd eq "upgrade"} {
chunk "Updating package meta information\r\n"
puts "Updating package meta information\r\n"
pkg fetchmeta
chunk "Done.\r\n"
chunk "Updating diagnostic meta information\r\n"
puts "Done.\r\n"
puts "Updating diagnostic meta information\r\n"
pkg fetchdiagmeta
chunk "Done.\r\n"
puts "Done.\r\n"
}
end_chunked

View File

@@ -8,7 +8,7 @@ set runmode cli
if {[string match {*jim} $argv0]} { set runmode cgi }
set schedtime 1200
case $runmode {
switch $runmode {
cgi {
set type [cgi_get type "full"]
httpheader

View File

@@ -1,7 +1,7 @@
$(function() {
$('#epgswitch').button().click(function() {
window.location = '/epg.shtml';
window.location = '/epg/list.jim';
});
$('button.nav').click(function() {

View File

@@ -1,7 +1,7 @@
function refresh_files()
{
$('#backup_files').load('/cgi-bin/backup/files.jim', function() {
$('#backup_files').load('files.jim', function() {
$('input.restore').change(function() {
$('#restore_button').removeAttr('disabled')
.button('option', 'disabled', false);
@@ -20,7 +20,7 @@ $(document).ready(function() {
$('#backup_button').click(function() {
$('#backup_working').slideDown();
$('#results').load('/cgi-bin/backup/backup.jim?' +
$('#results').load('backup.jim?' +
$('#backup_name').serialize(), function() {
$('#results').slideDown(function() {
$('#backup_working').slideUp();
@@ -32,7 +32,7 @@ $(document).ready(function() {
var backup = $('input.restore:checked').val();
if (confirm('Confirm deletion of ' + backup))
{
$('#results').load('/cgi-bin/backup/delete.jim?' +
$('#results').load('delete.jim?' +
$('input.restore').serialize(), function() {
$('#results').slideDown(function() {
refresh_files();
@@ -42,7 +42,7 @@ $(document).ready(function() {
});
$('#view_button').click(function() {
var backup = $('input.restore:checked').val();
$('#results').load('/cgi-bin/backup/view.jim?' +
$('#results').load('view.jim?' +
$('input.restore').serialize(), function() {
$('#results').slideDown(function() {
refresh_files();
@@ -54,7 +54,7 @@ $(document).ready(function() {
if (confirm('!!!!!!!!!!!!!!!!!!!!!!!!! PLEASE CONFIRM !!!!!!!!!!!!!!!!!!!!!!!!!\n\nAre you sure you wish to erase all scheduled recordings and favourite channels and then restore them from\n' + backup + '?'))
{
$('#restore_working').slideDown();
$('#results').load('/cgi-bin/backup/restore.jim?' +
$('#results').load('restore.jim?' +
$('input.restore').serialize(), function() {
$('#results').slideDown(function() {
$('#restore_working').slideUp();

View File

@@ -3,7 +3,9 @@
source /mod/webif/lib/setup
require altrow rsv.class
jscss /cgi-bin/backup/backup.js
jscss backup.js
header
puts {
<h2>Backup/Restore</h2>
@@ -64,3 +66,5 @@ puts {
</div>
}
footer

View File

@@ -3,18 +3,20 @@
package require sqlite3
package require cgi
source /mod/webif/lib/setup
require ts.class system.class
require ts.class system.class settings.class
jqplugin progressbar
jscss audio.js
header
set s [settings]
set type [$s audiomp3descr [$s audiomp3]]
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
puts "
<fieldset class=cleft>
@@ -31,7 +33,7 @@ puts "
></span>
<div id=audiodiv style=\"padding: 1em\">
<button id=audioit>Perform audio extraction</button>
<button id=audioit>Perform audio extraction - $type</button>
</div>
<div id=progressdiv class=hidden>

View File

@@ -3,7 +3,7 @@
package require sqlite3
package require cgi
source /mod/webif/lib/setup
require ts.class system.class
require ts.class system.class settings.class
httpheader
@@ -18,9 +18,15 @@ set base [file rootname $rfile]
set shname [file tail $base]
puts "Processing $shname"
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
-i $rfile -f mp3 \
-vn -acodec copy "${base}.mp3"]
set cmd [list ffmpeg -y -benchmark -v 0 -i "$rfile" -f mp3 -vn]
if {![[settings] audiomp3]} {
lappend cmd -acodec copy
}
lappend cmd "${base}.mp3"
#puts "$cmd"
puts [exec {*}$cmd]
if {[system pkginst id3v2]} {
puts [exec /mod/bin/id3v2 \

View File

@@ -34,10 +34,12 @@ if {[file exists "$origdir/$shname.ts"]} {
}
puts "Moving recording to $origdir"
foreach f [glob -nocomplain "${base}.*"] {
set tail [file tail $f]
puts " $tail"
file rename $f "$origdir/$tail"
set tail [file tail $base]
foreach ext $tsgroup {
if {![file exists "$base.$ext"]} continue
puts " $tail.$ext"
file rename "$base.$ext" "${origdir}/$tail.$ext"
}
puts [exec /mod/bin/nicesplice \

View File

@@ -42,20 +42,22 @@ exec wget -O "$rfile.decrypting" $url
puts "Moving recording to $origdir"
foreach f [glob -nocomplain "${base}.*"] {
if {[file extension $f] eq ".decrypting"} { continue }
set tail [file tail $f]
puts " $tail"
file rename $f "${origdir}/$tail"
set tail [file tail $base]
foreach ext $tsgroup {
if {![file exists "$base.$ext"]} continue
puts " $tail.$ext"
file rename "$base.$ext" "${origdir}/$tail.$ext"
}
file rename "$rfile.decrypting" $rfile
file touch $rfile "$origdir/$tail.ts"
foreach ext {nts hmt thm} {
set sidecar "$shname.$ext"
if {[file exists "$origdir/$sidecar"]} {
puts "Copying back sidecar $ext"
file copy "$origdir/$sidecar" "$dir/$sidecar"
file touch "$dir/$sidecar" "$origdir/$tail.ts"
}
}

View File

@@ -11,8 +11,7 @@ set type [cgi_get type]
if {$file == 0} exit
file stat $file st
set sz [pretty_size $st(size)]
set sz [pretty_size [file size $file]]
if {$type eq "ts"} {
require epg.class ts.class

View File

@@ -14,8 +14,8 @@ set flatten [system pkginst flatten]
set ignore {.nts .thm .hmi}
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt}
if {![dict exists $env REQUEST_URI]} {
set env(REQUEST_URI) ""
if {![dict exists $env SCRIPT_NAME]} {
set env(SCRIPT_NAME) ""
cgi_input
set _cgi(dir) "/media/My Video/"
}
@@ -52,7 +52,7 @@ proc directory {file bfile tbfile} {
if {!$::nofcount} { puts "<span class=foldernum></span>" }
puts "<input class=\"fs fsdir\" type=checkbox>"
puts "<a class=dbf
href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
href=\"$::env(SCRIPT_NAME)?dir=[cgi_quote_url $file]\"
file=\"[cgi_quote_url $file]\">"
puts "$bfile</a><span class=filesize id=\"$tbfile\">
</span>"
@@ -103,8 +103,7 @@ proc entry {file} {{i 0}} {
set ext [string tolower [file extension $file]]
if {$ext in $::ignore || $ext ni $::include} { return }
file stat $file st
set rsz $st(size)
set rsz [file size $file]
set sz [pretty_size $rsz]
set base [file rootname $file]
@@ -265,7 +264,7 @@ set stub ""
foreach part [split $dir /] {
if {$stub eq "/"} { set name $part } else { set name "/$part" }
append stub $name
puts "<a href=\"$env(REQUEST_URI)?dir=[cgi_quote_url $stub]\">$name</a>
puts "<a href=\"$env(SCRIPT_NAME)?dir=[cgi_quote_url $stub]\">$name</a>
}
puts "<span class=filesize id=dirsize></span>"
puts "</legend>"
@@ -275,7 +274,7 @@ set parent [join [lrange [split $dir /] 0 end-1] /]
if {$parent ne ""} {
puts "
<div class=va>
<a href=\"$env(REQUEST_URI)?dir=[cgi_quote_url $parent]\">
<a href=\"$env(SCRIPT_NAME)?dir=[cgi_quote_url $parent]\">
<img border=0 src=/images/711_3_09_Media_Folder_UP.png class=va>
\[parent directory\]</a>
</div>
@@ -334,7 +333,7 @@ foreach sl $sortlist {
set tag "Currently sorting"
if {$order != $index} {
puts "
<a href=\"$env(REQUEST_URI)?$env(QUERY_STRING)&order=$index\">"
<a href=\"$env(SCRIPT_NAME)?$env(QUERY_STRING)&order=$index\">"
set tag "Sort"
}
puts "<img class=va border=0 src=/img/$img.gif> $tag by $descr"

Some files were not shown because too many files have changed in this diff Show More