Compare commits
394 Commits
1.0.16@202
...
df-bbrawpa
| Author | SHA1 | Date | |
|---|---|---|---|
| b0d2fa32dc | |||
| ec8fe177c5 | |||
| 40c7ebcf89 | |||
| 7da9ca930a | |||
| 536b1977b1 | |||
|
|
d7c15163e1 | ||
| 879c458256 | |||
| 1a25e2a3f1 | |||
| 006a04683a | |||
| 3623a26a08 | |||
| c428a367a1 | |||
| 480108f3a2 | |||
| 2884a82dbf | |||
| ac4b392db8 | |||
| c3d360fa63 | |||
| 3f199f32ab | |||
|
|
1994d99294 | ||
|
|
cbc62f4903 | ||
| f40a82df57 | |||
|
|
0ef47da7b6 | ||
| 42cf8bf238 | |||
| 9cf915e5f7 | |||
| 478d9db2e2 | |||
| b824882eb2 | |||
|
|
4b3efc2e72 | ||
|
|
abf121bba4 | ||
|
|
c1bc10eca8 | ||
|
|
3b7a573600 | ||
|
|
c68b6a17db | ||
| e767f28a8f | |||
| ddb163ab5c | |||
|
|
4194bf627c | ||
|
|
e3de677046 | ||
| d69ee1e97a | |||
|
|
3ddc898553 | ||
| 1dfb66c576 | |||
| 96e53bec56 | |||
| 18aee67607 | |||
| c416e5f39d | |||
| 61df972bde | |||
| a67f5a9b70 | |||
|
|
022e6459fc | ||
| cd9e9924f6 | |||
| e3da17ca6c | |||
| b99327a562 | |||
| 1b5472a141 | |||
| 8586483474 | |||
| dd3e4cb358 | |||
|
|
a3cb0a6693 | ||
|
|
7b53d0b549 | ||
| 79785362ae | |||
| 38cde695e4 | |||
|
|
3080f9786d | ||
|
|
1363fd2f22 | ||
|
|
7cc8518779 | ||
|
|
487ff500ab | ||
|
|
d2e4e10919 | ||
|
|
8994d016ef | ||
| d14ccef3bf | |||
| f77d11f3fc | |||
| 38aca0d740 | |||
|
|
249af1b4fa | ||
| 9fe8b3a067 | |||
| 0f55145586 | |||
| ede9ef3171 | |||
|
|
dfde94c384 | ||
| 0c7dd2b31f | |||
| 59bbcc09fb | |||
| 789950858d | |||
| 69d0e6597d | |||
|
|
9c80bb0601 | ||
| 92f9e5ca60 | |||
| 917d47e1c6 | |||
| b9bf4fc5d3 | |||
| e595c6b17b | |||
|
|
6eb6f49fea | ||
| f5a205a2af | |||
| 773a33f960 | |||
| 03e1c7340e | |||
| db4655e29b | |||
| 042f729006 | |||
| a68df32ac0 | |||
| da865f3e85 | |||
| 06188094bf | |||
| a4fe3dcaed | |||
| 22b6892b2d | |||
| 132afd3ca7 | |||
| ba3db5eb59 | |||
| 0f3ba2655a | |||
| ea4feec008 | |||
| 9de13741c8 | |||
| f3fc621de1 | |||
| 6745b88fb9 | |||
| da9f328316 | |||
| 5d03bedfac | |||
| c15859ed30 | |||
| 9fdf3017f0 | |||
| 89e61f669b | |||
| 83abd2a5cd | |||
| db273a8502 | |||
| 93b32a7796 | |||
| 4d3b134fe7 | |||
| 7477fe1956 | |||
| 26150bda5a | |||
| 3193ca00ab | |||
| 437fed841b | |||
| 165b1de49e | |||
| df05e23415 | |||
| 133a9ffd46 | |||
| ff846fb6d0 | |||
| b6eceebc26 | |||
| 61582251c7 | |||
| 4ce3759902 | |||
| ebf7d1312e | |||
| 07b16a4efb | |||
| 0da04b5aed | |||
| 87ff52dd03 | |||
| 641b43d8a0 | |||
| 31f4b53f68 | |||
| 7e0de7889e | |||
| 87440918e0 | |||
| 07a6f990bd | |||
| 5075d638e5 | |||
| 909f9cad31 | |||
| 71dcd3960a | |||
| 0dda2fa11a | |||
| 9a5fe4394b | |||
| 51311e74ba | |||
| 63f9906526 | |||
| 0fa233afce | |||
| c79b890985 | |||
| 9529cd2071 | |||
| ab1f04fe8e | |||
| f28a048bd9 | |||
| 45d1cdd2d1 | |||
| 5dc2405068 | |||
| 37c6876e28 | |||
| 524a97ef0d | |||
| 10227c6928 | |||
| e8d75bcb20 | |||
| 5ccd378fc0 | |||
| eb0a23d82c | |||
| 2c9a386e25 | |||
| 4bb5fd3a30 | |||
| 4a840d89d8 | |||
| 7bfabc825a | |||
| 73aa90c2db | |||
| 3cee225331 | |||
| 98dc8bdfd1 | |||
| 1725bce452 | |||
| d4a0117fab | |||
| 74b744aa02 | |||
| 03d526549c | |||
| be1b26378e | |||
| a5fa577099 | |||
| 76691eedd0 | |||
| c447922233 | |||
|
|
13e561277c | ||
|
|
22dfc27130 | ||
| 5f1745ef27 | |||
|
|
c02d776466 | ||
| 19a2eaf8db | |||
| 40c54af482 | |||
| 55528cf3d1 | |||
| 403281e489 | |||
|
|
7b6866cdb0 | ||
|
|
20b4fe2f66 | ||
|
|
92a0cbd01b | ||
|
|
44814fb791 | ||
|
|
14f4eb0371 | ||
|
|
9a874d65d2 | ||
|
|
c8c2cc3c9c | ||
|
|
e758b99f55 | ||
|
|
e9fd4f4110 | ||
|
|
1b3aad52d1 | ||
|
|
1f98b627d7 | ||
|
|
bd5bb64b13 | ||
|
|
8e7d14efc4 | ||
|
|
e71419b7e5 | ||
|
|
3d979a292e | ||
|
|
40a1a42433 | ||
|
|
f19dfe65eb | ||
|
|
2bb88ac84d | ||
|
|
d6129ebd28 | ||
|
|
3fa95419ce | ||
|
|
034e9c1598 | ||
|
|
fa013cec91 | ||
|
|
aa91b5a865 | ||
|
|
4ecb91a6b5 | ||
|
|
9a6e3ccc39 | ||
|
|
8b021ec4b7 | ||
|
|
5104dbd387 | ||
|
|
c21504b43f | ||
|
|
efd7544b8c | ||
|
|
92a5c27401 | ||
|
|
caeabd15d0 | ||
|
|
26ceff2ad2 | ||
|
|
53edb41250 | ||
|
|
e910472fa6 | ||
|
|
0dd9641e76 | ||
|
|
d58ebd684a | ||
|
|
6516f47f56 | ||
|
|
fce45667fc | ||
|
|
1c8a3d87da | ||
|
|
09dd487b60 | ||
|
|
fadca6e8c5 | ||
|
|
4a9c5cda27 | ||
|
|
daa312c162 | ||
|
|
ba0c2ca311 | ||
|
|
d0cb142952 | ||
|
|
88c7f8cef9 | ||
|
|
097ed2d74c | ||
|
|
4adc26d2f2 | ||
|
|
4f8c5a7b46 | ||
|
|
1fc426cb1a | ||
|
|
759b96e764 | ||
|
|
d1ccf7b2d1 | ||
|
|
ddeab2831e | ||
|
|
bb80ba1b83 | ||
|
|
1c9d1c75f3 | ||
|
|
825b377a78 | ||
|
|
35785a7387 | ||
|
|
03459caabc | ||
|
|
e4809de977 | ||
|
|
dc5795f8ae | ||
|
|
3dadba3556 | ||
|
|
0c0ea08f09 | ||
|
|
7b7651b5f8 | ||
|
|
7edf787c28 | ||
|
|
9e685245b9 | ||
|
|
8710cb0480 | ||
|
|
8cd924c8ac | ||
|
|
46a539c739 | ||
|
|
de8af8c4ad | ||
|
|
b89b9cd5c9 | ||
|
|
482e1fb597 | ||
|
|
84fdeabd6d | ||
|
|
e19cf1998e | ||
|
|
3cbf0649ad | ||
|
|
ddde3ecc4e | ||
|
|
eda5ab7656 | ||
|
|
c865d8b1a1 | ||
|
|
eeba46c703 | ||
|
|
b13337653d | ||
|
|
8ed615459f | ||
|
|
f72cf64cce | ||
|
|
a6f35d4fdb | ||
|
|
daa345cac9 | ||
|
|
0d3e33330e | ||
|
|
950051032e | ||
|
|
0bd1f610d1 | ||
|
|
5fe06b267c | ||
|
|
d7fc82e292 | ||
|
|
0de011e28d | ||
|
|
e3e1fb618a | ||
|
|
bcc93e0e9f | ||
|
|
8238571064 | ||
|
|
638219fd45 | ||
|
|
417f1aed61 | ||
|
|
7d06c3afbc | ||
|
|
4b7509fedd | ||
|
|
a2a1a54913 | ||
|
|
8592bddc0d | ||
|
|
d3a352748a | ||
|
|
bd69b981a7 | ||
|
|
203813b7ec | ||
|
|
58da098a11 | ||
|
|
9ce18af5cf | ||
|
|
7bbfa758c1 | ||
|
|
17f5cf5e7e | ||
|
|
6bd6c33e70 | ||
|
|
b044418869 | ||
|
|
76308b9489 | ||
|
|
e6ed9e9822 | ||
|
|
c6e933999b | ||
|
|
32774754a4 | ||
|
|
8fd5cdb062 | ||
|
|
347f7989ec | ||
|
|
d09e2f2432 | ||
|
|
055458ed46 | ||
|
|
03164c8b4c | ||
|
|
59c4e7ad1f | ||
|
|
687fc606a1 | ||
|
|
879d672a62 | ||
|
|
e1a5bb3998 | ||
|
|
f4afecf77c | ||
|
|
b092b571e2 | ||
|
|
f29532b481 | ||
|
|
943009252b | ||
|
|
131b8980ac | ||
|
|
e316ad3a5a | ||
|
|
971d074f3c | ||
|
|
4886a5f191 | ||
|
|
21de0e6d5a | ||
|
|
95bc11d2f1 | ||
|
|
4d3fa4a268 | ||
|
|
15befb403e | ||
|
|
e3a0d1ec96 | ||
|
|
e5c01f19d3 | ||
|
|
4bdd52307c | ||
|
|
1579763bb2 | ||
|
|
19ae94cd2c | ||
|
|
debb7c0da8 | ||
|
|
47b23d76cf | ||
|
|
bb2496a8a7 | ||
|
|
57a2523b1c | ||
|
|
5f04fbdf01 | ||
|
|
f34872a4c4 | ||
|
|
b373ccb3dc | ||
|
|
79dadbec68 | ||
|
|
96eea155da | ||
|
|
2b6e29b1c2 | ||
|
|
6b8933634b | ||
|
|
e7ca1d7742 | ||
|
|
c24374c4c0 | ||
|
|
42f83f1040 | ||
|
|
8a6bc41b4d | ||
|
|
cffa6cca1b | ||
|
|
dfdb9c5a27 | ||
|
|
9b5498af1c | ||
|
|
1b698dbb2d | ||
|
|
a9f7ba3ff2 | ||
|
|
427aa42ace | ||
|
|
91a7f66d9c | ||
|
|
0c3af11f45 | ||
|
|
eb80167e31 | ||
|
|
23438a6122 | ||
|
|
bc682f4bef | ||
|
|
2ce27624ce | ||
|
|
37e979787e | ||
|
|
547f825f54 | ||
|
|
677bc95882 | ||
|
|
c54dd07563 | ||
|
|
1d6d1c972c | ||
|
|
b136b61893 | ||
|
|
0a91878fd5 | ||
|
|
2e3ce0aed1 | ||
|
|
bf1bd66bbe | ||
|
|
9b9032eee8 | ||
|
|
9b30a9b0b6 | ||
|
|
e26298cab0 | ||
|
|
8f7f20b83d | ||
|
|
217b08922f | ||
|
|
03002d4b60 | ||
|
|
1cd5fbe6fe | ||
|
|
8334746a5c | ||
|
|
b9e6ad6881 | ||
|
|
4e8d9f5b88 | ||
|
|
675139500a | ||
|
|
46de6718c3 | ||
|
|
05b8383fb3 | ||
|
|
529fccd4fd | ||
|
|
97bf8cf820 | ||
|
|
8f7476a369 | ||
|
|
9e9ffd9c44 | ||
|
|
157c1c3979 | ||
|
|
f9bc928250 | ||
|
|
35ed1a5db5 | ||
|
|
38fdd3aaa6 | ||
|
|
73f6fd5519 | ||
|
|
db75c29143 | ||
|
|
2c2c434fec | ||
|
|
24e1ee5210 | ||
|
|
ede9be2693 | ||
|
|
3ca87e1285 | ||
|
|
777ff469b9 | ||
|
|
86ab612ea3 | ||
|
|
2744a91ec7 | ||
|
|
85fed3247a | ||
|
|
51aded3d2d | ||
|
|
5d0939d8de | ||
|
|
fcb036801e | ||
|
|
d962ada7e5 | ||
|
|
3f52c3063a | ||
|
|
bf94690223 | ||
|
|
8516f21c18 | ||
|
|
9d69328615 | ||
|
|
14fb5f7c76 | ||
|
|
788f613a5b | ||
|
|
1c9da2f52f | ||
|
|
37efb8d633 | ||
|
|
294598faf6 | ||
|
|
1116a3f050 | ||
|
|
67ffdc8105 | ||
|
|
04fe30145d | ||
|
|
61f3868c42 | ||
|
|
987425b22a | ||
|
|
c886f6afd2 | ||
|
|
e6d7af1fc4 | ||
|
|
0691577b96 | ||
|
|
876d5b5e8a | ||
|
|
4d895e464d | ||
|
|
252d6bf7f6 | ||
|
|
ea03a67b4a |
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.jim linguist-language=tcl
|
||||
*.class linguist-language=tcl
|
||||
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
ignore:*
|
||||
@@ -1,10 +1,10 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 1.0.16
|
||||
Version: 1.4.8-10
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: webif-channelicons(>=1.1.12-1),lighttpd(>=1.4.35-2),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(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose
|
||||
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
|
||||
Suggests:
|
||||
Description: An evolving web interface for the Humax.
|
||||
Tags: http://hummy.tv/forum/threads/5031/
|
||||
Tags: https://hummy.tv/forum/threads/7712/
|
||||
|
||||
@@ -18,9 +18,11 @@ export tmpf=/tmp/cronf.$$
|
||||
|
||||
crontab=$PKG_ROOT/bin/crontab
|
||||
if [ -x $crontab ]; then
|
||||
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
|
||||
$crontab -l | grep -v webif/lib/bin/auto \
|
||||
| grep -v webif/lib/auto > $tmpf
|
||||
cat $tmpf - << EOM | $crontab -
|
||||
*/10 * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1
|
||||
* * * * * /mod/webif/lib/auto/scan >/dev/null 2>>/mod/tmp/auto.log
|
||||
* * * * * /mod/webif/lib/auto/deq >/dev/null 2>>/mod/tmp/auto.log
|
||||
EOM
|
||||
fi
|
||||
|
||||
@@ -29,27 +31,37 @@ 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/html/backup/backup.jim
|
||||
1 8 sched_backup /mod/webif/html/sched/backup/backup.jim
|
||||
1 5 diskattrs /mod/webif/lib/bin/diskattrs
|
||||
EOM
|
||||
|
||||
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
|
||||
|
||||
[ -f /tmp/webif_auto.log ] && rm -f /tmp/webif_auto.log
|
||||
|
||||
if [ ! -f /mod/webif/.strip-updated ]; then
|
||||
echo "*********************************"
|
||||
echo "* Please wait while any shrunk recordings are flagged..."
|
||||
echo "*********************************"
|
||||
/mod/webif/lib/bin/strip-update
|
||||
|
||||
touch /mod/webif/.strip-updated
|
||||
fi
|
||||
[ -f /mod/webif/.strip-updated ] && rm -f /mod/webif/.strip-updated
|
||||
|
||||
/mod/webif/lib/bin/diskattrs
|
||||
/mod/webif/lib/auto/upgrade
|
||||
#/mod/webif/lib/bin/resetnew
|
||||
|
||||
# Remove hook script placed by the legacy rt3070 package which does not work
|
||||
# with CFW >= 3.00
|
||||
hook=/mod/boot/xinit.d/rt3070
|
||||
[ -f $hook ] && rm -f $hook
|
||||
|
||||
# Remove legacy mongoose startup script
|
||||
[ -f /mod/etc/init.d/Z01mongoose ] && rm -f /mod/etc/init.d/Z01mongoose
|
||||
|
||||
# Migrate record log to new name.
|
||||
(
|
||||
cd /mod/tmp
|
||||
[ -f record.log -a ! -f activity.log ] && mv record.log activity.log
|
||||
)
|
||||
|
||||
[ -f $tmpf ] && rm -f $tmpf
|
||||
|
||||
# Remove empty directories
|
||||
find /mod/webif/ -type d -exec rmdir {} \; 2>/dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -12,5 +12,12 @@ if [ -h /mod/webif -a -d /mod/var/mongoose -a ! -h /mod/var/mongoose ]; then
|
||||
ln -s ../webif mongoose
|
||||
fi
|
||||
|
||||
if [ ! -f /mod/webif/.pfixpkg -a -x /mod/bin/at ]; then
|
||||
/mod/bin/at now + 1 minute << EOM
|
||||
diag fixpkg
|
||||
touch /mod/webif/.pfixpkg
|
||||
EOM
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ export tmpf=/tmp/cronf.$$
|
||||
|
||||
crontab=$PKG_ROOT/bin/crontab
|
||||
if [ -x $crontab ]; then
|
||||
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
|
||||
$crontab -l | grep -v webif/lib/bin/auto \
|
||||
| grep -v webif/lib/auto > $tmpf
|
||||
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
|
||||
fi
|
||||
|
||||
|
||||
2
README.md
Normal file
2
README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# webif
|
||||
An evolving web interface for the Humax HD[R] Fox T2 customised firmware.
|
||||
1
bin/reboot
Symbolic link
1
bin/reboot
Symbolic link
@@ -0,0 +1 @@
|
||||
../webif/lib/bin/reboot
|
||||
23
bin/version
Executable file
23
bin/version
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/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)"
|
||||
}
|
||||
catch {set fhtcpversion [system fhtcpversion]}
|
||||
catch {set kernelver [system kernelver]}
|
||||
|
||||
puts "
|
||||
Humax [system model] Fox T2 ([system hostname])
|
||||
Humax Version: $fhtcpversion (kernel $kernelver)
|
||||
Custom firmware version: $modver
|
||||
Web interface version: [system pkgver webif]
|
||||
Serial Number: [system serialno]
|
||||
Encryption Key: [system encryptionkey]
|
||||
Last Boot Reason: [system lastbootreason]
|
||||
"
|
||||
|
||||
BIN
boot/xinit.d/ahw
Executable file
BIN
boot/xinit.d/ahw
Executable file
Binary file not shown.
18
etc/init.d/S59webif
Executable file
18
etc/init.d/S59webif
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /mod/webif/lib/lib.sh
|
||||
|
||||
export TZ=GMT+0BST,M3.5.0/1,M10.5.0/2
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/mod/webif/lib/bin/manage_logs
|
||||
plog activity "System booted (`lbr_descr`)."
|
||||
;;
|
||||
stop)
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -10,7 +10,14 @@ fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
/mod/bin/epg -f $epg sqlitedumpd $epgdb > /tmp/epgd.log 2>&1 &
|
||||
(
|
||||
ulimit -c unlimited
|
||||
while [ 1 ]; do
|
||||
/mod/bin/epg -f $epg sqlitedumpd $epgdb \
|
||||
> /tmp/epgd.log 2>&1
|
||||
[ $? -eq 143 ] && break
|
||||
done
|
||||
)&
|
||||
;;
|
||||
stop)
|
||||
killall -q epg
|
||||
|
||||
3
etc/modservice.d/epg
Normal file
3
etc/modservice.d/epg
Normal file
@@ -0,0 +1,3 @@
|
||||
key=/mod/bin/epg
|
||||
rc=60parseepg
|
||||
proc="/mod/bin/epg.*sqlitedumpd"
|
||||
31
etc/recmon.d/autotrigger
Executable file
31
etc/recmon.d/autotrigger
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
if {[lindex $argv 0] ne "-stop"} exit
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class settings.class lock
|
||||
|
||||
set loglevel [[settings] autolog]
|
||||
|
||||
set file [lindex $argv 1]
|
||||
set dir [file dirname $file]
|
||||
|
||||
set prefix "autotrigger\[[pid]\]"
|
||||
if {$loglevel > 0} {
|
||||
system plog auto "$prefix: $file"
|
||||
system plog auto "$prefix: will run for $dir"
|
||||
}
|
||||
|
||||
# Wait up to 10 minutes for any existing auto process to finish...
|
||||
if {![acquire_lock webif_autoscan 600 5]} {
|
||||
puts "Cannot acquire exclusive lock, terminating."
|
||||
system plog auto "$prefix: failed to get lock"
|
||||
exit
|
||||
}
|
||||
if {$loglevel > 0} { system plog auto "$prefix: got lock" }
|
||||
|
||||
exec /mod/webif/lib/auto/scan -f -prelocked -logprefix "$prefix: " \
|
||||
-singledir $dir
|
||||
|
||||
if {$loglevel > 0} { system plog auto "$prefix: done" }
|
||||
|
||||
21
etc/recmon.d/webiflog
Executable file
21
etc/recmon.d/webiflog
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
if {[lindex $argv 0] ne "-stop"} exit
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class system.class
|
||||
|
||||
set file [lindex $argv 1]
|
||||
set ts [ts fetch "$file.ts"]
|
||||
set root [system mediaroot]
|
||||
|
||||
set dir [file dirname $file]
|
||||
if {[string match "$root*" $dir]} {
|
||||
set dir [string range $dir $([string length $root] + 1) end]
|
||||
}
|
||||
set ch [$ts get channel_name]
|
||||
set dur [$ts duration]
|
||||
set title [$ts get title]
|
||||
|
||||
system plog activity "Recorded: $dir/$title ($dur minutes - $ch)"
|
||||
|
||||
0
var/backup/.gitignore
vendored
Normal file
0
var/backup/.gitignore
vendored
Normal file
0
webif/cache/.gitignore
vendored
Normal file
0
webif/cache/.gitignore
vendored
Normal file
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -n "$QUERY_STRING" ] && rma="${QUERY_STRING##*=}" || rma=0
|
||||
|
||||
echo "Content-Type: text/plain"
|
||||
echo
|
||||
|
||||
if [ "$rma" = 1 ]; then
|
||||
modver="`cat /etc/modversion`"
|
||||
if [ "$modver" -ge 215 ]; then
|
||||
touch /var/lib/humaxtv_backup/.rma
|
||||
else
|
||||
touch /var/lib/humaxtv/.rma
|
||||
fi
|
||||
else
|
||||
touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT
|
||||
fi
|
||||
|
||||
22
webif/cgi-bin/chanlist.jim
Executable file
22
webif/cgi-bin/chanlist.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class json
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
puts "{"
|
||||
set flag 0
|
||||
|
||||
lmap i [$channeldb query "
|
||||
select usLcn, szSvcName
|
||||
from TBL_SVC
|
||||
order by 1
|
||||
"] {
|
||||
if {$::flag} { puts "," } else { incr ::flag }
|
||||
lassign $i x lcn x name
|
||||
puts -nonewline " \"$lcn\": \"[jescape [system strip $name]]\""
|
||||
}
|
||||
|
||||
puts "\n}"
|
||||
|
||||
@@ -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 -service $service -event $event -sort ""] 0]
|
||||
$record get_channel_info
|
||||
set others [$record othertimes]
|
||||
|
||||
@@ -23,7 +24,27 @@ if {[[settings] chanchangenc]} {
|
||||
puts { <script type=text/javascript src=/js/chanchange.js></script> }
|
||||
}
|
||||
|
||||
$record process_sched
|
||||
if {[$record get sched_type] < 1} {
|
||||
set conflicts [rsv checkconflict \
|
||||
[$record get start] [$record get duration] \
|
||||
[system tuners]]
|
||||
if {[llength $conflicts]} {
|
||||
puts {
|
||||
<div class=warningbox style="width: 100%; margin: 0.2em"><div>
|
||||
This event conflicts with the following items in your scheduled recording list.
|
||||
<ul>
|
||||
}
|
||||
foreach x $conflicts {
|
||||
puts "<li>$x</li>\n"
|
||||
}
|
||||
|
||||
puts "</div></div>"
|
||||
}
|
||||
}
|
||||
|
||||
puts "
|
||||
<div id=epginfo_extra></div>
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Programme</th>
|
||||
@@ -63,19 +84,27 @@ puts "
|
||||
if {[$record showing]} {
|
||||
puts [progressbar [$record percent]]
|
||||
}
|
||||
set icon [$record type_icon]
|
||||
if {$icon != ""} { set icon "<img class=genre src=$icon>" }
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Type</th>
|
||||
<td>[$record get content_type] ([$record get content_code])</td>
|
||||
<td>$icon [$record get content_type] ([$record get content_code])</td>
|
||||
</tr>
|
||||
"
|
||||
|
||||
if {[$record get warning] != ""} {
|
||||
if {[$record get warning_mode]} {
|
||||
set gcol red
|
||||
} else {
|
||||
set gcol blue
|
||||
}
|
||||
puts "
|
||||
<tr>
|
||||
<th>Warning</th>
|
||||
<td>[$record get warning]</td>
|
||||
<td><img class=va src=/img/Guidance_$gcol.png height=21>
|
||||
[$record get warning]</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
@@ -144,8 +173,6 @@ puts "
|
||||
</a>
|
||||
"
|
||||
|
||||
puts "<div id=epginfo_extra class=footnote></div>"
|
||||
|
||||
epg cleanup
|
||||
if {![cgi_exists bare]} footer
|
||||
|
||||
|
||||
@@ -15,19 +15,15 @@ if {$service eq "-" || $event eq "-"} {
|
||||
exit
|
||||
}
|
||||
|
||||
set event [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
set event [lindex [\
|
||||
epg dbfetch dump -service $service -event $event -sort ""] 0]
|
||||
if {$event eq ""} {
|
||||
puts "Error, cannot find event to schedule."
|
||||
exit
|
||||
}
|
||||
if {[$event percent] > 0} {
|
||||
puts "Error, cannot record programme which has already started showing"
|
||||
puts "or occurred in the past."
|
||||
exit
|
||||
}
|
||||
|
||||
set r [rsv construct $event $type]
|
||||
if {[catch {$r insert} msg]} {
|
||||
if {[catch {$r insert pending} msg]} {
|
||||
puts "Error encountered while scheduling: <i>$msg</i>"
|
||||
} else {
|
||||
puts "Successfully scheduled <i>[$event get name]</i>"
|
||||
|
||||
@@ -42,12 +42,12 @@ if {$searchfull} { set cmd "searchall" }
|
||||
|
||||
set dedup 0
|
||||
if {$ct > 0 } {
|
||||
set records [epg fetch dump -type $ct]
|
||||
set records [epg dbfetch dump -type $ct]
|
||||
if {[[settings] genrededup]} { set dedup 1 }
|
||||
} elseif {$crid ne ""} {
|
||||
set records [epg fetch dump -crid $crid]
|
||||
set records [epg dbfetch dump -crid $crid]
|
||||
} elseif {$scrid ne ""} {
|
||||
set records [epg fetch dump -scrid $scrid]
|
||||
set records [epg dbfetch dump -scrid $scrid]
|
||||
} elseif {$searchterm ne ""} {
|
||||
set records [epg dbfetch $cmd -term $searchterm]
|
||||
} else {
|
||||
@@ -70,6 +70,7 @@ if {[llength $records] > 0} {
|
||||
<th colspan=3>Channel</th>
|
||||
<th>Programme</th>
|
||||
<th>Synopsis</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
}
|
||||
} else {
|
||||
@@ -104,7 +105,11 @@ foreach record [lsort -command rsort $records] {
|
||||
|
||||
set ended [$record ended]
|
||||
|
||||
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>"}
|
||||
if {$ended} {
|
||||
puts "<td nowrap class=blood>"
|
||||
} else {
|
||||
puts "<td nowrap>"
|
||||
}
|
||||
puts "
|
||||
[clock format [$record get start] -format "%a %d %b %Y"]<br>
|
||||
[clock format [$record get start] -format "%H:%M %Z"]"
|
||||
|
||||
19
webif/cgi-bin/favlist.jim
Executable file
19
webif/cgi-bin/favlist.jim
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require epg.class json
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
puts "{"
|
||||
set flag 0
|
||||
|
||||
set i 0
|
||||
foreach grp [[settings] channel_groups] {
|
||||
incr i
|
||||
if {$::flag} { puts "," } else { incr ::flag }
|
||||
puts -nonewline " \"$i\": \"[jescape $grp]\""
|
||||
}
|
||||
|
||||
puts "\n}"
|
||||
|
||||
28
webif/cgi-bin/idle.jim
Executable file
28
webif/cgi-bin/idle.jim
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
httpheader
|
||||
|
||||
set idle [system idletime]
|
||||
if {$idle > 0} {
|
||||
lassign [clock format $idle -format {%H %M}] h m
|
||||
set s "Idle: "
|
||||
# switch $h {
|
||||
# 1 { append s "1 hour, " }
|
||||
# 0 {}
|
||||
# default { append s "$($h + 0) hours, " }
|
||||
# }
|
||||
# switch $m {
|
||||
# 1 { append s "1 min" }
|
||||
# default { append s "$($m + 0) mins" }
|
||||
# }
|
||||
|
||||
if {$h > 0} { append s "$($h + 0)h, " }
|
||||
append s "$($m + 0)m"
|
||||
puts $s
|
||||
} else {
|
||||
puts ""
|
||||
}
|
||||
|
||||
@@ -2,36 +2,77 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pkg.class
|
||||
require pkg.class system.class
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set cmd [cgi_get cmd update]
|
||||
|
||||
proc opkg {cmd} {
|
||||
puts ">>> opkg $cmd"
|
||||
proc putsf {str} {
|
||||
puts $str
|
||||
flush stdout
|
||||
}
|
||||
|
||||
proc opkg {cmd {silent 0}} {
|
||||
if {!$silent} { putsf ">>> opkg $cmd" }
|
||||
set bcmd "|/mod/webif/lib/bin/opkg $cmd"
|
||||
set fd [open $bcmd r]
|
||||
while {[gets $fd line] >= 0} {
|
||||
puts "$line"
|
||||
putsf "$line"
|
||||
}
|
||||
close $fd
|
||||
puts ""
|
||||
putsf ""
|
||||
}
|
||||
|
||||
httpheader "text/plain"
|
||||
# Google Chrome won't render chunks with text/plain!
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=156023
|
||||
#httpheader "text/plain"
|
||||
httpheader "application/octet-stream"
|
||||
|
||||
set cmdargs [lassign $cmd cmd]
|
||||
|
||||
set netcmds {install update upgrade}
|
||||
|
||||
if {$cmd in $netcmds && ![system connectivity]} {
|
||||
putsf "!! ERROR - No network connectivity to package repository !!"
|
||||
putsf "Check your Internet connection and DNS service and then try again."
|
||||
exit
|
||||
}
|
||||
|
||||
if {$cmd eq "dependinfo"} {
|
||||
putsf ">>> What $cmdargs depends on\n"
|
||||
opkg "depends $cmdargs" 1
|
||||
|
||||
putsf ">>> What depends on $cmdargs\n"
|
||||
set bcmd "|/mod/webif/lib/bin/opkg whatdepends $cmdargs"
|
||||
set fd [open $bcmd r]
|
||||
while {[gets $fd line] >= 0} {
|
||||
if {[string match "What depends on root set" $line]} break
|
||||
}
|
||||
while {[gets $fd line] >= 0} {
|
||||
if {[string match "*depends on $cmdargs*" $line]} {
|
||||
puts "$line"
|
||||
}
|
||||
}
|
||||
close $fd
|
||||
putsf ""
|
||||
exit
|
||||
}
|
||||
|
||||
if {$cmd eq "upgrade"} { opkg update }
|
||||
opkg $cmd
|
||||
opkg "$cmd $cmdargs"
|
||||
|
||||
if {$cmd eq "update" || $cmd eq "upgrade"} {
|
||||
puts "Updating package meta information"
|
||||
putsf "Updating package meta information"
|
||||
pkg fetchmeta
|
||||
puts "Done."
|
||||
puts ""
|
||||
puts "Updating diagnostic meta information"
|
||||
putsf "Done."
|
||||
putsf ""
|
||||
putsf "Updating diagnostic meta information"
|
||||
pkg fetchdiagmeta
|
||||
puts "Done."
|
||||
putsf "Updating MUX database"
|
||||
pkg fetchmuxdb
|
||||
}
|
||||
|
||||
putsf "Done."
|
||||
|
||||
|
||||
9
webif/cgi-bin/pending.jim
Executable file
9
webif/cgi-bin/pending.jim
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require rsv.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
puts "{ \"pending\": \"[rsv count pending]\" }"
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require rsv.class system.class
|
||||
|
||||
httpheader
|
||||
|
||||
if {[cgi_get act] eq "cancel"} {
|
||||
system restartpending 0
|
||||
exit
|
||||
}
|
||||
|
||||
if {[cgi_get now] eq "yes"} {
|
||||
# - Busybox reboot does sync the disk but may still not be clean enough.
|
||||
puts "Restarting."
|
||||
system reboot
|
||||
exit
|
||||
}
|
||||
|
||||
system restartpending 0
|
||||
jqplugin progressbar
|
||||
header
|
||||
|
||||
# Commit pending reservations on older mod versions.
|
||||
if {![file exists /sbin/rsvsync] && ![file exists /mod/boot/rsvsync]} {
|
||||
rsv commit
|
||||
}
|
||||
|
||||
puts {
|
||||
|
||||
<script type=text/javascript>
|
||||
var handle = 0;
|
||||
var pct = 0;
|
||||
function update()
|
||||
{
|
||||
$('#progressbar').reportprogress(++pct);
|
||||
if (pct == 100)
|
||||
{
|
||||
clearInterval(handle);
|
||||
pct = 0;
|
||||
window.location = '/';
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#progressbar').reportprogress(0);
|
||||
handle = setInterval("update()", 400);
|
||||
$.get('/cgi-bin/restart.jim?now=yes');
|
||||
});
|
||||
</script>
|
||||
|
||||
Please wait while the Humax restarts...<br>
|
||||
<div id=progressbar></div>
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
httpheader
|
||||
|
||||
source /mod/webif/include/restart.jim
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class findhsvc epg.class rsv.class
|
||||
require system.class epg.class rsv.class svc.class plugin
|
||||
|
||||
set runmode cli
|
||||
if {[string match {*jim} $argv0]} { set runmode cgi }
|
||||
@@ -16,6 +16,7 @@ switch $runmode {
|
||||
cli {
|
||||
set type "full"
|
||||
if {"-X" in $argv} { set schedtime 7200 }
|
||||
if {"-x" in $argv} { set schedtime 7200 }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,14 +31,42 @@ if {[catch {set pid [exec pgrep -n humaxtv]}]} {
|
||||
exit
|
||||
}
|
||||
|
||||
set exts {.ts .mkv .avi .mpg .mpeg .wmv .mp3 .mp4 .mov}
|
||||
set exts {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt .m4v .m4a}
|
||||
|
||||
set statusops {
|
||||
decrypt { "Decrypting"
|
||||
"/img/decrypt.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
mpg { "Extracting MPG"
|
||||
"/img/mpg.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
mp { "Extracting MP3"
|
||||
"/img/mp3.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
shrink { "Shrinking"
|
||||
"/img/compress.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
crop { "Cropping"
|
||||
"/img/cut.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
join { "Joining"
|
||||
"/img/cut.png style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
}
|
||||
|
||||
proc register_statusop {op name icon} {
|
||||
set ::statusops($op) [list $name $icon]
|
||||
}
|
||||
|
||||
eval_plugins status 1
|
||||
|
||||
proc get_data {} {
|
||||
global pid exts opfile
|
||||
global pid exts
|
||||
|
||||
set ret {}
|
||||
if {[catch {set data \
|
||||
[exec /mod/webif/lib/bin/lsof -X -Fns -p $pid]} msg]} {
|
||||
debug "Error: $msg"
|
||||
set ret {}
|
||||
} else {
|
||||
set size 0
|
||||
@@ -55,7 +84,12 @@ proc get_data {} {
|
||||
regsub -- { \([^\)]+\)$} $line "" line
|
||||
set ext [file extension $line]
|
||||
if {$ext ni $exts} continue
|
||||
set file [string range $line 1 end]
|
||||
set file [subst -nocommands -novariables \
|
||||
[string range $line 1 end]]
|
||||
# Skip HD-Fox TSR buffer
|
||||
if {$file eq "/media/drive1/.tsr/0.ts"} {
|
||||
continue
|
||||
}
|
||||
# Handle chase play (same file open twice
|
||||
# and recently written)
|
||||
if {[dict exists $ret $file] && \
|
||||
@@ -66,68 +100,96 @@ proc get_data {} {
|
||||
set ret($file) -1
|
||||
}
|
||||
} else {
|
||||
debug "$file = $size"
|
||||
set ret($file) $size
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$opfile ne "" && $opfile ni $ret} {
|
||||
set ret($opfile) [file size $opfile]
|
||||
}
|
||||
foreach file [dict keys $::ops] {
|
||||
if {![dict exists $ret $file]} {
|
||||
if {[file exists $file]} {
|
||||
set ret($file) [file size $file]
|
||||
} else {
|
||||
set ret($file) 0
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret
|
||||
}
|
||||
|
||||
proc add_output {icon mode name} {
|
||||
global runmode output
|
||||
|
||||
if {$runmode eq "cgi"} {
|
||||
if {[string first "/" $icon] == -1} {
|
||||
set icon "/images/$icon"
|
||||
}
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" <img class=va src=$icon>\n" \
|
||||
" <span>$mode <i>$name</i></span>\n" \
|
||||
"</span>\n" \
|
||||
]
|
||||
} else {
|
||||
lappend output "$mode $name"
|
||||
}
|
||||
}
|
||||
|
||||
set play 0
|
||||
set rec 0
|
||||
set output {}
|
||||
set ops {}
|
||||
set model [system model]
|
||||
|
||||
set opfile ""
|
||||
if {[file exists "/mod/tmp/webif_auto/.op"} {
|
||||
set fp [open "/mod/tmp/webif_auto/.op"]
|
||||
lassign [split [string trim [$fp read]] ":"] op opfile
|
||||
$fp close
|
||||
debug "OP: $op - $opfile"
|
||||
foreach opfile [glob -nocomplain -directory /tmp -tails -- ".bgop.*"] {
|
||||
set op [string range $opfile 6 end]
|
||||
lassign [split [file read "/tmp/$opfile"] "\n"] file oppid
|
||||
if {$model eq "HDR"} {
|
||||
set file [string map {/media/ /mnt/hd2/} $file]
|
||||
}
|
||||
|
||||
# Check that the lock is still held
|
||||
if {![system checkop $op]} {
|
||||
debug "$op - $file - $oppid - process not found."
|
||||
file delete "/tmp/$opfile"
|
||||
} else {
|
||||
set ops($file) $op
|
||||
}
|
||||
}
|
||||
|
||||
debug "OPS: $ops"
|
||||
|
||||
set data {}
|
||||
if {$type eq "full"} {
|
||||
set data [get_data]
|
||||
}
|
||||
if {[llength $data]} {
|
||||
debug " DATA: ($data)"
|
||||
if {![file exists /tmp/.rractive]} {
|
||||
if {[system nuggeted] && ![file exists /mod/.nonuggetrecs]} {
|
||||
set recs [lmap i [split [system nugget recordings] "\n"] {
|
||||
function "$i.ts"
|
||||
}]
|
||||
debug " RECS: $recs"
|
||||
set rr 1
|
||||
} else {
|
||||
sleep 3
|
||||
set ndata [get_data]
|
||||
debug " NDATA: ($ndata)"
|
||||
set rr 0
|
||||
} else {
|
||||
sleep 1
|
||||
set ndata [get_data]
|
||||
debug " NDATA: ($ndata)"
|
||||
foreach k [array names data] {
|
||||
if {![dict exists $ndata $k]} {
|
||||
dict unset data $k
|
||||
}
|
||||
}
|
||||
|
||||
set rr 1
|
||||
set recs {}
|
||||
loop i 0 2 {
|
||||
catch {
|
||||
set fd [open "/tmp/.rec$i" r]
|
||||
lappend recs "[$fd read -nonewline].ts"
|
||||
$fd close
|
||||
}
|
||||
}
|
||||
debug " RECS: $recs"
|
||||
}
|
||||
foreach file [array names data] {
|
||||
set bname [file rootname [file tail $file]]
|
||||
|
||||
if {$file eq $opfile} {
|
||||
set mode $op
|
||||
} elseif {$data($file) == -1} {
|
||||
set name [string map {
|
||||
"/mnt/hd2/My Video/" ""
|
||||
"/media/drive1/Video/" ""
|
||||
"/media/" ""
|
||||
".ts" ""
|
||||
} $file]
|
||||
|
||||
if {$data($file) == -1} {
|
||||
set mode chase
|
||||
} elseif {$rr} {
|
||||
if {$file in $recs} {
|
||||
@@ -144,6 +206,17 @@ if {[llength $data]} {
|
||||
}
|
||||
}
|
||||
|
||||
if {[dict exists $ops $file]} {
|
||||
if {$mode eq "rec" || $mode eq "chase"} {
|
||||
set mode "Recording"
|
||||
set icon "745_1_11_Video_1REC.png"
|
||||
add_output $icon $mode $name
|
||||
}
|
||||
set mode $ops($file)
|
||||
}
|
||||
|
||||
regexp -- {^([^0-9]+)} $mode x mode
|
||||
|
||||
switch $mode {
|
||||
chase {
|
||||
incr rec
|
||||
@@ -161,49 +234,17 @@ if {[llength $data]} {
|
||||
set mode "Playing"
|
||||
set icon "745_1_10_Video_2Live.png"
|
||||
}
|
||||
dec {
|
||||
set mode "Decrypting"
|
||||
set icon "/img/decrypt.png "
|
||||
append icon "style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
mpg {
|
||||
set mode "Extracting MPG"
|
||||
set icon "/img/mpg.png "
|
||||
append icon "style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
mp3 {
|
||||
set mode "Extracting MP3"
|
||||
set icon "/img/mp3.png "
|
||||
append icon "style=\"padding: 0 0.2em 0 0.5em\""
|
||||
}
|
||||
shrink {
|
||||
set mode "Shrinking"
|
||||
set icon "/img/compress.png "
|
||||
append icon "style=\"padding: 0 0.2em 0 0.5em\""
|
||||
default {
|
||||
if {[dict exists $statusops $mode]} {
|
||||
lassign $statusops($mode) mode icon
|
||||
} else {
|
||||
set mode "Unknown"
|
||||
set icon "/img/blank.gif"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {[string first "/" $icon] == -1} {
|
||||
set icon "/images/$icon"
|
||||
}
|
||||
|
||||
set name [string map {
|
||||
"/mnt/hd2/My Video/" ""
|
||||
"/media/drive1/Video/" ""
|
||||
"/media/" ""
|
||||
".ts" ""
|
||||
} $file]
|
||||
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" <img class=va src=$icon>\n" \
|
||||
" <span>$mode <i>$name</i></span>\n" \
|
||||
"</span>\n" \
|
||||
]
|
||||
} else {
|
||||
lappend output "$mode $name"
|
||||
}
|
||||
add_output $icon $mode $name
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +254,7 @@ if {[llength $data]} {
|
||||
if {![system instandby] && $play < 1} {
|
||||
set hsvc [system param CUR_SVC Value USERCONFIG]
|
||||
|
||||
set ff [$rsvdb query "
|
||||
set ff [[rsv dbhandle] query "
|
||||
select usSvcid as svcid, usLcn as lcn,
|
||||
substr(szSvcName, 2) as name
|
||||
from channel.TBL_SVC
|
||||
@@ -237,15 +278,17 @@ if {![system instandby] && $play < 1} {
|
||||
}
|
||||
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output [concat \
|
||||
"<span class=\"va stitem\">\n" \
|
||||
" [epg channelicon $name 30 \
|
||||
{vertical-align: middle; padding: 0 4px 0 2px}]\n" \
|
||||
" <span>Watching <i>$lcn: $name $prog</i></span>\n" \
|
||||
"</span>\n" \
|
||||
]
|
||||
set s "
|
||||
<span class=\"va stitem\">
|
||||
[epg channelicon $name 30 \
|
||||
{vertical-align: middle; padding: 0 4px 0 2px}]
|
||||
<span>Watching <i>$lcn: $name $prog</i></span>
|
||||
"
|
||||
append s "</span>"
|
||||
lappend output $s
|
||||
} else {
|
||||
lappend output "Watching $lcn: $name $prog"
|
||||
set s "Watching $lcn: $name $prog"
|
||||
lappend output $s
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -284,6 +327,7 @@ foreach event $events {
|
||||
" [clock format [$event get nsttime] -format {%H:%M}]" \
|
||||
" </span>\n" \
|
||||
"</span>\n" \
|
||||
]
|
||||
} else {
|
||||
lappend output [concat \
|
||||
"Will record '[$event name]' " \
|
||||
@@ -293,6 +337,21 @@ foreach event $events {
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# VFD
|
||||
|
||||
if {$runmode ne "cgi" && [file exists /mod/webif/plugin/redring/lib.jim]} {
|
||||
source /mod/webif/plugin/redring/lib.jim
|
||||
lappend output "VFD: [::redring::vfd]"
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# Idle Time
|
||||
|
||||
if {$runmode ne "cgi"} {
|
||||
lappend output "Idle: [clock format [system idletime] -format %T]"
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# Output
|
||||
|
||||
|
||||
15
webif/cgi-bin/tvdbimg.jim
Executable file
15
webif/cgi-bin/tvdbimg.jim
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require tvdb.class
|
||||
|
||||
set file [cgi_get file "-"]
|
||||
if {$file eq "-"} { exit }
|
||||
|
||||
if {![file exists "$::tvdb::icache/$file"]} {
|
||||
tvdb cachebanner $file
|
||||
}
|
||||
|
||||
httpredirect "/cache/tvdb/img/$file"
|
||||
|
||||
29
webif/cgi-bin/usbeject.jim
Executable file
29
webif/cgi-bin/usbeject.jim
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set label [cgi_get label -]
|
||||
|
||||
foreach usb [system usbmounts 1] {
|
||||
if {$usb(LABEL) eq $label} {
|
||||
puts "{"
|
||||
if {[catch {exec /bin/umount $usb(MP)} msg]} {
|
||||
if {[string match {*resource busy*} $msg]} {
|
||||
set msg "Failed to eject $label - in use"
|
||||
}
|
||||
puts "\"status\": 0,"
|
||||
puts "\"result\": \"$msg\""
|
||||
} else {
|
||||
puts "\"status\": 1,"
|
||||
puts "\"result\": \"Successfully ejected $label\""
|
||||
catch {file delete -force $usb(MP)}
|
||||
}
|
||||
puts "}"
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
59
webif/cgi-bin/usbinfo.jim
Executable file
59
webif/cgi-bin/usbinfo.jim
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set fsg {File-Stor Gadget}
|
||||
|
||||
set ignoredev {}
|
||||
if {[file isdirectory /mnt/hd2]} {
|
||||
file stat /mnt/hd2 st
|
||||
lappend ignoredev $st(dev)
|
||||
}
|
||||
|
||||
set usbdisks [system usbdisks 1]
|
||||
|
||||
puts "{"
|
||||
puts " \"mounts\": \["
|
||||
set flag 0
|
||||
foreach usb [system usbmounts 1] {
|
||||
file stat $usb(MP) st
|
||||
if {$usb(MODEL) ne $fsg && $st(dev) in $ignoredev} continue
|
||||
if {$flag} { puts "," } else { set flag 1 }
|
||||
puts " {"
|
||||
|
||||
set sf 0
|
||||
foreach {k v} $usb {
|
||||
if {$sf} { puts "," } else { set sf 1 }
|
||||
puts -nonewline " \"$k\": \"$v\""
|
||||
}
|
||||
puts ""
|
||||
|
||||
puts -nonewline " }"
|
||||
|
||||
if {[dict exists $usbdisks $usb(RDEV)]} {
|
||||
dict unset usbdisks $usb(RDEV)
|
||||
}
|
||||
}
|
||||
if {$flag} { puts "" }
|
||||
puts -nonewline " ]"
|
||||
|
||||
if {[llength $usbdisks] > 0} {
|
||||
puts ","
|
||||
puts " \"disks\": \["
|
||||
set flag 0
|
||||
foreach {k v} $usbdisks {
|
||||
if {$flag} { puts "," } else { incr flag }
|
||||
puts " {"
|
||||
puts " \"device\": \"$k\","
|
||||
puts " \"id\": \"$v\""
|
||||
puts -nonewline " }"
|
||||
}
|
||||
puts ""
|
||||
puts -nonewline "]"
|
||||
}
|
||||
|
||||
puts "}"
|
||||
|
||||
36
webif/cgi-bin/usbrescan.jim
Executable file
36
webif/cgi-bin/usbrescan.jim
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set dev [cgi_get device -]
|
||||
|
||||
set disks [system usbdisks 1]
|
||||
|
||||
puts "{"
|
||||
if {![dict exists $disks $dev]} {
|
||||
puts "\"status\": 0,"
|
||||
puts "\"result\": \"No such device - $dev.\""
|
||||
} else {
|
||||
set root "/sys/bus/usb/drivers/usb-storage"
|
||||
set id $disks($dev)
|
||||
if {[catch {
|
||||
set fd [open "$root/unbind" w]
|
||||
puts -nonewline $fd $id
|
||||
$fd close
|
||||
set fd [open "$root/bind" w]
|
||||
puts -nonewline $fd $id
|
||||
$fd close
|
||||
} msg]} {
|
||||
puts "\"status\": 0,"
|
||||
puts "\"result\": \"$msg\""
|
||||
} else {
|
||||
puts "\"status\": 1,"
|
||||
puts "\"result\": \"Successfully re-scanned $dev\""
|
||||
}
|
||||
}
|
||||
puts "}"
|
||||
|
||||
14
webif/cgi-bin/vfd.jim
Executable file
14
webif/cgi-bin/vfd.jim
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
if {![file exists /mod/webif/plugin/redring/lib.jim]} {
|
||||
puts ""
|
||||
exit
|
||||
}
|
||||
|
||||
source /mod/webif/plugin/redring/lib.jim
|
||||
puts [::redring::vfd 1]
|
||||
|
||||
130
webif/cgi-bin/wifiscan.jim
Executable file
130
webif/cgi-bin/wifiscan.jim
Executable file
@@ -0,0 +1,130 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
if {![system has wifi_dongle]} {
|
||||
puts "\[]"
|
||||
exit
|
||||
}
|
||||
|
||||
catch {exec ifconfig wlan0 up}
|
||||
if {[catch {set op [exec /mod/bin/iwlist wlan0 scan]}]} {
|
||||
puts "\[]"
|
||||
exit
|
||||
}
|
||||
|
||||
set lines [split $op "\n"]
|
||||
|
||||
puts "\["
|
||||
set cur 0
|
||||
foreach line [split $op "\n"] {
|
||||
set extra [lassign [split $line :] key val]
|
||||
switch -glob [string trim $key] {
|
||||
*Address {
|
||||
if {$cur} {
|
||||
if {![llength $authtypes]} {
|
||||
lappend authtypes "WEP"
|
||||
}
|
||||
puts ","
|
||||
puts " \"auth\": \"$authtypes\""
|
||||
puts " \},"
|
||||
} else {
|
||||
incr cur
|
||||
}
|
||||
set authtypes {}
|
||||
puts " \{"
|
||||
set mac "$val:[join $extra :]"
|
||||
puts -nonewline " \"address\": \"[string trim $mac]\""
|
||||
}
|
||||
IE {
|
||||
switch -glob [string trim $val] {
|
||||
"WPA Version 1" {
|
||||
lappend authtypes "WPA/"
|
||||
}
|
||||
*WPA2* {
|
||||
lappend authtypes "WPA2/"
|
||||
}
|
||||
}
|
||||
}
|
||||
"Group Cipher" {
|
||||
switch -glob [string trim $val] {
|
||||
TKIP {
|
||||
set x [lindex $authtypes end]
|
||||
append x "TKIP"
|
||||
lset authtypes end $x
|
||||
}
|
||||
CCMP {
|
||||
set x [lindex $authtypes end]
|
||||
append x "AES"
|
||||
lset authtypes end $x
|
||||
}
|
||||
}
|
||||
}
|
||||
"Pairwise Ciphers*" {
|
||||
switch -glob [string trim $val] {
|
||||
*TKIP* {
|
||||
set x [lindex $authtypes end]
|
||||
if {![string match *TKIP* $x]} {
|
||||
if {![string match */ $x]} {
|
||||
append x +
|
||||
}
|
||||
append x "TKIP"
|
||||
}
|
||||
lset authtypes end $x
|
||||
}
|
||||
*CCMP* {
|
||||
set x [lindex $authtypes end]
|
||||
if {![string match *AES* $x]} {
|
||||
if {![string match */ $x]} {
|
||||
append x +
|
||||
}
|
||||
append x "AES"
|
||||
}
|
||||
lset authtypes end $x
|
||||
}
|
||||
}
|
||||
}
|
||||
Protocol {
|
||||
puts ","
|
||||
puts -nonewline " \"protocol\": \"[string trim [
|
||||
string map {802.11 ""} $val]]\""
|
||||
}
|
||||
ESSID {
|
||||
puts ","
|
||||
puts -nonewline " \"ssid\": \"[string trim $val \"]\""
|
||||
}
|
||||
Channel {
|
||||
puts ","
|
||||
puts -nonewline " \"channel\": \"[string trim $val]\""
|
||||
}
|
||||
Quality {
|
||||
puts ","
|
||||
#puts "$val $extra"
|
||||
set q [lindex [split $val /] 0]
|
||||
set s [lindex [split [lindex $extra 0] " "] 0]
|
||||
set n [lindex [split [lindex $extra 1] " "] 0]
|
||||
puts " \"quality\": \"$q\","
|
||||
puts " \"signal\": \"$s\","
|
||||
puts -nonewline " \"noise\": \"$n\""
|
||||
}
|
||||
Encryption?key {
|
||||
puts ","
|
||||
puts -nonewline " \"encryption\": \"[string trim $val]\""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if {$cur} {
|
||||
if {![llength $authtypes]} {
|
||||
lappend authtypes "WEP"
|
||||
}
|
||||
puts ","
|
||||
puts " \"auth\": \"$authtypes\""
|
||||
puts " \}"
|
||||
}
|
||||
|
||||
puts "\]"
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class
|
||||
|
||||
jqplugin enadis
|
||||
jscss xepg.js /css/xepg.css
|
||||
header
|
||||
|
||||
require epg.class spinner.class altrow epg_search totop system.class
|
||||
|
||||
set irinst [system pkginst ir]
|
||||
|
||||
set s [settings]
|
||||
|
||||
if {[$s chanchangenc]} {
|
||||
puts { <script type=text/javascript src=/js/chanchangenc.js></script> }
|
||||
} else {
|
||||
jqplugin confirmAction
|
||||
puts { <script type=text/javascript src=/js/chanchange.js></script> }
|
||||
}
|
||||
|
||||
if {[$s service_style] eq "standard"} {
|
||||
set surl xservice
|
||||
} else {
|
||||
set surl service
|
||||
}
|
||||
|
||||
[spinner new {
|
||||
text "Loading EPG Information..."
|
||||
size "1.2em"
|
||||
style "margin: 1em;"
|
||||
}] start
|
||||
|
||||
require epg_popup
|
||||
|
||||
set now [clock seconds]
|
||||
set stt [cgi_get stt $now]
|
||||
if {$stt <= $now} {
|
||||
set stt $now
|
||||
set current 1
|
||||
} else {
|
||||
set current 0
|
||||
}
|
||||
|
||||
set favgroup [$s channel_group]
|
||||
|
||||
set hours [expr 1.0 * [[settings] xepghours]]
|
||||
if {$hours == 0} { set hours 4.0 }
|
||||
set seconds $($hours * 3600)
|
||||
|
||||
set ostt $stt
|
||||
set stt [expr int($stt / 1800.0) * 1800]
|
||||
|
||||
set ett $(int($stt + $seconds))
|
||||
set offset $(($ostt - $stt) / 1800.0)
|
||||
|
||||
set chanpx 160
|
||||
set eventpx 1000
|
||||
set totalpx $($chanpx + $eventpx)
|
||||
set contwidth $($totalpx + 50)
|
||||
|
||||
set hourpx $($eventpx / $hours)
|
||||
set minpx $($hourpx / 60.0)
|
||||
set secpx $($minpx / 60.0)
|
||||
|
||||
set start [clock milliseconds]
|
||||
if {$::qepg} {
|
||||
if {$favgroup} {
|
||||
set records [epg dbfetch dump \
|
||||
-trange "$stt:$ett" -fav $favgroup]
|
||||
} else {
|
||||
set records [epg dbfetch dump -trange "$stt:$ett"]
|
||||
}
|
||||
|
||||
} else {
|
||||
require channelsort
|
||||
set records [channelsort [epg fetch dump -trange "$stt:$ett"]]
|
||||
}
|
||||
set got [clock milliseconds]
|
||||
|
||||
proc but {label time {active 1}} {
|
||||
puts -nonewline "<button style=\"margin-right: 2em\" tt=$time"
|
||||
if {$active} {
|
||||
puts -nonewline " class=nav"
|
||||
} else {
|
||||
puts -nonewline " disabled class=\"nav ui-state-disabled\""
|
||||
}
|
||||
puts " active=$active>$label</button>"
|
||||
}
|
||||
|
||||
puts "<!-- Hours $hours ($seconds) -->"
|
||||
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
|
||||
|
||||
but "<< -1 Week" $($stt - 3600 * 24 * 7) \
|
||||
$($stt - $now + 3600 >= 3600 * 24 * 7)
|
||||
but "<< -1 Day" $($stt - 3600 * 24) $($stt - $now >= 3600 * 23)
|
||||
but "<< Earlier", $($stt - 3600 * 4) $($stt > $now)
|
||||
#but "< Now >" $now $($current == 0)
|
||||
but "< Now >" $now
|
||||
but ">> Later" $ett;
|
||||
but ">> +1 Day" $($stt + 3600 * 24) $($stt < $now + 8 * 3600 * 24)
|
||||
but ">> +1 Week" $($stt + 3600 * 24 * 7) $($stt < $now + 8 * 3600 * 24)
|
||||
|
||||
puts "</div>"
|
||||
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
\$('button.nav').button();
|
||||
</script>
|
||||
<div id=xepg style=\"min-width: ${contwidth}px; overflow: auto\">
|
||||
<div id=xepgnow></div>
|
||||
<div id=xegrid>
|
||||
"
|
||||
|
||||
puts "<div id=epgdate style=\"width: ${eventpx}px; margin-left: ${chanpx}px;\">"
|
||||
puts [clock format $stt -format {%a %d/%m/%Y}]
|
||||
puts "<input type=hidden id=xepg_dp stt=$stt>"
|
||||
puts "</div>"
|
||||
|
||||
puts "<div class=xechan style=\"width: ${chanpx}px;\"> </div>"
|
||||
for {set i 0} {$i < $hours * 2} {incr i} {
|
||||
puts "<div class=xetime id=xe$i
|
||||
style=\"width: [expr $minpx * 30]px\">"
|
||||
puts "[clock format $($stt + 1800 * $i) -format "%H:%M"]</div>"
|
||||
}
|
||||
|
||||
set lim 0
|
||||
set lcn 0
|
||||
set bg "odd"
|
||||
|
||||
foreach e $records {
|
||||
set chnum [$e get channel_num]
|
||||
if {$chnum == 0} { continue }
|
||||
|
||||
if {$chnum != $lcn} {
|
||||
puts "<div class=xechan style=\"width: ${chanpx}px;\">"
|
||||
|
||||
if {$irinst} {
|
||||
puts "<a class=chanchange chan=$chnum href=#>"
|
||||
}
|
||||
puts "[$e channel_icon 30] "
|
||||
if {$irinst} { puts "</a>" }
|
||||
puts "$chnum
|
||||
<a href=\"/epg/$surl.jim?service=[$e get service_id]\"
|
||||
title=\"[$e get channel_name]\">
|
||||
[$e get channel_name]
|
||||
</a></div>"
|
||||
|
||||
set lcn $chnum
|
||||
set le 0
|
||||
set pos 0
|
||||
if {$bg eq "odd"} { set bg "even" } else { set bg "odd" }
|
||||
}
|
||||
|
||||
set es [$e get start]
|
||||
set ee [expr $es + [$e get duration]]
|
||||
|
||||
if {$es < $le} continue
|
||||
|
||||
if {$es < $stt} { set es $stt }
|
||||
if {$ee > $ett} { set ee $ett }
|
||||
set le $ee
|
||||
|
||||
set left [expr int(($es - $stt) * $secpx)]
|
||||
set right [expr int(($ee - $stt - 1) * $secpx)]
|
||||
set px $($right - $left)
|
||||
if {$pos < $left} {
|
||||
set px $($px + $left - $pos - 1)
|
||||
} elseif {$pos > $left} {
|
||||
set px $($px - ($pos - $left - 1))
|
||||
}
|
||||
incr pos $px
|
||||
|
||||
$e process_sched
|
||||
|
||||
set recopts 1
|
||||
if {[$e get series_crid] ne ""} { set recopts 2 }
|
||||
|
||||
set perc [$e percent]
|
||||
set showing 0
|
||||
if {$perc > 0 && $perc < 100} { set showing 1 }
|
||||
|
||||
set txt "[cgi_quote_html [$e get name]] <span>([\
|
||||
clock format $es -format "%H:%M"] - [\
|
||||
clock format $ee -format "%H:%M"])"
|
||||
if {$showing} { append txt " ($perc%)" }
|
||||
append txt "</span>"
|
||||
|
||||
set htxt "[cgi_quote_html [$e get name]] ([\
|
||||
clock format $es -format "%H:%M"] - [\
|
||||
clock format $ee -format "%H:%M"])"
|
||||
if {$showing} { append hxt " ($perc%)" }
|
||||
|
||||
set lbg $bg
|
||||
if {[$e scheduled]} { set lbg "blueshade" }
|
||||
|
||||
puts "<div class=\"xeprog $lbg\"
|
||||
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
|
||||
<a class=event href=# xs=[$e get service_id]
|
||||
xe=[$e get event_id] sch=[$e get sched_type]
|
||||
rec=$recopts>"
|
||||
puts $txt
|
||||
puts "</a>"
|
||||
puts "</div>"
|
||||
}
|
||||
puts "<div id=keypos style=\"float: left; clear: left;\"></div>"
|
||||
puts "</div>"
|
||||
puts "</div>"
|
||||
|
||||
set earlier $($stt - 3600 * 4)
|
||||
|
||||
puts "
|
||||
|
||||
<div style=\"clear: both;\">
|
||||
<small><button id=epgswitch>
|
||||
Switch to standard now/next display.
|
||||
</button></small>
|
||||
</div>
|
||||
"
|
||||
|
||||
if {$current} {
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
\$(function() {
|
||||
"
|
||||
puts {
|
||||
|
||||
var kt = $('#xe0');
|
||||
var ktpos = kt.position();
|
||||
|
||||
var height = $('#keypos').position().top - ktpos.top;
|
||||
|
||||
}
|
||||
puts "var nowpos = ktpos.left + (kt.width() * $offset);"
|
||||
puts {
|
||||
$('#xepgnow')
|
||||
.css('left', nowpos + 'px')
|
||||
.css('top', ktpos.top)
|
||||
.height(height)
|
||||
.show('slow');
|
||||
}
|
||||
|
||||
puts "
|
||||
});
|
||||
</script>
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
<a href=/settings/settings.jim>
|
||||
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
Visit settings to change EPG options.
|
||||
</a><br>
|
||||
"
|
||||
|
||||
epg cleanup
|
||||
|
||||
set end [clock milliseconds]
|
||||
puts "<font class=footnote>
|
||||
Retrieved in: [expr [expr $got - $start] / 1000.0] seconds.
|
||||
</font>"
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
$(function() {
|
||||
|
||||
$('#epgswitch').button().click(function() {
|
||||
window.location = '/epg/list.jim';
|
||||
});
|
||||
|
||||
$('button.nav').click(function() {
|
||||
window.location = '/cgi-bin/xepg.jim?stt=' + $(this).attr('tt') +
|
||||
'&pos=' + $('#xegrid').scrollTop();
|
||||
});
|
||||
|
||||
$('#xepg_dp').datepicker({
|
||||
buttonImage: '/img/cal.gif',
|
||||
buttonImageOnly: true,
|
||||
showOn: 'button',
|
||||
dateFormat: '@',
|
||||
minDate: 0,
|
||||
maxDate: 8,
|
||||
onSelect: function(val, sel) {
|
||||
var stt = $(this).attr('stt');
|
||||
// Extract date part
|
||||
dval = Math.round(val / 86400000.0);
|
||||
// Extract current time part
|
||||
var tm = ~~(stt % 86400);
|
||||
|
||||
var ret = dval * 86400 + tm;
|
||||
|
||||
window.location = '/cgi-bin/xepg.jim?stt=' + ret;
|
||||
}
|
||||
});
|
||||
|
||||
$('img.ui-datepicker-trigger').hover(
|
||||
function() { $(this).css('cursor', 'pointer'); },
|
||||
function() { $(this).css('cursor', 'auto'); }
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
26
webif/html/404.jim
Executable file
26
webif/html/404.jim
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
set delay 5
|
||||
|
||||
httpheader "text/html" 0 "Refresh: $delay; url=/\r\n"
|
||||
header
|
||||
|
||||
puts "
|
||||
|
||||
<div width=100%>
|
||||
<center>
|
||||
<div>
|
||||
<img src=/img/404.png>
|
||||
</div>
|
||||
<div>
|
||||
Redirecting to main menu in $delay seconds...
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
"
|
||||
|
||||
footer
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
function refresh_files()
|
||||
{
|
||||
$('#backup_files').load('files.jim', function() {
|
||||
$('input.restore').change(function() {
|
||||
$('#restore_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
$('#delete_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
$('#view_button').removeAttr('disabled')
|
||||
.button('option', 'disabled', false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('button').button();
|
||||
|
||||
refresh_files();
|
||||
|
||||
$('#backup_button').click(function() {
|
||||
$('#backup_working').slideDown();
|
||||
$('#results').load('backup.jim?' +
|
||||
$('#backup_name').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
$('#backup_working').slideUp();
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#delete_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
if (confirm('Confirm deletion of ' + backup))
|
||||
{
|
||||
$('#results').load('delete.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#view_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
$('#results').load('view.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
refresh_files();
|
||||
});
|
||||
});
|
||||
});
|
||||
$('#restore_button').click(function() {
|
||||
var backup = $('input.restore:checked').val();
|
||||
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('restore.jim?' +
|
||||
$('input.restore').serialize(), function() {
|
||||
$('#results').slideDown(function() {
|
||||
$('#restore_working').slideUp();
|
||||
refresh_files();
|
||||
$('#restore_warning').slideDown();
|
||||
$('#restart_block').load(
|
||||
'/cgi-bin/restartblock.jim');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
|
||||
require rsv.class findhsvc
|
||||
|
||||
set dir /mod/var/backup
|
||||
|
||||
httpheader
|
||||
|
||||
set file [file tail [cgi_get restore_file]]
|
||||
if {$file == 0} {
|
||||
puts "No filename supplied."
|
||||
exit
|
||||
}
|
||||
|
||||
set ffile "/$dir/$file.rbk"
|
||||
|
||||
if {![file exists $ffile]} {
|
||||
puts "Backup file <i>$file</i> does not exist."
|
||||
exit
|
||||
}
|
||||
|
||||
if {[catch { set fd [open $ffile r] } msg]} {
|
||||
puts "Error opening <i>$file</i> - $msg"
|
||||
exit
|
||||
}
|
||||
|
||||
puts "Listing scheduled events from <i>$file</i>..."
|
||||
|
||||
set fields [lsort [[rsv] vars]]
|
||||
|
||||
set data [split [read $fd] "\n"]
|
||||
|
||||
foreach line $data {
|
||||
set vals [split $line "\t"]
|
||||
if {[lindex $vals 0] ne "event"} { continue }
|
||||
set vars {}
|
||||
set i 0
|
||||
foreach f $fields {
|
||||
if {$f eq "aulEventToRecordInfo"} { continue }
|
||||
incr i
|
||||
lappend vars $f [lindex $vals $i]
|
||||
}
|
||||
|
||||
set rsv [rsv new $vars]
|
||||
|
||||
puts " [$rsv name] ([$rsv channel_name])"
|
||||
}
|
||||
|
||||
close $fd
|
||||
rsv cleanup
|
||||
|
||||
21
webif/html/browse/_dir.jim
Executable file
21
webif/html/browse/_dir.jim
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require pack
|
||||
source /mod/webif/lib/setup
|
||||
require json
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set root [cgi_get dir]
|
||||
# Strip double slashes
|
||||
regsub -all -- {\/+} "$root/*" "/" root
|
||||
|
||||
puts "{"
|
||||
foreach _ [glob -nocomplain "$root/_*"] {
|
||||
set node [lindex [split [file dirname $_] /] end]
|
||||
puts "\"[jescape $node]\": 1,"
|
||||
}
|
||||
puts "\"dummy\" : 0"
|
||||
puts "}"
|
||||
|
||||
@@ -14,7 +14,7 @@ set act [cgi_get act "update"]
|
||||
|
||||
if {$act eq "fetch"} {
|
||||
httpheader "application/json"
|
||||
set data [{dir expiry} $dir]
|
||||
set data [dir expiry $dir]
|
||||
puts "{"
|
||||
puts " \"days\": \"$data(days)\","
|
||||
puts " \"keep\": \"$data(keep)\","
|
||||
@@ -44,6 +44,6 @@ if {![file isdirectory $dir]} {
|
||||
exit
|
||||
}
|
||||
|
||||
{dir expiry} $dir $data
|
||||
dir expiry $dir $data
|
||||
puts "Ok."
|
||||
|
||||
|
||||
@@ -9,15 +9,11 @@ puts {
|
||||
<li class=cut><a href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
|
||||
|
||||
<li class=separator><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
<li class="separator rename"><a href=#rename>Rename</a></li>
|
||||
<li class=download><a href=#download>Download</a></li>
|
||||
|
||||
}
|
||||
if {$model eq "HDR"} {
|
||||
puts { <li class="separator decrypt"><a href=#decrypt>Decrypt</a></li> }
|
||||
puts { <li class="compress"><a href=#strip>Shrink</a></li> }
|
||||
} else {
|
||||
puts { <li class="compress separator"><a href=#strip>Shrink</a></li> }
|
||||
<li class="separator decrypt"><a href=#decrypt>Decrypt</a></li>
|
||||
<li class="compress"><a href=#strip>Shrink</a></li>
|
||||
}
|
||||
if {[system pkginst ffmpeg]} {
|
||||
puts {
|
||||
@@ -27,19 +23,19 @@ if {[system pkginst ffmpeg]} {
|
||||
}
|
||||
}
|
||||
|
||||
puts { <li><a href=#vthm>View Thumbnail</a></li> }
|
||||
puts { <li class=thm><a href=#vthm>View Thumbnail</a></li> }
|
||||
|
||||
puts { <li class=bookmark><a href=#bmarks>Bookmarks</a></li> }
|
||||
|
||||
if $nicesplice {
|
||||
if {$nicesplice} {
|
||||
puts {
|
||||
<li class="cut"><a href=#crop>Crop</a></li>
|
||||
<li class="cut"><a href=#chunk>Split (45m parts)</a></li>
|
||||
}
|
||||
}
|
||||
puts {
|
||||
<li class=separator><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
<li class="separator lock"><a href=#lock>Toggle Lock</a></li>
|
||||
<li class=new><a href=#new>Toggle New</a></li>
|
||||
}
|
||||
|
||||
if {[llength $plugins(menu)]} {
|
||||
@@ -57,8 +53,17 @@ puts {
|
||||
<li class=cut><a href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
|
||||
|
||||
<li class=separator><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
<li class="separator rename"><a href=#rename>Rename</a></li>
|
||||
<li class="download"><a href=#download>Download</a></li>
|
||||
}
|
||||
if {[llength $plugins(omenu)]} {
|
||||
foreach plugin $plugins(omenu) {
|
||||
lassign $plugin tag options
|
||||
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
|
||||
}
|
||||
}
|
||||
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
<ul id=dooptmenu class=contextMenu style="width: 250px">
|
||||
@@ -70,28 +75,17 @@ puts {
|
||||
</ul>
|
||||
|
||||
<ul id=doptmenu class=contextMenu style="width: 250px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<li class=cut><a href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
|
||||
<li class=pwpaste><a href=#paste>Paste to folder</a></li>
|
||||
<li class=separator><a href=#rename>Rename</a></li>
|
||||
<li class=delete><a class=notself href=#delete>Delete</a></li>
|
||||
<li class=cut><a class=notself href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a class=notself href=#copy>Copy to clipboard</a></li>
|
||||
<li class=pwpaste><a class=notself href=#paste>Paste to folder</a></li>
|
||||
<li class="separator rename"><a class=notself href=#rename>Rename</a></li>
|
||||
<li class=separator><a href=#resetnew>Reset new flag</a></li>
|
||||
<li class="separator compress"><a href=#shrink>Auto-Shrink</a></li>
|
||||
<li class="compressr"><a href=#shrinkr>Recursive Auto-Shrink</a></li>
|
||||
<li class=compressr><a href=#shrinkr>Recursive Auto-Shrink</a></li>
|
||||
<li class=dedup><a href=#dedup>Auto-Dedup</a></li>
|
||||
}
|
||||
if {$model eq "HDR"} {
|
||||
puts {
|
||||
<li class=decrypt><a href=#decrypt>Auto-Decrypt</a></li>
|
||||
<li class=decryptr><a href=#decryptr>Recursive Auto-Decrypt
|
||||
</a></li>
|
||||
}
|
||||
}
|
||||
if $flatten {
|
||||
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
|
||||
}
|
||||
|
||||
puts {
|
||||
<li class=decrypt><a href=#decrypt>Auto-Decrypt</a></li>
|
||||
<li class=decryptr><a href=#decryptr>Recursive Auto-Decrypt</a></li>
|
||||
<li class=clock><a href=#expire>Auto-Expire Options</a></li>
|
||||
}
|
||||
|
||||
@@ -180,9 +174,9 @@ puts {
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
}
|
||||
|
||||
set glist [ts genrelist]
|
||||
foreach genre [array names glist] {
|
||||
lassign $glist($genre) txt img
|
||||
foreach genre [dict keys $::epg::genrelist] {
|
||||
lassign $::epg::genrelist($genre) txt img
|
||||
if {$txt eq "Unknown" } continue
|
||||
if {$img eq "Unclassified"} {
|
||||
set img /images/173_3_26_G3_$img.png
|
||||
} else {
|
||||
@@ -229,7 +223,7 @@ puts {
|
||||
style="display: none">
|
||||
<div class=pre id=savestream_detail></div>
|
||||
<div id=savestream_retrieving>
|
||||
<img src=/img/loading.gif> Retrieving details...
|
||||
<img src=/img/spin.gif> Retrieving details...
|
||||
</div>
|
||||
<form id=savestream_form class=hidden>
|
||||
}
|
||||
@@ -248,7 +242,7 @@ puts {
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
<span id=savestream_spin>
|
||||
<img src=/img/loading.gif> Saving...
|
||||
<img src=/img/spin.gif> Saving...
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -344,19 +338,23 @@ puts {
|
||||
|
||||
</table>
|
||||
<div id=aexpiry_working class=hidden>
|
||||
<img src=/img/loading.gif> Applying changes...
|
||||
<img src=/img/spin.gif> Applying changes...
|
||||
</div>
|
||||
<div id=aexpiry_loading class=hidden>
|
||||
<img src=/img/loading.gif> Retrieving data...
|
||||
<img src=/img/spin.gif> Retrieving data...
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=dialogue></div>
|
||||
<div id=dialogue>
|
||||
<img src=/img/spin.gif>Retrieving data...
|
||||
</div>
|
||||
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
|
||||
<div id=pwdialogue style="display: none">
|
||||
<center>
|
||||
<img src=/img/loading.gif>
|
||||
<img src=/img/spin.gif>
|
||||
<br><br>
|
||||
Please wait...
|
||||
<div id=pwfeedback></div>
|
||||
@@ -366,6 +364,5 @@ Please wait...
|
||||
<div id=bmpdialogue title="Recording Thumbnail" class=hidden>
|
||||
<img id=thmbmp class=doublebmp src="about:blank">
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -35,13 +35,12 @@ puts "
|
||||
<div id=audiodiv style=\"padding: 1em\">
|
||||
<button id=audioit>Perform audio extraction - $type</button>
|
||||
</div>
|
||||
<button id=back>Back to media list</button>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Extracting audio: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -15,12 +15,13 @@ $(document).ready(function() {
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
window.location = '/go/browse?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#audioit').button().click(function() {
|
||||
$('#audiodiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
$('#back').hide();
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
|
||||
function() {
|
||||
|
||||
@@ -18,24 +18,11 @@ set base [file rootname $rfile]
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
set cmd [list ffmpeg -y -benchmark -v 0 -i "$rfile" -f mp3 -vn]
|
||||
set slow [[settings] audiomp3]
|
||||
|
||||
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 \
|
||||
--song "[$ts get title]" \
|
||||
--comment "[$ts get synopsis]" \
|
||||
--album "[$ts get channel_name]" \
|
||||
--year "[clock format [$ts get start] -format {%Y}]" \
|
||||
"${base}.mp3"]
|
||||
}
|
||||
set token [system startop -multiple mp3 $rfile]
|
||||
puts [$ts mkmp3 $slow]
|
||||
system endop $token
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
@@ -119,7 +119,7 @@ $('#save').button({icons: {primary: "ui-icon-disk"}})
|
||||
|
||||
$('#back').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"}})
|
||||
.on('click', function() {
|
||||
window.location = '../index.jim?dir=' + dir;
|
||||
window.location = '/go/browse?dir=' + encodeURIComponent(dir);
|
||||
});
|
||||
|
||||
$('#update').button()
|
||||
|
||||
@@ -53,12 +53,9 @@ puts "
|
||||
<div id=chunkdiv style=\"padding: 1em\">
|
||||
<button id=chunkit>Split recording into $part parts</button>
|
||||
</div>
|
||||
|
||||
<div id=findiv style=\"padding: 1em\" class=hidden>
|
||||
<button id=back dir=\"[cgi_quote_url [file dirname $rfile]]\">
|
||||
Back to Media Browser
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
"
|
||||
|
||||
@@ -48,7 +48,7 @@ function xpart(part)
|
||||
else
|
||||
{
|
||||
clearInterval(handle);
|
||||
$('#findiv').show('slow');
|
||||
$('#back').show('slow');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ $('#chunkit').button().click(function(e) {
|
||||
e.preventDefault();
|
||||
$('#chunkdiv').hide('slow');
|
||||
$('tr.part').show('slow');
|
||||
$('#back').hide();
|
||||
|
||||
handle = setInterval("xprogress()", 1000);
|
||||
xpart(0);
|
||||
@@ -69,7 +70,7 @@ $('#back').button().click(function(e) {
|
||||
e.preventDefault();
|
||||
var dir = $(this).attr('dir');
|
||||
|
||||
window.location = '../index.jim?dir=' + dir;
|
||||
window.location = '/go/browse?dir=' + dir;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
|
||||
heepheader
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file]
|
||||
set part [cgi_get part]
|
||||
|
||||
@@ -11,12 +11,13 @@ cgi_input 1
|
||||
set cb [[clipboard new {path "/tmp/webif-browse.cb"}] load]
|
||||
|
||||
set action [cgi_get act list]
|
||||
set imgpath "/lib/jquery.plugin/contextMenu/images"
|
||||
|
||||
switch $action {
|
||||
list {
|
||||
if {![$cb size]} {
|
||||
puts "<i>Clipboard is empty</i>"
|
||||
break
|
||||
exit
|
||||
}
|
||||
puts "<div class=cliplist>"
|
||||
foreach file [$cb get items] {
|
||||
@@ -27,7 +28,7 @@ switch $action {
|
||||
set path [$file get path]
|
||||
set xpath [cgi_quote_html $path]
|
||||
puts "<span title=\"$xpath\" alt=\"$xpath\">"
|
||||
puts "<img src=/img/context/$img.png>"
|
||||
puts "<img src=$imgpath/$img.png>"
|
||||
set dfile [file tail $path]
|
||||
if {[string length $dfile] > 25} {
|
||||
set dfile "[string range $dfile 0 22]..."
|
||||
@@ -42,9 +43,10 @@ switch $action {
|
||||
<img border=0 src=/img/close.png height=16></a>"
|
||||
puts "</span>"
|
||||
}
|
||||
puts "</div>"
|
||||
puts "</div><div class=clipbuttons>"
|
||||
puts "<button id=paste>Paste to current folder</button>"
|
||||
puts "<button id=clipclear>Empty clipboard</button>"
|
||||
puts "</div>"
|
||||
}
|
||||
add {
|
||||
if {[set path [cgi_get path]] eq "0"} {
|
||||
@@ -88,7 +90,7 @@ switch $action {
|
||||
if {$mode eq "cut"} {
|
||||
catch {file rename $path "$dir/$file"}
|
||||
} else {
|
||||
catch {puts [exec /mod/bin/busybox/cp -r \
|
||||
catch {puts [exec cp -r \
|
||||
$path $dir]}
|
||||
}
|
||||
} elseif {[string match {*.ts} $path]} {
|
||||
|
||||
@@ -4,8 +4,8 @@ package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
jqplugin progressbar
|
||||
jscss crop.js
|
||||
jqplugin progressbar iphone-style-checkboxes
|
||||
jscss crop.js style.css
|
||||
header
|
||||
|
||||
set rfile [cgi_get file]
|
||||
@@ -23,13 +23,13 @@ puts "
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format \"%T\"]</td></tr>
|
||||
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
|
||||
<tr><th>Bookmarks:</th><td>[$ts get bookmarks] @ "
|
||||
<tr><th>Bookmarks:</th><td id=originalbookmarks>[$ts get bookmarks] @ "
|
||||
|
||||
puts [join [lmap i [$ts bookmarks 1] {
|
||||
clock format $i -format "%T"
|
||||
}] ", "]
|
||||
|
||||
puts "</td></tr><tr><th>File</th><td>"
|
||||
puts "</td></tr><tr><th> </th><td id=cutplan>"
|
||||
|
||||
puts "<div style=\"position: relative; top: -10px\">"
|
||||
|
||||
@@ -48,14 +48,21 @@ append bookmarks [$ts bookmarks]
|
||||
set keeping 0
|
||||
set last 0
|
||||
set start -1
|
||||
set newbookmarks "0 "
|
||||
set cur 0
|
||||
foreach b $bookmarks {
|
||||
if {$start < 0} {
|
||||
# Start of a section to keep
|
||||
set start $b
|
||||
continue
|
||||
}
|
||||
# End of a section to keep
|
||||
set end $b
|
||||
|
||||
incr keeping $($end - $start)
|
||||
set l $($end - $start)
|
||||
incr keeping $l
|
||||
incr cur $l
|
||||
append newbookmarks "[expr $cur + 3] "
|
||||
|
||||
set left $($start * 500 / $len)
|
||||
set right $($end * 500 / $len)
|
||||
@@ -69,6 +76,7 @@ foreach b $bookmarks {
|
||||
}
|
||||
|
||||
if {$start > 0} {
|
||||
# Still in a keep section...
|
||||
incr keeping $($len - $start)
|
||||
set left $($start * 500 / $len)
|
||||
div cut $last $($left - 1)
|
||||
@@ -77,6 +85,10 @@ if {$start > 0} {
|
||||
div cut $last 500
|
||||
}
|
||||
|
||||
if {$cur > $keeping - 8 && $keeping - 8 > 0} {
|
||||
set newbookmarks [lreplace $newbookmarks end end $($keeping - 8)]
|
||||
}
|
||||
|
||||
set keepperc $($keeping * 100.0 / $len)
|
||||
set esttime $(int($keeping * 0.025))
|
||||
if {[$ts get definition] eq "HD"} { set esttime $($esttime * 4) }
|
||||
@@ -86,30 +98,53 @@ puts "
|
||||
</td></tr>
|
||||
<tr><th>Keeping:</th><td>
|
||||
[clock format $keeping -format "%T"] ([format "%.2f" $keepperc]%)
|
||||
</td></tr>
|
||||
</td></tr>"
|
||||
|
||||
puts "
|
||||
<tr>
|
||||
<th title=\"Calculated bookmarks for edit points following crop.\">
|
||||
New Bookmarks:
|
||||
</th><td id=newbookmarks>
|
||||
<span id=bookmarks val=\"$newbookmarks\">
|
||||
$newbookmarks</span> (
|
||||
"
|
||||
puts [join [lmap i $newbookmarks {
|
||||
clock format $i -format "%T"
|
||||
}] ", "]
|
||||
|
||||
puts " )</td></tr>"
|
||||
|
||||
puts "
|
||||
<tr><th>Time:</th>
|
||||
<td>Cropping will take around [clock format $esttime -format "%T"]</td></tr>
|
||||
</table>
|
||||
|
||||
<span class=hidden id=params
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
file=\"$rfile\"
|
||||
perc=\"$keepperc\"
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
></span>
|
||||
|
||||
<div id=cropdiv style=\"padding: 1em\">
|
||||
<button id=invert invert=$invert>Invert selection</button>
|
||||
<button id=cropit>Perform crop operation</button>
|
||||
<table><tr>
|
||||
<td><button id=invert invert=$invert>Invert selection</button></td>
|
||||
<td><button id=cropit>Perform crop operation</button></td>
|
||||
<td>
|
||||
Save new bookmarks?
|
||||
<input id=saveit type=checkbox name=saveit checked>
|
||||
<label id=saveitlabel for=saveit> </label>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<button id=back>Back to media list</button>
|
||||
<button id=save class=\"hidden\">Save New Bookmarks</button>
|
||||
<div id=results class=\"hidden blood\"></div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Cropping: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back>Back to media list</button>
|
||||
|
||||
<div id=output class=\"hidden pre\" style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
|
||||
@@ -1,42 +1,81 @@
|
||||
var handle = 0;
|
||||
|
||||
function escapestring(str)
|
||||
{
|
||||
str = JSON.stringify(String(str));
|
||||
str = str.substring(1, str.length - 1);
|
||||
return str;
|
||||
}
|
||||
|
||||
function update()
|
||||
{
|
||||
var perc = $('#params').attr('perc');
|
||||
var file = $('#params').attr('file');
|
||||
|
||||
$.get('progress.jim' + '?perc=' + perc + '&file=' + file,
|
||||
function(data) {
|
||||
$.get('progress.jim', {
|
||||
'perc': $('#params').attr('perc'),
|
||||
'file': $('#params').attr('file')
|
||||
}, function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
|
||||
$('[type="checkbox"]').iphoneStyle({
|
||||
checkedLabel: 'YES',
|
||||
uncheckedLabel: 'NO'
|
||||
});
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
window.location = '/go/browse?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#save').button({icons: {primary: "ui-icon-disk"}})
|
||||
.on('click', function() {
|
||||
$('#progressdiv,#output,#save').hide('slow');
|
||||
$.post('../bookmarks/save.jim', {
|
||||
'file': $('#fileparams').attr('file'),
|
||||
'bookmarks': $('#bookmarks').attr('val')
|
||||
}, function(data) {
|
||||
$('#results').html(data)
|
||||
.slideDown('slow')
|
||||
.delay(6000)
|
||||
.slideUp('slow');
|
||||
$('#originalbookmarks')
|
||||
.html($('#newbookmarks').clone());
|
||||
});
|
||||
});
|
||||
|
||||
$('#cropit').button().click(function() {
|
||||
$('#cropdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
$('#back').hide();
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').show().text('Please do not interrupt...')
|
||||
.load('execute.jim?file=' + $('#params').attr('file') +
|
||||
'&invert=' + $('#invert').attr('invert'),
|
||||
function() {
|
||||
.load('execute.jim', {
|
||||
'file': $('#params').attr('file'),
|
||||
'invert': $('#invert').attr('invert')
|
||||
}, function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#back,#save').show();
|
||||
$('#cutplan').html('File cropping complete');
|
||||
$('#originalbookmarks').empty();
|
||||
$('#progressbar').reportprogress(100);
|
||||
if ($('#saveit').prop('checked'))
|
||||
{
|
||||
$('#save').trigger('click');
|
||||
$('#progressdiv')
|
||||
.delay(3000)
|
||||
.text('Cropping complete.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#invert').button().on('click', function() {
|
||||
window.location = 'crop.jim?file=' + $('#params').attr('file') +
|
||||
window.location = 'crop.jim?file=' +
|
||||
escapestring($('#params').attr('file')) +
|
||||
'&invert=' + ($(this).attr('invert') == '1' ? '0' : '1');
|
||||
});
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ if {[system inuse $rfile]} {
|
||||
exit
|
||||
}
|
||||
|
||||
set ts [ts fetch $rfile]
|
||||
set ts [ts fetch_or_error $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
@@ -60,16 +60,15 @@ if {$invert} {
|
||||
lappend cmd "-cutBookMarks"
|
||||
}
|
||||
|
||||
puts "CMD: $cmd"
|
||||
#puts "CMD: $cmd"
|
||||
|
||||
set token [system startop -multiple crop $rfile]
|
||||
puts [exec {*}$cmd]
|
||||
#puts [exec /mod/bin/nicesplice \
|
||||
# -in "$origdir/$shname" \
|
||||
# -out "$dir/$shname" \
|
||||
# -cutBookMarks]
|
||||
system endop $token
|
||||
|
||||
set newname "$shname-[clock seconds]"
|
||||
puts "Renaming file group to $newname"
|
||||
puts "<span class=hidden id=fileparams file=\"$dir/$newname.ts\"></span>"
|
||||
ts renamegroup "$dir/$shname.ts" $newname
|
||||
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
|
||||
# New nicesplice shrinks whilst cropping.
|
||||
|
||||
13
webif/html/browse/crop/style.css
Normal file
13
webif/html/browse/crop/style.css
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
div.switchlabel
|
||||
{
|
||||
height: 27px;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
div.sliderlabel
|
||||
{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
@@ -3,64 +3,67 @@
|
||||
package require sqlite3
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
require ts.class system.class
|
||||
|
||||
jqplugin progressbar
|
||||
jscss decrypt.js
|
||||
header
|
||||
|
||||
set mode "dlna"
|
||||
if {[system model] eq "HD"} { set mode "direct" }
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
lassign [$ts dlnaloc "127.0.0.1"] url
|
||||
|
||||
if {$mode eq "dlna"} {
|
||||
if {![system is_listening 9000]} {
|
||||
puts {
|
||||
<div id=sysnotify class=warningbox style="width: 90%"><center>
|
||||
The Humax media server is not running.<br>
|
||||
Decryption will not use hardware acceleration.<br>
|
||||
Have you enabled <i>Content Sharing</i> in the Humax menus?<br>
|
||||
</center></div>
|
||||
}
|
||||
set mode "direct"
|
||||
}
|
||||
}
|
||||
|
||||
if {$mode eq "dlna"} {
|
||||
set method "Hardware accelerated (via DLNA)"
|
||||
} else {
|
||||
set method "Directly without hardware acceleration"
|
||||
}
|
||||
|
||||
puts "
|
||||
|
||||
<fieldset class=cleft>
|
||||
<legend>Decrypt in-place</legend>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<tr><th>File:</th><td>$rfile</td></tr>
|
||||
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
||||
<tr><th>DLNA URL</th><td>$url</td></tr>
|
||||
<tr><th>Decryption method:</th><td>$method</td></tr>
|
||||
</table>
|
||||
"
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
exit
|
||||
}
|
||||
|
||||
if {![system is_listening 9000]} {
|
||||
puts "The Humax media server is not running, cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
puts "It can sometimes turn itself off so it's worth double checking."
|
||||
puts "If it is on then try turning sharing off and on again."
|
||||
exit
|
||||
}
|
||||
|
||||
puts "
|
||||
|
||||
<span class=hidden id=params
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
file=\"[cgi_quote_url $rfile]\"
|
||||
mode=\"$mode\"
|
||||
></span>
|
||||
|
||||
<div id=decryptdiv style=\"padding: 1em\">
|
||||
<div style=\"padding: 1em\">
|
||||
<span id=decryptdiv>
|
||||
<button id=decryptit>Perform decryption</button>
|
||||
</span>
|
||||
<button id=back>Back to media list</button>
|
||||
</div>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Decrypting: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
<div id=output class=\"hidden pre\" style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
"
|
||||
|
||||
|
||||
@@ -3,26 +3,31 @@ var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$.get('progress.jim?file=' + $('#params').attr('file'),
|
||||
$.get('progress.jim?file=' + $('#params').attr('file') +
|
||||
'&mode=' + $('#params').attr('mode'),
|
||||
function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
window.location = '/go/browse?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#decryptit').button().click(function() {
|
||||
$('#decryptdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
$('#back').hide();
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').load('execute.jim?file=' + $('#params').attr('file'),
|
||||
$('#output')
|
||||
.show()
|
||||
.load('execute.jim?file=' + $('#params').attr('file') +
|
||||
'&mode=' + $('#params').attr('mode'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
|
||||
@@ -8,15 +8,32 @@ require ts.class system.class
|
||||
httpheader
|
||||
|
||||
set rfile [cgi_get file]
|
||||
set mode [cgi_get mode dlna]
|
||||
set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
set len [$ts duration 1]
|
||||
lassign [$ts dlnaloc "127.0.0.1"] url
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
exit
|
||||
if {$mode eq "dlna"} {
|
||||
lassign [$ts dlnaloc "127.0.0.1"] url
|
||||
if {$url ne ""} {
|
||||
# File is indexed
|
||||
set helper 0
|
||||
} else {
|
||||
if {[catch {
|
||||
lassign [system dlnahelper [\
|
||||
file normalize $rfile]] url
|
||||
} msg]} {
|
||||
puts "Error: Cannot obtain DLNA access to file."
|
||||
exit
|
||||
}
|
||||
set helper 1
|
||||
}
|
||||
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
if {[system inuse $rfile]} {
|
||||
@@ -32,37 +49,53 @@ if {![file exists $origdir]} { file mkdir $origdir }
|
||||
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
flush stdout
|
||||
|
||||
if {[file exists "$origdir/$shname.ts"]} {
|
||||
puts "The file already exists in _original, cannot decrypt."
|
||||
exit
|
||||
}
|
||||
set token [system startop -multiple decrypt $rfile]
|
||||
set err 0
|
||||
if {$mode eq "dlna"} {
|
||||
if {[catch {exec wget -O "$rfile.decrypting" $url} msg opts]} {
|
||||
puts "Wget error - $msg - $opts"
|
||||
incr err
|
||||
}
|
||||
|
||||
exec wget -O "$rfile.decrypting" $url
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
|
||||
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"
|
||||
# Release the helper lock once finished.
|
||||
if {$helper} { system dlnahelper -release }
|
||||
} else {
|
||||
if {[catch {
|
||||
exec /mod/bin/stripts -@@ "$base" "$base.decrypting"
|
||||
} msg opts]} {
|
||||
puts "Decrypt error - $msg - $opts"
|
||||
incr err
|
||||
}
|
||||
}
|
||||
|
||||
if {[file exists "$dir/$shname.hmt"]} {
|
||||
exec /mod/bin/hmt -encrypted "$dir/$shname.hmt"
|
||||
system endop $token
|
||||
|
||||
if {$err} exit
|
||||
|
||||
puts "Moving recording to $origdir"
|
||||
|
||||
$ts move "${origdir}" 1
|
||||
|
||||
if {$mode eq "dlna"} {
|
||||
file rename "$rfile.decrypting" $rfile
|
||||
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/$shname.ts"
|
||||
}
|
||||
}
|
||||
if {[file exists "$dir/$shname.hmt"]} {
|
||||
exec /mod/bin/hmt -encrypted "$dir/$shname.hmt"
|
||||
}
|
||||
} else {
|
||||
foreach ext $::tsgroup {
|
||||
if {![file exists "$base.decrypting.$ext"]} continue
|
||||
file rename "$base.decrypting.$ext" $base.$ext
|
||||
}
|
||||
}
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
|
||||
@@ -7,13 +7,20 @@ require ts.class
|
||||
httpheader
|
||||
|
||||
set tsfile [cgi_get file]
|
||||
set mode [cgi_get mode dlna]
|
||||
set rfile [file normalize $tsfile]
|
||||
|
||||
if {![file exists "$rfile.decrypting"]} {
|
||||
if {$mode eq "dlna"} {
|
||||
set file "$rfile.decrypting"
|
||||
} else {
|
||||
set file "[file rootname $rfile].decrypting.ts"
|
||||
}
|
||||
|
||||
if {![file exists "$file"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [file size "$rfile.decrypting"]
|
||||
set nsz [file size "$file"]
|
||||
|
||||
puts [expr $nsz * 100 / $sz]
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ set dir [cgi_get dir]
|
||||
|
||||
#puts "DIR: ($dir)"
|
||||
|
||||
puts "<div id=deleting class=blood><img src=/img/loading.gif>Deleting...</div>"
|
||||
puts "<div id=deleting class=blood><img src=/img/spin.gif>Deleting...</div>"
|
||||
puts "<ul style=\"list-style-type: square\">"
|
||||
|
||||
foreach file [cgi_get files] {
|
||||
|
||||
29
webif/html/browse/dequeue.jim
Executable file
29
webif/html/browse/dequeue.jim
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class queue.class
|
||||
|
||||
httpheader
|
||||
|
||||
set dir [cgi_get dir]
|
||||
|
||||
puts "<div id=deleting class=blood><img src=/img/spin.gif>De-queuing...</div>"
|
||||
puts "<ul style=\"list-style-type: square\">"
|
||||
|
||||
foreach file [cgi_get files] {
|
||||
puts -nonewline "<li>\"$file\"..."
|
||||
|
||||
if {[string first "$dir/" $file] != 0} {
|
||||
puts "Error - outside directory."
|
||||
continue
|
||||
}
|
||||
|
||||
set ts [ts fetch $file]
|
||||
if {$ts eq "0"} continue
|
||||
|
||||
queue delete $ts
|
||||
puts "</li>"
|
||||
}
|
||||
puts "</ul>"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
require ts.class json
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
@@ -11,9 +11,9 @@ if {$file == 0} exit
|
||||
set ts [ts fetch $file]
|
||||
|
||||
puts "{"
|
||||
puts "\"title\" : \"[$ts get title]\","
|
||||
puts "\"synopsis\" : \"[$ts get synopsis]\","
|
||||
puts "\"guidance\" : \"[$ts get guidance]\","
|
||||
puts "\"genre\" : [$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 genrenib]]"
|
||||
puts "}"
|
||||
|
||||
|
||||
@@ -5,10 +5,6 @@ source /mod/webif/lib/setup
|
||||
|
||||
httpheader
|
||||
|
||||
if [file exists /mod/bin/ffmpeg] {
|
||||
set file [cgi_get file]
|
||||
puts [exec /mod/webif/lib/bin/ffmpeg -i $file]
|
||||
} else {
|
||||
puts "Install ffmpeg package for more information..."
|
||||
}
|
||||
set file [cgi_get file]
|
||||
puts [exec /mod/bin/ffprobe -hide_banner $file]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size progressbar
|
||||
require pretty_size progressbar plugin
|
||||
|
||||
httpheader
|
||||
|
||||
@@ -18,6 +18,12 @@ if {$type eq "ts"} {
|
||||
|
||||
set ts [ts fetch $file]
|
||||
|
||||
# Causes other series information to be automatically populated
|
||||
set epname [$ts episode_name]
|
||||
set series [$ts series_name]
|
||||
set tvdb [$ts get tvdb_series]
|
||||
set idata [$ts get tvdb_data]
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
@@ -25,20 +31,82 @@ if {$type eq "ts"} {
|
||||
<td class=va>
|
||||
"
|
||||
if {[file exists "[file rootname $file].thm"]} {
|
||||
puts "<img class=\"bmp va\" width=70 height=39 src=\"bmp.jim?file=$file\">"
|
||||
puts "<img class=\"bmp va\"
|
||||
src=\"/browse/bmp.jim?file=[cgi_quote_url $file]\">"
|
||||
}
|
||||
|
||||
if {[dict exists $idata thumb]} {
|
||||
puts "
|
||||
<img class=\"rollimg va\"
|
||||
src=\"[tvdb bannerurl $idata(thumb)]\">
|
||||
<div id=rollimg class=hidden></div>
|
||||
"
|
||||
}
|
||||
puts "[$ts get title]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td>[$ts get synopsis]</td>
|
||||
</tr><tr>
|
||||
<th>Episode</th>
|
||||
"
|
||||
puts "<td>[$ts epstr] - $epname (<i>$series</i>)"
|
||||
if {[llength $tvdb]} {
|
||||
puts "<button class=tvdbchoose>Change</button>"
|
||||
}
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
"
|
||||
if {[llength $tvdb] && [llength $idata]} {
|
||||
puts "</tr><tr><th>TheTVDB</th><td class=va>"
|
||||
set sid [$tvdb get seriesid]
|
||||
puts "<a target=_blank href=[\
|
||||
tvdb seriesurl $sid]>View on
|
||||
<img class=va height=20 src=/img/tvdb-sm.png></a>"
|
||||
if {[[settings] tvdb_debug]} {
|
||||
puts " | "
|
||||
puts "<a href=/db/index.jim?db=$sid.db target=_blank>
|
||||
<span class=footnote>View database($sid)</span></a>"
|
||||
}
|
||||
puts "
|
||||
<br>
|
||||
<img class=collapser id=xtvdb x=tvdb_extra
|
||||
class=va src=/img/tree/plusonly.png>
|
||||
Found episode using [$ts get tvdb_method]
|
||||
<div id=tvdb_extra class=hidden>
|
||||
<div class=blood>
|
||||
$idata(overview)
|
||||
</div>
|
||||
"
|
||||
if {[[settings] tvdb_debug]} {
|
||||
puts "
|
||||
<div class=bluefootnote>
|
||||
[$tvdb get _phrases]
|
||||
</div>
|
||||
<div class=footnote>
|
||||
[lrange [$tvdb get _smatches] 0 8]
|
||||
</div>
|
||||
"
|
||||
}
|
||||
puts "
|
||||
</div>
|
||||
</td></tr>"
|
||||
}
|
||||
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
puts "
|
||||
<th>Guidance</th>
|
||||
<td><img class=va
|
||||
src=/images/174_1_26_GuidancePolicy.png height=21>
|
||||
src=/img/Guidance_purple.png height=21>
|
||||
[$ts get guidance]
|
||||
</td>
|
||||
</tr><tr>
|
||||
"
|
||||
}
|
||||
if {[$ts flag "GGuidance"] > 0} {
|
||||
puts "
|
||||
<th>General Guidance</th>
|
||||
<td><img class=va
|
||||
src=/img/Guidance_blue.png height=21>
|
||||
[$ts get guidance]
|
||||
</td>
|
||||
</tr><tr>
|
||||
@@ -49,16 +117,27 @@ if {$type eq "ts"} {
|
||||
<th>Definition</th>
|
||||
<td>
|
||||
"
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
||||
if {[$ts flag Radio]} {
|
||||
puts "<img class=va src=/img/radio.png height=21>"
|
||||
} else {
|
||||
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
puts "<img class=va src=/images/172_1_00_HD.png height=21>"
|
||||
} else {
|
||||
puts "<img class=va src=/images/172_1_26_SD.png height=21>"
|
||||
}
|
||||
}
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Channel</th>
|
||||
<td>[epg channelicon [$ts get channel_name] 50 "vertical-align: middle"]
|
||||
[$ts get channel_num] - [$ts get channel_name]</td>
|
||||
</tr>
|
||||
"
|
||||
lassign [$ts genre_info] txt img
|
||||
puts "
|
||||
<tr>
|
||||
<th>Genre</th>
|
||||
<td><img src=\"$img\">$txt ([$ts genrenib])</td>
|
||||
</tr><tr>
|
||||
<th>Start Time</th>
|
||||
<td>"
|
||||
@@ -79,6 +158,9 @@ if {$type eq "ts"} {
|
||||
<td>[$ts duration] minute(s).
|
||||
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
|
||||
</font></td>
|
||||
</tr><tr>
|
||||
<th>Status</th>
|
||||
<td>[$ts get status]</td>
|
||||
</tr><tr>
|
||||
<th>Resumes</th>
|
||||
<td>[expr [$ts get resume] / 60] minutes into recording.
|
||||
@@ -100,7 +182,8 @@ puts "
|
||||
"
|
||||
|
||||
set fileset [$ts fileset]
|
||||
puts -nonewline "<img id=xfileset class=va src=/img/tree/plusonly.png>"
|
||||
puts -nonewline "<img class=collapser x=fileset id=xfileset class=va
|
||||
src=/img/tree/plusonly.png>"
|
||||
puts -nonewline "[llength $fileset] file"
|
||||
if {[llength $fileset] != 1} { puts -nonewline "s" }
|
||||
puts -nonewline " in set."
|
||||
@@ -110,32 +193,69 @@ foreach f $fileset {
|
||||
}
|
||||
puts "</ul></div>"
|
||||
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
puts "</td></tr>"
|
||||
|
||||
eval_plugins browsetsfile
|
||||
|
||||
puts "<tr>
|
||||
<th>Flags</th>
|
||||
<td>[$ts get flags]
|
||||
<td>[$ts get flags]</td>
|
||||
</tr>
|
||||
"
|
||||
|
||||
if {[$ts get bookmarks]} {
|
||||
puts " \[Bookmarks: [$ts get bookmarks] @ [join \
|
||||
[lmap i [$ts bookmarks 1] {
|
||||
clock format $i -format "%T"
|
||||
}] ", "]"
|
||||
puts "
|
||||
<tr>
|
||||
<th>Bookmarks</th>
|
||||
<td>[$ts get bookmarks] @ [join [lmap i [$ts bookmarks 1] {
|
||||
clock format $i -format "%T"
|
||||
}] ", "]
|
||||
</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
puts "</tr>"
|
||||
puts "</table>"
|
||||
puts {
|
||||
puts "
|
||||
</table>
|
||||
"
|
||||
puts "<div class=hidden id=file>$file</div>"
|
||||
puts {
|
||||
<script type=text/javascript>
|
||||
$('#xfileset').click(function() {
|
||||
$('#fileset').slideToggle('slow', function() {
|
||||
if ($('#fileset').is(':visible'))
|
||||
$('#xfileset').attr('src', '/img/tree/minustop.png');
|
||||
var file = $('#file').text();
|
||||
$('button').button();
|
||||
$('.tvdbchoose').on('click', function() {
|
||||
window.location.href = '/browse/tvdb/episode.jim?file=' +
|
||||
encodeURIComponent(file);
|
||||
});
|
||||
$('.collapser').on('click', function() {
|
||||
target = $(this).attr('x');
|
||||
var $icon = $(this);
|
||||
$('#' + target).slideToggle('slow', function() {
|
||||
if ($(this).is(':visible'))
|
||||
$icon.attr('src', '/img/tree/minustop.png');
|
||||
else
|
||||
$('#xfileset').attr('src', '/img/tree/plusonly.png');
|
||||
$icon.attr('src', '/img/tree/plusonly.png');
|
||||
|
||||
});
|
||||
});
|
||||
$('img.rollimg').hover(
|
||||
function() {
|
||||
var img = this, $img = $(img), offset = $img.offset;
|
||||
|
||||
$('#rollimg').css({
|
||||
top: offset.top,
|
||||
left: offset.left
|
||||
})
|
||||
.append($img.clone().removeClass('rollimg'))
|
||||
.removeClass('hidden');
|
||||
},
|
||||
function() {
|
||||
$('#rollimg').empty().addClass('hidden');
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
}
|
||||
}
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -152,7 +272,7 @@ puts "
|
||||
</tr><tr>
|
||||
<th>Info</th>
|
||||
<td class=pre id=ffmpeg>
|
||||
<img src=/img/loading.gif><i>Loading...</i>
|
||||
<img src=/img/spin.gif><i>Loading...</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -9,6 +9,6 @@ httpheader
|
||||
set file [cgi_get file]
|
||||
|
||||
if {[file isdirectory $file]} {
|
||||
lassign [{dir iconset} $file] icons #attrs
|
||||
lassign [dir iconset $file] icons #attrs
|
||||
puts [join $icons ""]
|
||||
}
|
||||
|
||||
@@ -2,22 +2,26 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class settings.class escape browse.class \
|
||||
plugin epg.class
|
||||
require ts.class pretty_size system.class settings.class browse.class \
|
||||
plugin epg.class classdump queue.class
|
||||
|
||||
jqplugin contextMenu bar enadis
|
||||
set mroot [system mediaroot]
|
||||
set dir [cgi_get dir $mroot]
|
||||
|
||||
jqplugin contextMenu bar enadis blockui dialogue
|
||||
jscss script.js style.css
|
||||
|
||||
set plugins { dmenu {} menu {} }
|
||||
if {[system has tvdb]} { jscss tvdb/script.js tvdb/style.css }
|
||||
|
||||
set plugins { dmenu {} menu {} omenu {} buttons {} }
|
||||
eval_plugins browse
|
||||
|
||||
header
|
||||
|
||||
set nicesplice [system pkginst nicesplice]
|
||||
set flatten [system pkginst flatten]
|
||||
|
||||
set ignore {.nts .thm .hmi}
|
||||
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt}
|
||||
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt .m4v .m4a}
|
||||
|
||||
if {![dict exists $env SCRIPT_NAME]} {
|
||||
set env(SCRIPT_NAME) ""
|
||||
@@ -27,6 +31,8 @@ if {![dict exists $env SCRIPT_NAME]} {
|
||||
|
||||
if {![dict exists $env QUERY_STRING]} { set env(QUERY_STRING) "root" }
|
||||
|
||||
set dir [string map [list "\{root\}" $mroot] $dir]
|
||||
|
||||
set config [settings new]
|
||||
|
||||
set order [cgi_get order -]
|
||||
@@ -37,10 +43,13 @@ if {$order eq "-"} {
|
||||
}
|
||||
|
||||
set nofcount [$config nounwatchedcount]
|
||||
set nounderscore [$config nounderscore]
|
||||
|
||||
set model [system model]
|
||||
set dustbin [system dustbin 1]
|
||||
|
||||
set dlnaok [system dlnastatus]
|
||||
|
||||
proc icon {img {hover ""} {extra ""} {class "va"}} {
|
||||
puts -nonewline "<img src=\"$img\" class=\"$class\" height=21 $extra"
|
||||
if {$hover ne ""} {
|
||||
@@ -55,14 +64,15 @@ proc directory {file bfile tbfile} {
|
||||
if {$bfile eq $::dustbin} { set img "/img/Dustbin_Folder.png" }
|
||||
puts "<img border=0 class=va id=\"img$tbfile\" src=$img>"
|
||||
if {!$::nofcount} { puts "<span class=foldernum></span>" }
|
||||
if {!$::nounderscore} { puts "<span class=folderu>_</span>" }
|
||||
puts "<input class=\"fs fsdir\" type=checkbox>"
|
||||
puts "<a class=dbf
|
||||
href=\"$::env(SCRIPT_NAME)?dir=[cgi_quote_url $file]\"
|
||||
file=\"[cgi_quote_url $file]\">"
|
||||
file=\"[cgi_quote_html $file]\">"
|
||||
puts "$bfile</a><span class=filesize id=\"$tbfile\">
|
||||
</span>"
|
||||
|
||||
lassign [{dir iconset} $file] icons attrs
|
||||
lassign [dir iconset $file] icons attrs
|
||||
|
||||
puts "<span class=iconset>"
|
||||
puts [join $icons ""]
|
||||
@@ -94,13 +104,13 @@ set filecount 0
|
||||
|
||||
proc entry {file} {{i 0}} {
|
||||
global dircount filecount dinuse
|
||||
|
||||
|
||||
set bfile [file tail $file]
|
||||
regsub -all " +" $bfile "" tbfile
|
||||
if {[string index $bfile 0] == "\025"} {
|
||||
set bfile [string range $bfile 1 end]
|
||||
}
|
||||
if [file isdirectory "$file"] {
|
||||
if {[file isdirectory "$file"]} {
|
||||
incr dircount
|
||||
directory $file $bfile $tbfile
|
||||
return
|
||||
@@ -114,14 +124,21 @@ proc entry {file} {{i 0}} {
|
||||
set base [file rootname $file]
|
||||
|
||||
set thmok 0
|
||||
if {$ext eq ".ts" && [file exists "${base}.nts"]} {
|
||||
if {$ext eq ".ts" && [file exists "${base}.hmt"]} {
|
||||
set type ts
|
||||
set ts [ts fetch $file 1]
|
||||
set img Video_TS
|
||||
set rstat [$ts get status]
|
||||
if {$rstat eq "Valid/OK"} {
|
||||
set img Video_TS
|
||||
} elseif {$rstat eq "Loss of power/OK" && $bfile in $dinuse} {
|
||||
set img Video_Rec
|
||||
} else {
|
||||
set img Video_Failed
|
||||
}
|
||||
set omenu opt
|
||||
if {[file exists "${base}.thm"]} { set thmok 1 }
|
||||
} elseif {$ext eq ".hmt"} {
|
||||
if {[file exists "${base}.ts"]} { continue }
|
||||
if {[file exists "${base}.ts"]} { return }
|
||||
# Sole hmt file indicates failure to track.
|
||||
set type bad
|
||||
set ts 0
|
||||
@@ -156,7 +173,7 @@ proc entry {file} {{i 0}} {
|
||||
<img class=va border=0 src=/img/$img.png>
|
||||
<input class=\"$fscl\" type=checkbox>
|
||||
<a class=bf title=\"$synopsis\"
|
||||
file=\"[cgi_quote_url $file]\" type=$type href=#>
|
||||
file=\"[cgi_quote_html $file]\" type=$type href=#>
|
||||
$bfile
|
||||
</a>
|
||||
"
|
||||
@@ -166,77 +183,39 @@ proc entry {file} {{i 0}} {
|
||||
|
||||
# Icons
|
||||
|
||||
set locked 0
|
||||
set encd 0
|
||||
set odencd 1
|
||||
set def unknown
|
||||
set bx 0
|
||||
set dlna 0
|
||||
set shrunk 0
|
||||
set attrs {}
|
||||
if {$type eq "ts"} {
|
||||
if {$bfile in $dinuse} {
|
||||
icon "/img/inuse.png"
|
||||
}
|
||||
icon [epg channeliconpath [$ts get channel_name]] \
|
||||
[$ts get channel_name] "" "va browsechannel"
|
||||
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 "" "va genre"
|
||||
} else {
|
||||
icon "/images/173_3_00_G3_$img.png" $txt "" "va genre"
|
||||
}
|
||||
|
||||
# HD / SD
|
||||
if {[$ts get definition] eq "HD"} {
|
||||
set def HD
|
||||
set img "172_1_00_HD"
|
||||
} else {
|
||||
set def SD
|
||||
set img "172_1_26_SD"
|
||||
}
|
||||
icon "/images/$img.png"
|
||||
lassign [$ts genre_info] txt img
|
||||
icon "$img" $txt "" "va genre"
|
||||
|
||||
# Locked
|
||||
if {[$ts flag "Locked"] > 0} {
|
||||
set locked 1
|
||||
icon "/images/178_1_00_Icon_Lock.png" "Locked"
|
||||
}
|
||||
lassign [ts iconset $ts] icons attrs
|
||||
|
||||
# Encrypted
|
||||
if {[$ts flag "Encrypted"] > 0} {
|
||||
set encd 1
|
||||
icon "/images/749_1_26_Video_Encryption.png" ""
|
||||
}
|
||||
if {![$ts flag "ODEncrypted"]} {
|
||||
set odencd 0
|
||||
icon "/img/Decrypted.png" "Decrypted"
|
||||
}
|
||||
puts [join $icons ""]
|
||||
} elseif {$ext eq ".mp3"} {
|
||||
# Will be completed using an ajax call.
|
||||
icon "/img/blank.gif" "" "" "va mp3icon"
|
||||
}
|
||||
|
||||
# Guidance
|
||||
if {[$ts flag "Guidance"] > 0} {
|
||||
icon "/images/174_1_26_GuidancePolicy.png"
|
||||
}
|
||||
# Indexed
|
||||
set dlna 0
|
||||
if {$::dlnaok && $::model eq "HDR" && [llength [
|
||||
system dlnaurl [file normalize $file]]]} {
|
||||
icon "/img/dlna.png" "Indexed by DLNA Server"
|
||||
set dlna 1
|
||||
}
|
||||
|
||||
# Indexed
|
||||
if {$::model eq "HDR" && [llength [$ts dlnaloc]]} {
|
||||
icon "/img/dlna.png" "Indexed by DLNA Server"
|
||||
set dlna 1
|
||||
# Queued
|
||||
if {$type eq "ts"} {
|
||||
set queued [queue status $ts]
|
||||
if {$queued ne ""} {
|
||||
icon "/img/queueps.png" "Queued for $queued"
|
||||
}
|
||||
|
||||
# Shrunk
|
||||
if {[$ts flag Shrunk]} {
|
||||
icon "/img/compress.png" "Shrunk"
|
||||
set shrunk 1
|
||||
}
|
||||
|
||||
set bx [$ts get bookmarks]
|
||||
}
|
||||
|
||||
# Opt+ button
|
||||
@@ -244,9 +223,8 @@ proc entry {file} {{i 0}} {
|
||||
puts "
|
||||
<a href=#>
|
||||
<img class=\"$omenu va\" border=0 width=45 type=$type did=$i
|
||||
locked=$locked encd=$encd def=$def new=$new bx=$bx
|
||||
shrunk=$shrunk rsize=$rsz
|
||||
odencd=$odencd dlna=$dlna thmok=$thmok
|
||||
[join $attrs " "]
|
||||
new=$new rsize=$rsz dlna=$dlna thmok=$thmok
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
@@ -254,31 +232,54 @@ proc entry {file} {{i 0}} {
|
||||
puts "</div>"
|
||||
}
|
||||
|
||||
set mroot [system mediaroot]
|
||||
set dir [cgi_get dir $mroot]
|
||||
|
||||
######################################################################
|
||||
# Render web page
|
||||
|
||||
source assets.jim
|
||||
if {[system has tvdb]} { source tvdb/assets.jim }
|
||||
|
||||
if {[system model] eq "HDR" && ![system param DMS_START_ON]} {
|
||||
puts {
|
||||
<span class="blood dlnawarning cleft">
|
||||
Note: Content Sharing is disabled on this system.
|
||||
</span>
|
||||
}
|
||||
}
|
||||
# elseif {!$dlnaok && ![system instandby]} {
|
||||
# puts {
|
||||
# <span class="blood dlnawarning cleft">
|
||||
# Note: Content Sharing not yet active on this system.
|
||||
# </span>
|
||||
# }
|
||||
#}
|
||||
|
||||
puts "
|
||||
<span style=\"display:none\" id=dir>$dir</span>
|
||||
<span style=\"display:none\" id=mediaroot>$mroot</span>
|
||||
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
<script type=text/javascript>
|
||||
var dir = '[string map {' {\'}} $dir]';
|
||||
var mediaroot = '$mroot';
|
||||
</script>
|
||||
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
"
|
||||
|
||||
browse breadcrumb $dir
|
||||
lassign [dir iconset $dir] icons attrs
|
||||
puts "
|
||||
<span class=filesize id=dirsize></span>
|
||||
<span id=diriconset>[join $icons ""]</span>
|
||||
<a href=#>
|
||||
<img class=\"dopt self va\" border=0 width=45 [join $attrs " "]
|
||||
src=/images/181_1_00_Help5_OPT_Plus.png>
|
||||
</a>
|
||||
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
|
||||
"
|
||||
|
||||
# Breadcrumb path
|
||||
set stub ""
|
||||
foreach part [split $dir /] {
|
||||
if {$stub eq "/"} { set name $part } else { set name "/$part" }
|
||||
append stub $name
|
||||
puts "<a href=\"$env(SCRIPT_NAME)?dir=[cgi_quote_url $stub]\">$name</a>
|
||||
}
|
||||
puts "<span class=filesize id=dirsize></span>"
|
||||
puts "</legend>"
|
||||
|
||||
if {[system has tvdb] && [string length $dir] > [string length $mroot]} {
|
||||
source tvdb/banner.jim
|
||||
}
|
||||
|
||||
# Parent directory
|
||||
set parent [join [lrange [split $dir /] 0 end-1] /]
|
||||
if {$parent ne ""} {
|
||||
@@ -291,7 +292,7 @@ if {$parent ne ""} {
|
||||
"
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
proc s_file_stat {a b attr} {
|
||||
global dir
|
||||
|
||||
set a "$dir/$a"
|
||||
@@ -309,18 +310,29 @@ proc s_time {a b} {
|
||||
}
|
||||
|
||||
if {[catch {file stat $a l}]} { return 0}
|
||||
set at $l(mtime)
|
||||
set at $l($attr)
|
||||
if {[catch {file stat $b l}]} { return 0}
|
||||
set bt $l(mtime)
|
||||
set bt $l($attr)
|
||||
|
||||
if {$at < $bt} { return -1 }
|
||||
if {$at > $bt} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
tailcall s_file_stat $a $b mtime
|
||||
}
|
||||
|
||||
proc s_size {a b} {
|
||||
tailcall s_file_stat $a $b size
|
||||
}
|
||||
|
||||
set files [readdir -nocomplain $dir]
|
||||
switch $order {
|
||||
1 { set files [lsort -command s_time $files] }
|
||||
2 { set files [lreverse [lsort -command s_time $files]] }
|
||||
3 { set files [lsort -command s_size $files] }
|
||||
4 { set files [lreverse [lsort -command s_size $files]] }
|
||||
default { set files [lsort -nocase $files] }
|
||||
}
|
||||
|
||||
@@ -335,22 +347,30 @@ Directories: $dircount, Files: $filecount
|
||||
|
||||
# Sort icons
|
||||
puts "<div id=sortdiv>"
|
||||
set sortlist {{0 sort_name name} {1 sort_date date}}
|
||||
set sortlist {
|
||||
{0 sort_name name {Alphabetical order A->Z}}
|
||||
{1 sort_date date {Oldest first}}
|
||||
{2 sort_date reverse-date {Newest first}}
|
||||
{3 sort_size size {Smallest first}}
|
||||
{4 sort_size reverse-size {Largest first}}}
|
||||
puts "
|
||||
Sort by: "
|
||||
foreach sl $sortlist {
|
||||
lassign $sl index img descr
|
||||
lassign $sl index img descr tt
|
||||
|
||||
if {$index} { puts " | " }
|
||||
|
||||
set tag "Currently sorting"
|
||||
set tag " (current)"
|
||||
if {$order != $index} {
|
||||
puts "
|
||||
<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"
|
||||
if {$order != $index} {
|
||||
puts "</a>"
|
||||
set qs [regsub -all {&order=[[[:digit:]]+} $env(QUERY_STRING) ""]
|
||||
puts "<a href=\"$env(SCRIPT_NAME)?$qs&order=$index\" title=\"$tt\">"
|
||||
set tag ""
|
||||
set ket "a"
|
||||
} else {
|
||||
puts "<span title=\"$tt\">"
|
||||
set ket "span"
|
||||
}
|
||||
puts "<img class=va border=0 src=/img/$img.gif> $descr$tag</$ket>"
|
||||
}
|
||||
puts "</div>"
|
||||
|
||||
@@ -362,34 +382,18 @@ puts {
|
||||
File Clipboard
|
||||
</legend>
|
||||
<div id=clipboard>
|
||||
<img src=/img/loading.gif> <i>Loading...</i>
|
||||
<img src=/img/spin.gif> <i>Loading...</i>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
puts "<div class=brow>"
|
||||
|
||||
# Always-active buttons.
|
||||
puts {
|
||||
<button id=copy>Copy</button>
|
||||
<button id=cut>Cut</button>
|
||||
<button id=delete>Delete</button>
|
||||
<div class=buttonrow>
|
||||
<button id=newdir>New Folder</button>
|
||||
<div id=deletewait class=blood style="display: none">
|
||||
<img src=/img/loading.gif>Deleting may take some time, please be patient...
|
||||
</div>
|
||||
}
|
||||
|
||||
# Join
|
||||
if $nicesplice {
|
||||
puts { <button id=join>Join</button> }
|
||||
}
|
||||
|
||||
puts "</div><div class=brow style=\"margin-top: 3px\">"
|
||||
|
||||
# De-duplicate
|
||||
|
||||
puts {
|
||||
<button id=dedup>De-duplicate/tidy this folder</button>
|
||||
<button id=dedup><img src=/img/dedup.png width=16>
|
||||
De-duplicate/tidy this folder</button>
|
||||
<button id=queue><img src=/img/queueps.png class=qb> View Queue</button>
|
||||
}
|
||||
|
||||
# Streamer file
|
||||
@@ -397,11 +401,62 @@ puts {
|
||||
if {[file exists /mnt/hd3/Streamer_down_file]} {
|
||||
puts {
|
||||
<button id=save_stream file=/mnt/hd3/Streamer_down_file>
|
||||
Save last streamed content (e.g. iPlayer/YouTube)
|
||||
<div id=streamstatus></div>
|
||||
Save last streamed content
|
||||
<span id=streamstatus></span>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
puts "</div>"
|
||||
|
||||
# Buttons dependent on selection
|
||||
puts {
|
||||
<div class=buttonrow>
|
||||
<button id=copy class=onesel>Copy</button>
|
||||
<button id=cut class=onesel>Cut</button>
|
||||
<button id=delete class=onesel>Delete</button>
|
||||
}
|
||||
# Join
|
||||
if {$nicesplice} {
|
||||
puts { <button id=join class=tstwosel>Join</button> }
|
||||
}
|
||||
# Queue
|
||||
set queueactions(decrypt) "Decryption"
|
||||
if {$model ne "HD"} {
|
||||
# For HDR, give slower option too.
|
||||
dict set queueactions "decrypt -direct" "Decryption (direct, slower)"
|
||||
}
|
||||
set queueactions(shrink) "Shrink"
|
||||
dict set queueactions "mp3 -mp2" "Audio-Extraction (mp2, fast)"
|
||||
dict set queueactions "mp3 -mp3" "Audio-Extraction (mp3, slow)"
|
||||
set queueactions(mpg) "Conversion to MPG"
|
||||
eval_plugins queueactions
|
||||
|
||||
puts {
|
||||
<button id=so_queue class=tsonesel><img src=/img/queueps.png class=qb>
|
||||
Queue for</button>
|
||||
<select id=so_queueactions
|
||||
class="tsonesel text ui-widget-content ui-corner-all">
|
||||
}
|
||||
set rqueueactions [lreverse $queueactions]
|
||||
foreach v [lsort [dict keys $rqueueactions]] {
|
||||
set k $rqueueactions($v)
|
||||
puts "<option value=\"$k\">$v</option>"
|
||||
}
|
||||
puts {
|
||||
</select>
|
||||
}
|
||||
|
||||
# Plugin buttons
|
||||
|
||||
if {[llength $plugins(buttons)]} {
|
||||
puts "</div><div class=buttonrow>"
|
||||
foreach plugin $plugins(buttons) {
|
||||
lassign $plugin tag options
|
||||
puts "
|
||||
<button class=plugin act=\"$options(link)\">$options(desc)</button>
|
||||
"
|
||||
}
|
||||
}
|
||||
|
||||
puts "</div>"
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ cgi_input 1
|
||||
set joinstart [clock milliseconds]
|
||||
|
||||
set cmd {/mod/bin/nicesplice}
|
||||
set dst [file rootname [cgi_get dest "joined"]]
|
||||
set dst [file rootname [cgi_unquote_input [cgi_get dest "joined"]]]
|
||||
|
||||
foreach file [split [cgi_get files] ","] {
|
||||
set file [cgi_unquote_input $file]
|
||||
@@ -21,7 +21,9 @@ foreach file [split [cgi_get files] ","] {
|
||||
lappend cmd "-out" "$dir/$dst"
|
||||
|
||||
puts "($cmd)"
|
||||
set token [system startop -multiple join "$dir/$dst"]
|
||||
puts [exec {*}$cmd]
|
||||
system endop $token
|
||||
|
||||
set ts [ts fetch "$dir/$dst.ts"]
|
||||
$ts settitle $dst
|
||||
|
||||
@@ -45,13 +45,12 @@ Name for joined file:
|
||||
length=20 maxlength=50>
|
||||
<button id=dojoin>Join</button>
|
||||
</div>
|
||||
<button id=back
|
||||
dir=\"[cgi_quote_html $dir]\"
|
||||
esize=\"$esize\">Back to media list</button>
|
||||
|
||||
<div id=progressdiv style=\"display: none\">
|
||||
Joining: <div id=progressbar></div>
|
||||
<button id=back
|
||||
dir=\"[cgi_quote_url $dir]\"
|
||||
esize=\"$esize\"
|
||||
style=\"display: none\">Back to media list</button>
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</div>
|
||||
"
|
||||
|
||||
@@ -8,10 +8,10 @@ var handle = 0;
|
||||
|
||||
function update()
|
||||
{
|
||||
$.get('progress.jim'
|
||||
+ '?esize=' + $('#back').attr('esize')
|
||||
+ '&file=' + $('#back').attr('dir') + '/' + $('#dest').val(),
|
||||
function(data) {
|
||||
$.get('progress.jim', {
|
||||
esize: $('#back').attr('esize'),
|
||||
file: $('#back').attr('dir') + '/' + $('#dest').val()
|
||||
}, function(data) {
|
||||
if (handle)
|
||||
$('#progressbar').reportprogress(data);
|
||||
});
|
||||
@@ -22,7 +22,8 @@ $(document).ready(function() {
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $(this).attr('dir');
|
||||
window.location = '/go/browse?dir=' +
|
||||
encodeURIComponent($(this).attr('dir'));
|
||||
});
|
||||
|
||||
$('#filelist').sortable().disableSelection();
|
||||
@@ -36,11 +37,12 @@ $('#dojoin').button().attr('disabled', true).addClass('ui-state-disabled')
|
||||
|
||||
$('#joindiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
$('#back').hide();
|
||||
handle = setInterval("update()", 1000);
|
||||
|
||||
$('#output').text('Please do not interrupt...')
|
||||
.load('execute.jim?files=' +
|
||||
sfiles.join() + '&dest=' + $('#dest').val(),
|
||||
sfiles.join() + '&dest=' + encodeURIComponent($('#dest').val()),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
|
||||
@@ -6,7 +6,10 @@ source /mod/webif/lib/setup
|
||||
httpheader
|
||||
|
||||
set expected [cgi_get esize 1]
|
||||
set file [file normalize [cgi_get file]]
|
||||
if {[catch {set file [file normalize [cgi_get file]]}]} {
|
||||
puts "12"
|
||||
exit
|
||||
}
|
||||
|
||||
if {![file exists $file]} {
|
||||
puts "0"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require plugin
|
||||
|
||||
httpheader
|
||||
|
||||
@@ -10,3 +11,7 @@ set name [cgi_get newdirname "New Folder"]
|
||||
|
||||
file mkdir "$dir/$name"
|
||||
|
||||
set dir "$dir/$name"
|
||||
|
||||
eval_plugins mkdir
|
||||
|
||||
|
||||
29
webif/html/browse/mp3.jim
Executable file
29
webif/html/browse/mp3.jim
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require json
|
||||
|
||||
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 -hide_banner -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 "}"
|
||||
|
||||
@@ -14,14 +14,9 @@ set len [$ts duration 1]
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
|
||||
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
|
||||
-i $rfile \
|
||||
-map 0:0 -map 0:1 \
|
||||
-vcodec copy -acodec copy "${base}.mpg"]
|
||||
set token [system startop -multiple mpg $rfile]
|
||||
$ts mkmpg
|
||||
system endop $token
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
@@ -32,13 +32,12 @@ puts "
|
||||
<div id=mpgdiv style=\"padding: 1em\">
|
||||
<button id=mpgit>Perform mpg extraction</button>
|
||||
</div>
|
||||
<button id=back>Back to media list</button>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Extracting mpg: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -15,12 +15,13 @@ $(document).ready(function() {
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
window.location = '/go/browse?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#mpgit').button().click(function() {
|
||||
$('#mpgdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
$('#back').hide();
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').load('execute.jim?file=' + $('#params').attr('rfile'),
|
||||
function() {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package require cgi
|
||||
package require pack
|
||||
source /mod/webif/lib/setup
|
||||
require json
|
||||
|
||||
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,"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
webif/html/browse/queue.jim
Executable file
38
webif/html/browse/queue.jim
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class queue.class
|
||||
|
||||
httpheader
|
||||
|
||||
set dir [cgi_get dir]
|
||||
set act [cgi_get act -]
|
||||
if {$act eq "-"} {
|
||||
puts "No action."
|
||||
exit;
|
||||
}
|
||||
|
||||
puts "<div id=deleting class=blood><img src=/img/spin.gif>Queuing...</div>"
|
||||
puts "<ul style=\"list-style-type: square\">"
|
||||
|
||||
foreach file [cgi_get files] {
|
||||
puts -nonewline "<li>\"$file\"..."
|
||||
|
||||
if {[string first "$dir/" $file] != 0} {
|
||||
puts "Error - outside directory."
|
||||
continue
|
||||
}
|
||||
|
||||
set ts [ts fetch $file]
|
||||
if {$ts eq "0"} continue
|
||||
|
||||
lassign $act xact args
|
||||
|
||||
set q [queue insert -hold $ts $xact]
|
||||
if {$args ne ""} { $q set args $args }
|
||||
$q submit
|
||||
puts "</li>"
|
||||
}
|
||||
puts "</ul>"
|
||||
|
||||
@@ -23,7 +23,8 @@ if {[file isdirectory $file]} {
|
||||
|
||||
foreach attr {title synopsis guidance genre} {
|
||||
if {[catch {
|
||||
set new [string trim [cgi_get "rename_$attr"]]
|
||||
set new [string map {"\n" ""} [
|
||||
string trim [cgi_get "rename_$attr"]]]
|
||||
set old [$ts get $attr]
|
||||
if {$new ne $old} {
|
||||
if {$attr eq "guidance" ||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
require ts.class json
|
||||
|
||||
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 "}"
|
||||
|
||||
@@ -2,19 +2,29 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require json
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set dir [cgi_get dir]
|
||||
set dir [cgi_get dir "/media/My Video"]
|
||||
set dlen [string length "$dir/"]
|
||||
|
||||
proc du {args} {
|
||||
if {[catch {exec du {*}$args}} dutxt]} {
|
||||
set dutxt ""
|
||||
}
|
||||
return $dutxt
|
||||
}
|
||||
|
||||
#9.4G /media/My Video/Archive
|
||||
#1.4G /media/My Video/CSI_ Crime Scene Investigation
|
||||
puts "{"
|
||||
foreach line [split [exec /mod/bin/busybox/du -h -d 1 "$dir/"] "\n"] {
|
||||
foreach line [split [du -h -l -d 1 "$dir/"] "\n"] {
|
||||
lassign [split $line "\t"] size node
|
||||
set node [string range $node $dlen end]
|
||||
puts "\"$node\" : \"$size\","
|
||||
if {[string length $node]} {
|
||||
puts "\"[jescape $node]\": \"$size\","
|
||||
}
|
||||
}
|
||||
|
||||
# Handle symbolic links.
|
||||
@@ -25,16 +35,21 @@ foreach file [readdir $dir] {
|
||||
if {![string match "/*" $lk]} { set lk "$dir/$lk" }
|
||||
|
||||
if {![file isdirectory $lk]} continue
|
||||
foreach line [split [exec /mod/bin/busybox/du -h "$lk"] "\n"] {
|
||||
foreach line [split [du -h "$lk"] "\n"] {
|
||||
set fields [split $line "\t"]
|
||||
if {[lindex $fields 1] eq $lk} {
|
||||
set node [file tail $file]
|
||||
set size [lindex $fields 0]
|
||||
puts "\"$node\" : \"@$size\","
|
||||
puts "\"[jescape $node]\" : \"@$size\","
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puts "\"dummy\" : \"\""
|
||||
puts "}"
|
||||
set dutxt [du -hs "$dir/"]
|
||||
if {$dutxt eq ""} {
|
||||
set dutxt "N/A"
|
||||
}
|
||||
lassign [split $dutxt] total
|
||||
puts "\"\": \"$total\""
|
||||
|
||||
puts "}"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
require system.class ts.class pretty_size
|
||||
|
||||
httpheader
|
||||
|
||||
@@ -35,11 +35,12 @@ foreach ext $tsgroup {
|
||||
file rename "$base.$ext" "${origdir}/$tail.$ext"
|
||||
}
|
||||
|
||||
set token [system startop -multiple shrink $rfile]
|
||||
puts [exec /mod/bin/stripts \
|
||||
"$origdir/$shname" \
|
||||
"$dir/$shname" \
|
||||
]
|
||||
|
||||
system endop $token
|
||||
|
||||
# Set the file time to match the old file
|
||||
ts touchgroup "$dir/$shname.ts" "$origdir/$shname.ts"
|
||||
|
||||
@@ -34,7 +34,7 @@ Your original recording files will be retained in a folder called _original.
|
||||
<td>Shrinking will take around [clock format $esttime -format "%T"]</td></tr>
|
||||
<tr><th>Estimated Saving:</th>
|
||||
<td class=va><span id=analysis class=va>
|
||||
<img class=va src=/img/loading.gif> Analysing file, please wait...
|
||||
<img class=va src=/img/spin.gif> Analysing file, please wait...
|
||||
</span></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -46,13 +46,12 @@ Your original recording files will be retained in a folder called _original.
|
||||
<div id=stripdiv class=hidden style=\"padding: 1em\">
|
||||
<button id=stripit>Shrink recording</button>
|
||||
</div>
|
||||
<button id=back>Back to media list</button>
|
||||
|
||||
<div id=progressdiv class=hidden>
|
||||
Shrinking: <div id=progressbar></div>
|
||||
</div>
|
||||
|
||||
<button id=back class=hidden>Back to media list</button>
|
||||
|
||||
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
||||
</fieldset>
|
||||
"
|
||||
|
||||
@@ -27,12 +27,13 @@ $('#analysis').load('analyse.jim?file=' + $('#params').attr('file'),
|
||||
$('#progressbar').reportprogress(0);
|
||||
|
||||
$('#back').button().click(function() {
|
||||
window.location = '../index.jim?dir=' + $('#params').attr('dir');
|
||||
window.location = '/go/browse?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#stripit').button().click(function() {
|
||||
$('#stripdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
$('#back').hide();
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').text('Please do not interrupt...')
|
||||
.load('execute.jim?file=' + $('#params').attr('file'),
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
|
||||
div.brow
|
||||
div.buttonrow
|
||||
{
|
||||
float: left;
|
||||
clear: left;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
div.clipbuttons
|
||||
{
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
div.cliplist span
|
||||
@@ -10,8 +16,17 @@ div.cliplist span
|
||||
display: block;
|
||||
}
|
||||
|
||||
#clipclear
|
||||
img.qb
|
||||
{
|
||||
margin-top: 1em;
|
||||
height: 14px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
#diriconset
|
||||
{
|
||||
font-style: italic;
|
||||
font-size: 0.7em;
|
||||
color: #ff4000;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ $('button').button();
|
||||
|
||||
function go(pos)
|
||||
{
|
||||
window.location.href = 'index.jim?file=' +
|
||||
window.location.href = '/browse/thumbnail/?file=' +
|
||||
encodeURIComponent(file) + '&pos=' + pos;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ $('#repos').disable().on('click', function(e) {
|
||||
|
||||
$('#back').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
window.location.href = '/browse/index.jim?dir=' +
|
||||
window.location.href = '/go/browse?dir=' +
|
||||
encodeURIComponent(dir);
|
||||
});
|
||||
|
||||
@@ -34,22 +34,27 @@ $('button.usethm').disable().on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var pos = $(this).attr('pos');
|
||||
$('button,input').disable();
|
||||
$.get('set.jim?file=' + encodeURIComponent(file) + '&pos=' + pos,
|
||||
function() {
|
||||
window.location.href = '/browse/index.jim?dir=' +
|
||||
$.get('/browse/thumbnail/set.jim',
|
||||
{
|
||||
'file': file,
|
||||
'pos': pos
|
||||
}, function() {
|
||||
window.location.href = '/go/browse?dir=' +
|
||||
encodeURIComponent(dir);
|
||||
});;
|
||||
});
|
||||
|
||||
var start = $('#start').text();
|
||||
var end = $('#end').text();
|
||||
$.get('mkrange.jim?file=' + encodeURIComponent(file) +
|
||||
'&s=' + start + '&e=' + end, function() {
|
||||
$.get('/browse/thumbnail/mkrange.jim',
|
||||
{
|
||||
'file': file,
|
||||
's': $('#start').text(),
|
||||
'e': $('#end').text()
|
||||
}, function() {
|
||||
$('img.bmp').each(function(i) {
|
||||
var pos = $(this).attr('pos');
|
||||
$(this).attr('src',
|
||||
'fetch.jim?file=' + encodeURIComponent(file) +
|
||||
'&pos=' + pos);
|
||||
'/browse/thumbnail/fetch.jim?file=' +
|
||||
encodeURIComponent(file) + '&pos=' + pos);
|
||||
});
|
||||
$('button').enable();
|
||||
});
|
||||
|
||||
52
webif/html/browse/tvdb/assets.jim
Executable file
52
webif/html/browse/tvdb/assets.jim
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
|
||||
<div id=tvdbdialogue title="Select Series" class=hidden>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="tvdbsearch">
|
||||
<b>Search For</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="tvdbsearch" id="tvdbsearch"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id=tvdbresults title="Choose Series" class=hidden>
|
||||
<div class=tvdbresults id=tvdbresults_loading>
|
||||
<img src=/img/spin.gif>
|
||||
Searching TheTVDB.com database, please wait...
|
||||
</div>
|
||||
<div class=tvdbresults id=tvdbresults_saving>
|
||||
<img src=/img/spin.gif>
|
||||
Retrieving episode details from TheTVDB.com, please wait...
|
||||
</div>
|
||||
<div class=tvdbresults id=tvdbresults_force>
|
||||
You can optionally force a particular series number for this folder.<br>
|
||||
This is useful when the broadcasters do not set good synopses or<br>
|
||||
if episode names are re-used across series. Leave it set to zero<br>
|
||||
if you do not wish to do this.<br>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Force series number:<br>
|
||||
<span class=footnote>(Optional)</span>
|
||||
</th>
|
||||
<td>
|
||||
<input id=tvdb_forceseries type=number value="" min=0>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class=tvdbresults id=tvdbresults_inner></div>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
37
webif/html/browse/tvdb/banner.jim
Normal file
37
webif/html/browse/tvdb/banner.jim
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
require classdump
|
||||
|
||||
set seriescount 0
|
||||
foreach seriesid [ts serieslist $dir] {
|
||||
incr seriescount
|
||||
set tvdb_series [set v [tvdb series [file tail $dir] $seriesid]]
|
||||
puts "<div class=tvdbbanner sid=$seriesid>"
|
||||
if {[set banner [$v get banner]] ne ""} {
|
||||
puts "
|
||||
<img class=tvdbbannertop src=\"[tvdb bannerurl $banner]\">
|
||||
"
|
||||
}
|
||||
puts "
|
||||
<span id=tvdbseriesname title=\"Series ID: $seriesid\">
|
||||
<a target=_blank href=\"/db/?db=$seriesid.db\">
|
||||
[cgi_quote_html [$v get name]]
|
||||
</a>
|
||||
</span>
|
||||
"
|
||||
if {[file exists "$dir/.tvdbseries"]} {
|
||||
set n [string trim [file read "$dir/.tvdbseries"]]
|
||||
puts "(S$n)"
|
||||
}
|
||||
puts "<button id=tvdbsetseries>Change</button>"
|
||||
puts "</div>"
|
||||
}
|
||||
if {!$seriescount} {
|
||||
puts {
|
||||
<span id=tvdbinfo class="va right">
|
||||
<img class=tvdblogo src=/img/tvdb.png>
|
||||
<button id=tvdbsetseries>Select Series</button>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
123
webif/html/browse/tvdb/episode.jim
Executable file
123
webif/html/browse/tvdb/episode.jim
Executable file
@@ -0,0 +1,123 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require settings.class ts.class tvdb.class browse.class
|
||||
jqplugin highlight tablesorter2
|
||||
|
||||
header
|
||||
|
||||
set file [cgi_get file -]
|
||||
if {$file eq "-"} exit
|
||||
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
var file = '$file';
|
||||
var dir = '[file dirname $file]';
|
||||
</script>
|
||||
"
|
||||
jscss episode.js
|
||||
|
||||
set search [cgi_get search ""]
|
||||
|
||||
if {[catch {set ts [ts fetch $file]}] || $ts eq "0"} {
|
||||
puts "Unable to load recording data."
|
||||
exit
|
||||
}
|
||||
|
||||
# Causes other series information to be automatically populated
|
||||
$ts clearepdata
|
||||
set epname [$ts episode_name]
|
||||
set series [$ts series_name]
|
||||
set tvdb [$ts get tvdb_series]
|
||||
set idata [$ts get tvdb_data]
|
||||
|
||||
browse breadcrumb [file dirname $file]
|
||||
puts "
|
||||
<fieldset>
|
||||
<legend>Episode Search</legend>
|
||||
Search for:
|
||||
<input id=searchterm name=search value=\"$search\">
|
||||
<button id=tvdbepsearch>Search</button>
|
||||
</fieldset>
|
||||
|
||||
<div>
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<td>[$ts get title]</td>
|
||||
</tr><tr>
|
||||
<th>File</th>
|
||||
<td>[$ts get file]</td>
|
||||
</tr><tr>
|
||||
<th>Detected Episode</th>
|
||||
<td>[$ts epstr] - $epname (<i>$series</i>)</td>
|
||||
</tr><tr>
|
||||
<th>Found Using</th>
|
||||
<td>[$ts get tvdb_method]</td>
|
||||
</tr><tr>
|
||||
<th>Synopsis</th>
|
||||
<td class=synopsis>[$ts get synopsis]</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
"
|
||||
|
||||
if {$search ne ""} {
|
||||
set matches [lmap i [$tvdb episodesearch $search] {
|
||||
lassign $i x id
|
||||
list $id 0
|
||||
}]
|
||||
} else {
|
||||
set matches [$tvdb get _smatches]
|
||||
}
|
||||
|
||||
if {![llength $matches]} {
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
puts "
|
||||
<div>
|
||||
<table class=\"results keyval borders\">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sorter=false></th>
|
||||
<th>Score</th>
|
||||
<th>Ep.</th>
|
||||
<th>Name</th>
|
||||
<th data-sorter=false>Synopsis</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"
|
||||
|
||||
foreach match $matches {
|
||||
lassign $match episode_id score
|
||||
set ep [$tvdb episodebyid $episode_id]
|
||||
|
||||
if {![llength $ep]} continue
|
||||
|
||||
puts "<tr sid=$episode_id s=$ep(series) e=$ep(episode)><td>"
|
||||
|
||||
if {[dict exists $ep thumb]} {
|
||||
puts "<img width=200 src=\"[tvdb bannerurl $ep(thumb)]\">"
|
||||
}
|
||||
puts "</td>
|
||||
<td>$score</td>
|
||||
<td>s$ep(series)e$ep(episode)</td>
|
||||
<td> $ep(name)
|
||||
<br>
|
||||
<button class=select eid=$episode_id>Select</button>
|
||||
</td>
|
||||
<td>$ep(overview)</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
puts "
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
"
|
||||
|
||||
42
webif/html/browse/tvdb/episode.js
Normal file
42
webif/html/browse/tvdb/episode.js
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
$(function() {
|
||||
|
||||
var synopsis = $('.synopsis').text();
|
||||
var words = synopsis.split(" ");
|
||||
for (var i = 0;i < words.length - 1; i++)
|
||||
{
|
||||
var word = words[i];
|
||||
if (word.length > 4)
|
||||
$('table.results').highlight(words[i]);
|
||||
}
|
||||
|
||||
$('button.select').button().on('click', function() {
|
||||
$tr = $(this).closest('tr');
|
||||
$.get('select.jim', {
|
||||
file: file,
|
||||
episode: $tr.attr('sid'),
|
||||
s: $tr.attr('s'),
|
||||
e: $tr.attr('e')
|
||||
}, function() {
|
||||
window.location.href = '/go/browse/?dir=' +
|
||||
encodeURIComponent(dir);
|
||||
});
|
||||
});
|
||||
|
||||
$('#tvdbepsearch').button({icons:{primary:"ui-icon-search"}})
|
||||
.on('click', function() {
|
||||
window.location.href = '/browse/tvdb/episode.jim?file=' +
|
||||
encodeURIComponent(file) + '&search=' +
|
||||
encodeURIComponent($('#searchterm').val());
|
||||
});
|
||||
|
||||
$('table.results')
|
||||
.tablesorter({
|
||||
theme: 'webif',
|
||||
widthFixed: false,
|
||||
sortList: [[1,1]],
|
||||
widgets: ['zebra', 'stickyHeaders']
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
122
webif/html/browse/tvdb/script.js
Normal file
122
webif/html/browse/tvdb/script.js
Normal file
@@ -0,0 +1,122 @@
|
||||
|
||||
$(function() {
|
||||
|
||||
function select_episode()
|
||||
{
|
||||
var sid = $(this).attr('sid');
|
||||
|
||||
$('.tvdbresults').hide();
|
||||
$('#tvdbresults_saving').show();
|
||||
$('#tvdbresults').diagrefresh();
|
||||
|
||||
$.get('/browse/tvdb/store.jim', { dir: dir, sid: sid }, function(data) {
|
||||
if (data <= 0)
|
||||
{
|
||||
window.location.reload(true);
|
||||
return;
|
||||
}
|
||||
$('.tvdbresults').hide();
|
||||
$('#tvdbresults_force').show();
|
||||
$('#tvdb_forceseries').attr('max', data).val(0);
|
||||
|
||||
$('#tvdbresults').dialog('option', 'buttons', {
|
||||
"Save": function() {
|
||||
$('.tvdbresults').hide();
|
||||
$('#tvdbresults_saving').show();
|
||||
$('#tvdbresults').diagrefresh();
|
||||
$.get('/browse/tvdb/store.jim', {
|
||||
dir: dir,
|
||||
sid: sid,
|
||||
series: $('#tvdb_forceseries').val()
|
||||
}, function() {
|
||||
window.location.reload(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$('#tvdbsetseries').button({icons:{primary:"ui-icon-link"}})
|
||||
.on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
val = $('#tvdbseriesname').text();
|
||||
if (!val)
|
||||
val = dir.split(/[\\/]/).pop();
|
||||
val = val.trim();
|
||||
$('#tvdbsearch').val(val);
|
||||
$('#tvdbdialogue').dialog({
|
||||
modal: true, autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: true, resizable: true,
|
||||
closeOnEscape: true,
|
||||
buttons: [
|
||||
{
|
||||
text: "Search",
|
||||
icons: { primary: "ui-icon-search" },
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
$('.tvdbresults').hide();
|
||||
$('#tvdbresults_loading').show();
|
||||
$('#tvdbresults_inner').empty();
|
||||
$('#tvdbresults').dialog({
|
||||
modal: true, autoOpen: true,
|
||||
height: 'auto', width: 'auto',
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: true, resizable: true,
|
||||
closeOnEscape: true,
|
||||
buttons: {
|
||||
"Cancel": function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#tvdbresults_inner').load('/browse/tvdb/search.jim',
|
||||
{ term: $('#tvdbsearch').val() }, function() {
|
||||
$('#tvdbresults_inner')
|
||||
.find('.tvdbselect')
|
||||
.button()
|
||||
.on('click', select_episode);
|
||||
$('#tvdbresults_loading').slideUp('slow');
|
||||
$('#tvdbresults_inner').show();
|
||||
$('#tvdbresults').diagrefresh({
|
||||
width: $(window).width() - 100,
|
||||
height: $(window).height() - 100
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Clear Series Information",
|
||||
'class': 'red',
|
||||
click: function() {
|
||||
if (!confirm('Clear series information for ' +
|
||||
'this folder?'))
|
||||
return;
|
||||
blockpage('Clearing Series Information...');
|
||||
$.get('/browse/tvdb/store.jim', {dir: dir, sid: 0},
|
||||
function() {
|
||||
window.location.reload(true);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Close",
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
$('img.tvdbbannertop').hover(
|
||||
function() { $(this).css('cursor', 'pointer'); },
|
||||
function() { $(this).css('cursor', 'auto'); }
|
||||
).on('click', function() {
|
||||
var sid = $(this).closest('div').attr('sid');
|
||||
window.open('http://thetvdb.com/?tab=series&id=' + sid, '_blank');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
49
webif/html/browse/tvdb/search.jim
Executable file
49
webif/html/browse/tvdb/search.jim
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require tvdb.class
|
||||
|
||||
set term [cgi_get term -]
|
||||
if {$term eq "-"} exit
|
||||
|
||||
httpheader
|
||||
|
||||
set slist [[tvdb] searchseries $term]
|
||||
if {[llength $slist]} {
|
||||
foreach series $slist {
|
||||
puts "
|
||||
<div>
|
||||
<div class=tvdbseries>
|
||||
<a target=_blank href=[tvdb seriesurl $series(seriesid)]>
|
||||
"
|
||||
if {[dict exists $series banner]} {
|
||||
puts "
|
||||
<img class=tvdbbanner src=\"[tvdb bannerurl $series(banner)]\">
|
||||
"
|
||||
} else {
|
||||
puts "View on TheTVDB"
|
||||
}
|
||||
puts "
|
||||
</a>
|
||||
<span title=\"Series ID: $series(seriesid)\">
|
||||
$series(seriesname)
|
||||
</span>
|
||||
<button class=tvdbselect sid=\"$series(seriesid)\">
|
||||
Select
|
||||
</button>
|
||||
</div>
|
||||
<div class=tvdbsynopsis>
|
||||
"
|
||||
if {[dict exists $series overview]} {
|
||||
puts $series(overview)
|
||||
}
|
||||
puts "
|
||||
</div>
|
||||
</div>
|
||||
"
|
||||
}
|
||||
} else {
|
||||
puts "No matches found."
|
||||
}
|
||||
|
||||
22
webif/html/browse/tvdb/select.jim
Executable file
22
webif/html/browse/tvdb/select.jim
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require tvdb.class ts.class
|
||||
|
||||
set file [cgi_get file -]
|
||||
set episode [cgi_get episode -]
|
||||
set s [cgi_get s -]
|
||||
set e [cgi_get e -]
|
||||
|
||||
httpheader
|
||||
|
||||
if {$file eq "-" || $episode eq "-"} exit
|
||||
|
||||
if {[catch {set ts [ts fetch $file]}] || $ts eq "0"} {
|
||||
puts "Unable to load recording data."
|
||||
exit
|
||||
}
|
||||
|
||||
$ts storeepisode [list $s $e 0]
|
||||
|
||||
33
webif/html/browse/tvdb/store.jim
Executable file
33
webif/html/browse/tvdb/store.jim
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require tvdb.class classdump
|
||||
|
||||
set dir [cgi_get dir -]
|
||||
set sid [cgi_get sid -]
|
||||
set series [cgi_get series 0]
|
||||
|
||||
httpheader
|
||||
|
||||
if {$dir eq "-" || $sid eq "-"} exit
|
||||
|
||||
if {$sid == 0} {
|
||||
file delete "$dir/.tvdbseriesid"
|
||||
file delete "$dir/.tvdbseries"
|
||||
puts -nonewline 0
|
||||
exit
|
||||
}
|
||||
|
||||
set v [tvdb series "" $sid]
|
||||
if {[$v get seriesid] == 0} exit
|
||||
|
||||
file write "$dir/.tvdbseriesid" $sid
|
||||
if {$series > 0} {
|
||||
file write "$dir/.tvdbseries" $series
|
||||
} else {
|
||||
file delete "$dir/.tvdbseries"
|
||||
}
|
||||
|
||||
puts -nonewline [$v series_count]
|
||||
|
||||
32
webif/html/browse/tvdb/style.css
Normal file
32
webif/html/browse/tvdb/style.css
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
div.tvdbseries
|
||||
{
|
||||
border-top: 1px solid;
|
||||
padding-top: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.tvdbsynopsis
|
||||
{
|
||||
font-style: italic;
|
||||
margin: 0 2em;
|
||||
}
|
||||
|
||||
img.tvdbbanner
|
||||
{
|
||||
height: 50px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
img.tvdbbannertop
|
||||
{
|
||||
height: 60px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
img.tvdblogo
|
||||
{
|
||||
vertical-align: middle;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
@@ -3,3 +3,32 @@
|
||||
* It will not be overwritten on webif updates.
|
||||
*/
|
||||
|
||||
/* The examples below can be uncommented if required. */
|
||||
|
||||
/* Hide the Guidance icons on the schedule and EPG pages */
|
||||
/* img.guidance { display: none; } */
|
||||
|
||||
/* Hide the VFD display */
|
||||
/* #vfd { display: none; } */
|
||||
|
||||
/* Set VFD to orange */
|
||||
/* #vfd { color: #ffa500; } */
|
||||
|
||||
/* Set VFD to orange with no black background */
|
||||
/* #vfd { color: #ffa500; background: transparent; } */
|
||||
|
||||
/* Move VFD left to align with Humax above */
|
||||
/* #vfd { left: 180px; } */
|
||||
|
||||
/* Hide the Idle time */
|
||||
/* #idletime { display: none; } */
|
||||
|
||||
/* Make the package screens more compact */
|
||||
/* table.avail td, table.inst td, table.upgr td { padding: 0 !important; } */
|
||||
|
||||
/* Shrink main menu icons */
|
||||
/* img.mmenu { width: 120px !important; height: 125px !important; } */
|
||||
|
||||
/* Wrap long lines in the queue screen log column */
|
||||
/* td.queuelog { white-space: normal !important; } */
|
||||
|
||||
|
||||
34
webif/html/css/EXTRA.css.distrib
Normal file
34
webif/html/css/EXTRA.css.distrib
Normal file
@@ -0,0 +1,34 @@
|
||||
/* This style sheet can be customised to change the look and feel of some
|
||||
* web interface elements.
|
||||
* It will not be overwritten on webif updates.
|
||||
*/
|
||||
|
||||
/* The examples below can be uncommented if required. */
|
||||
|
||||
/* Hide the Guidance icons on the schedule and EPG pages */
|
||||
/* img.guidance { display: none; } */
|
||||
|
||||
/* Hide the VFD display */
|
||||
/* #vfd { display: none; } */
|
||||
|
||||
/* Set VFD to orange */
|
||||
/* #vfd { color: #ffa500; } */
|
||||
|
||||
/* Set VFD to orange with no black background */
|
||||
/* #vfd { color: #ffa500; background: transparent; } */
|
||||
|
||||
/* Move VFD left to align with Humax above */
|
||||
/* #vfd { left: 180px; } */
|
||||
|
||||
/* Hide the Idle time */
|
||||
/* #idletime { display: none; } */
|
||||
|
||||
/* Make the package screens more compact */
|
||||
/* table.avail td, table.inst td, table.upgr td { padding: 0 !important; } */
|
||||
|
||||
/* Shrink main menu icons */
|
||||
/* img.mmenu { width: 120px !important; height: 125px !important; } */
|
||||
|
||||
/* Wrap long lines in the queue screen log column */
|
||||
/* td.queuelog { white-space: normal !important; } */
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
@font-face
|
||||
{
|
||||
font-family: vfd;
|
||||
src: url(/lib/font/vfd.ttf);
|
||||
}
|
||||
|
||||
html body
|
||||
{
|
||||
line-height: 1.55em;
|
||||
@@ -68,6 +74,35 @@ div.container .middle
|
||||
height: 116px;
|
||||
}
|
||||
|
||||
div.container .usb
|
||||
{
|
||||
position: absolute;
|
||||
left: -5px;
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
#vfd
|
||||
{
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
top: 55px;
|
||||
background: #444;
|
||||
color: #1bd1b0;
|
||||
/*color: #58edf0;*/
|
||||
font-size: 20px;
|
||||
padding: 5px;
|
||||
font-family: vfd, 'Lucida Console', Monaco, monospace;
|
||||
}
|
||||
|
||||
#idletime
|
||||
{
|
||||
position: absolute;
|
||||
left: 50px;
|
||||
top: 45px;
|
||||
font-style: italic;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
div.footer
|
||||
{
|
||||
clear: both;
|
||||
@@ -158,22 +193,22 @@ table.keyval td
|
||||
|
||||
pre, .pre, .prelike
|
||||
{
|
||||
font-family: Consolas, 'Courier New', Courier, monospace;
|
||||
color: black;
|
||||
background: #f9d9b0 url('/img/prebg.png') repeat-x top;
|
||||
font-family: Consolas, 'Courier New', Courier, monospace;
|
||||
color: black;
|
||||
background: #f9d9b0 url('/img/prebg.png') repeat-x top;
|
||||
line-height: 1.24;
|
||||
padding: 3px 8px;
|
||||
margin: 0 5em 1em 5em;
|
||||
border-color: #f9d9b0;
|
||||
border-bottom: 1px solid #f9bc6d;
|
||||
border-top-left-radius: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-moz-border-radius-topleft: 4px;
|
||||
-khtml-border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-moz-border-radius-topright: 4px;
|
||||
-khtml-border-top-right-radius: 4px;
|
||||
padding: 3px 8px;
|
||||
margin: 0 5em 1em 5em;
|
||||
border-color: #f9d9b0;
|
||||
border-bottom: 1px solid #f9bc6d;
|
||||
border-top-left-radius: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-moz-border-radius-topleft: 4px;
|
||||
-khtml-border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-moz-border-radius-topright: 4px;
|
||||
-khtml-border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
pre, .pre
|
||||
@@ -228,17 +263,23 @@ pre, .pre
|
||||
|
||||
.blood
|
||||
{
|
||||
color: #ff4000;
|
||||
color: #ff4000 !important;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.idletime
|
||||
{
|
||||
font-size: 70%;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.filesize
|
||||
{
|
||||
color: #6a6aff;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.footnote, .bfootnote
|
||||
.footnote, .bfootnote, .bluefootnote
|
||||
{
|
||||
background: transparent;
|
||||
font-size: 70%;
|
||||
@@ -247,12 +288,17 @@ pre, .pre
|
||||
|
||||
.footnote
|
||||
{
|
||||
color: #ff4000;
|
||||
color: #ff4000 !important;
|
||||
}
|
||||
|
||||
.blueshade
|
||||
.bluefootnote
|
||||
{
|
||||
background: #b9daff;
|
||||
color: #0000ff !important;
|
||||
}
|
||||
|
||||
tr.blueshade > td, .blueshade
|
||||
{
|
||||
background: #b9daff !important;
|
||||
color: black;
|
||||
}
|
||||
|
||||
@@ -264,7 +310,7 @@ pre, .pre
|
||||
|
||||
.pinkshade
|
||||
{
|
||||
background: #ffccff;
|
||||
background: #ffccff !important;
|
||||
color: black;
|
||||
}
|
||||
|
||||
@@ -273,18 +319,30 @@ pre, .pre
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.error
|
||||
{
|
||||
background: #ffcccc;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.greenshade
|
||||
{
|
||||
background: #e4faa8;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.orangeshade
|
||||
tr.orangeshade > td, .orangeshade
|
||||
{
|
||||
background: #ffeeaa;
|
||||
background: #ff8040 !important;
|
||||
color: black;
|
||||
}
|
||||
|
||||
tr.purpleshade > td, .purpleshade
|
||||
{
|
||||
background: #7e587e !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.redshade
|
||||
{
|
||||
background: #ff4000;
|
||||
@@ -358,7 +416,6 @@ div.cut
|
||||
|
||||
.ui-button, .ui-button-text
|
||||
{
|
||||
padding: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -373,6 +430,7 @@ div.cut
|
||||
div.toolbarouter
|
||||
{
|
||||
position: relative;
|
||||
z-index: 29;
|
||||
}
|
||||
|
||||
div.toolbar
|
||||
@@ -394,17 +452,26 @@ div.toolbar
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
#status
|
||||
{
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
span.toolbarcell
|
||||
{
|
||||
float: left;
|
||||
border-right: 1px solid #ccc;
|
||||
text-align: center;
|
||||
padding: 0 1em;
|
||||
margin-top: 1px;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.tbhover
|
||||
{
|
||||
background: #dfe8ef;
|
||||
margin-top: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
border-top: solid 1px #ccc;
|
||||
border-left: solid 1px #ccc;
|
||||
}
|
||||
@@ -419,21 +486,21 @@ span.toolbarcell
|
||||
|
||||
button.blue
|
||||
{
|
||||
background: url(/img/gloss_wave_blue.png) repeat-x center;
|
||||
background: url(/img/gloss_wave_blue.png) repeat-x center !important;
|
||||
border: 1px solid blue;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
button.green
|
||||
{
|
||||
background: url(/img/gloss_wave_green.png) repeat-x center;
|
||||
background: url(/img/gloss_wave_green.png) repeat-x center !important;
|
||||
border: 1px solid green;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
button.red
|
||||
{
|
||||
background: url(/img/gloss_wave_red.png) repeat-x center;
|
||||
background: url(/img/gloss_wave_red.png) repeat-x center !important;
|
||||
border: 1px solid green;
|
||||
color: #ffffff;
|
||||
}
|
||||
@@ -443,15 +510,19 @@ div#restart_block
|
||||
text-align: center;
|
||||
z-index: 31;
|
||||
float: right;
|
||||
width: 60%;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 100px;
|
||||
width: 130px;
|
||||
position: relative;
|
||||
top: 20px;
|
||||
background-color: #f8f8f8;
|
||||
opacity: 0.9;
|
||||
filter:alpha(opacity=90);
|
||||
}
|
||||
|
||||
button#restart_humaxtv
|
||||
{
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
img.bmp, img.doublebmp
|
||||
{
|
||||
transform: scaleY(-1);
|
||||
@@ -472,6 +543,13 @@ img.doublebmp
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.stackimg
|
||||
{
|
||||
position: absolute;
|
||||
height: 20px;
|
||||
width: 29px;
|
||||
}
|
||||
|
||||
span.foldernum
|
||||
{
|
||||
display: none;
|
||||
@@ -481,13 +559,13 @@ span.foldernum
|
||||
color: white;
|
||||
height: 15px;
|
||||
line-height: 16px;
|
||||
background-color: #CC0000;
|
||||
background: linear-gradient(#FF0000, #CC0000) repeat scroll 0 0 #EEEEEE;
|
||||
background-color: #cc0000;
|
||||
background: linear-gradient(#ff0000, #cc0000) repeat scroll 0 0 #eeeeee;
|
||||
font-size: 10px;
|
||||
border: 1px solid #660000;
|
||||
padding: 0 2px 0 2px;
|
||||
border-radius: 1em 1em 1em 1em;
|
||||
-moz-border-radius: 1em;
|
||||
-moz-border-radius: 1em;
|
||||
-webkit-border-radius: 1em;
|
||||
border-top-right-radius: 1em;
|
||||
border-top-left-radius: 1em;
|
||||
@@ -495,3 +573,151 @@ span.foldernum
|
||||
border-bottom-left-radius: 1em;
|
||||
}
|
||||
|
||||
span.folderu
|
||||
{
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 40;
|
||||
left: 34px;
|
||||
top: 7px;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
height: 10px;
|
||||
line-height: 1px;
|
||||
background-color: #00cc00;
|
||||
background: linear-gradient(#00ff00, #00cc00) repeat scroll 0 0 #eeeeee;
|
||||
font-size: 10px;
|
||||
border: 1px solid #660000;
|
||||
padding: 0 2px 0 2px;
|
||||
border-radius: 1em 1em 1em 1em;
|
||||
-moz-border-radius: 1em;
|
||||
-webkit-border-radius: 1em;
|
||||
border-top-right-radius: 1em;
|
||||
border-top-left-radius: 1em;
|
||||
border-bottom-right-radius: 1em;
|
||||
border-bottom-left-radius: 1em;
|
||||
}
|
||||
|
||||
#tbdiskspace
|
||||
{
|
||||
float: right;
|
||||
padding-top: 1.2em;
|
||||
position: relative;
|
||||
right: -10px;
|
||||
}
|
||||
|
||||
#tbdiskpie
|
||||
{
|
||||
float: right;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
position: relative;
|
||||
right: -10px;
|
||||
}
|
||||
|
||||
.tbdiskpie
|
||||
{
|
||||
top: -10px !important;
|
||||
}
|
||||
|
||||
#usbejectinfo
|
||||
{
|
||||
position: relative;
|
||||
border: 1px solid #899caa;
|
||||
box-shadow: 2px 2px 11px #666;
|
||||
-moz-box-shadow: 2px 2px 11px #666;
|
||||
-webkit-box-shadow: 2px 2px 11px #666;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
background: #d2e0ea;
|
||||
padding: 6px;
|
||||
z-index: 40;
|
||||
}
|
||||
|
||||
#rollimg
|
||||
{
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
img.rollimg
|
||||
{
|
||||
height: 78px;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.versions
|
||||
{
|
||||
color: #ff4000 !important;
|
||||
background: transparent;
|
||||
font-size: 0.9em;
|
||||
float: right;
|
||||
clear: right;
|
||||
}
|
||||
|
||||
#epginfo_extra
|
||||
{
|
||||
color: #ff4000 !important;
|
||||
background: transparent;
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
/* Minimal tabs */
|
||||
|
||||
#minimaltabbar
|
||||
{
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0 0 0 0;
|
||||
position: relative;
|
||||
top: -40px;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-widget-header
|
||||
{
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-bottom: 1px solid #c0c0c0;
|
||||
-moz-border-radius: 0px;
|
||||
-webkit-border-radius: 0px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-tabs-nav
|
||||
{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-tabs-nav .ui-state-default
|
||||
{
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-tabs-nav .ui-state-active
|
||||
{
|
||||
background: transparent url(/img/uiTabsArrow.png) no-repeat bottom center;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-tabs-nav .ui-state-default a
|
||||
{
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-tabs-nav .ui-state-active a
|
||||
{
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#minimaltabbar .ui-tabs-panel
|
||||
{
|
||||
padding: 0 0 0 0;
|
||||
}
|
||||
|
||||
a.breadcrumb:hover
|
||||
{
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,43 @@ package require sqlite3
|
||||
source /mod/webif/lib/setup
|
||||
require altrow
|
||||
|
||||
jqplugin tablesorter2
|
||||
jscss script.js
|
||||
|
||||
set databases [glob /var/lib/humaxtv/*.db]
|
||||
lappend databases {*}[glob /mod/etc/*.db]
|
||||
lappend databases "/mnt/hd2/dms_cds.db"
|
||||
lappend databases {*}[glob /mod/var/tvdb/*.db]
|
||||
|
||||
header
|
||||
|
||||
puts {
|
||||
<div class=va>
|
||||
<img class=va src=/img/db.png height=50>
|
||||
|
||||
Database Browser
|
||||
</div>
|
||||
}
|
||||
|
||||
set ftab [cgi_get tab]
|
||||
set fdb [cgi_get db]
|
||||
|
||||
if {$fdb != 0} {
|
||||
puts "<h1><a href=/cgi-bin/db.jim>Remove filters</a></h1>"
|
||||
puts "<h3><a href=/db/index.jim>Remove filters</a></h3>"
|
||||
}
|
||||
|
||||
proc escape {data} {
|
||||
if {[string is print $data]} { return $data }
|
||||
set ret ""
|
||||
foreach c [split $data ""] {
|
||||
if {[string is print $c]} {
|
||||
append ret $c
|
||||
} else {
|
||||
binary scan $c H* hex
|
||||
append ret "\\x$hex"
|
||||
}
|
||||
}
|
||||
return $ret
|
||||
}
|
||||
|
||||
proc db_info {db_file} {
|
||||
@@ -30,8 +56,8 @@ proc db_info {db_file} {
|
||||
where type='table' order by name
|
||||
}]
|
||||
|
||||
puts "<h1><a href=/cgi-bin/db.jim?db=[file tail $db_file]>
|
||||
$db_file</a></h1>"
|
||||
puts "<h3><a href=/db/index.jim?db=[file tail $db_file]>
|
||||
$db_file</a></h3>"
|
||||
|
||||
foreach table $tables {
|
||||
set table [lindex $table 1]
|
||||
@@ -39,22 +65,33 @@ proc db_info {db_file} {
|
||||
set columns [$db query "pragma table_info($table)"]
|
||||
set datas [$db query "SELECT * FROM $table order by 1"]
|
||||
|
||||
puts "<h2><a href=/cgi-bin/db.jim?db=[file tail $db_file]&tab=$table>$table</a></h2>"
|
||||
puts "<table class=borders>"
|
||||
puts " <tr>"
|
||||
puts "
|
||||
<h2><a href=/db/index.jim?db=[file tail $db_file]&tab=$table>$table</a></h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
"
|
||||
foreach column $columns {
|
||||
puts " <th>[lindex $column 3]</th>"
|
||||
}
|
||||
puts " </tr>"
|
||||
puts "
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
"
|
||||
foreach data $datas {
|
||||
altrow
|
||||
|
||||
for {set i 1} {$i < [llength $data]} {incr i 2} {
|
||||
puts " <td>[lindex $data $i]</td>"
|
||||
puts " <td nowrap>[
|
||||
escape [lindex $data $i]]</td>"
|
||||
}
|
||||
puts " </tr>"
|
||||
}
|
||||
puts "</table>"
|
||||
puts "
|
||||
</tbody>
|
||||
</table>
|
||||
"
|
||||
}
|
||||
|
||||
$db close
|
||||
@@ -62,7 +99,7 @@ proc db_info {db_file} {
|
||||
|
||||
if {$fdb == 0} {
|
||||
puts "Please choose database to view:<ul>"
|
||||
foreach db $databases {
|
||||
foreach db [lsort $databases] {
|
||||
puts "<li><a href=$::env(SCRIPT_NAME)?db=[file tail $db]>
|
||||
$db</a></li>"
|
||||
}
|
||||
11
webif/html/db/script.js
Normal file
11
webif/html/db/script.js
Normal file
@@ -0,0 +1,11 @@
|
||||
$(function() {
|
||||
|
||||
$('table')
|
||||
.tablesorter({
|
||||
theme: 'webif',
|
||||
widthFixed: false,
|
||||
widgets: ['zebra', 'stickyHeaders']
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user