Compare commits
624 Commits
1.0.17@204
...
1.5.2
| Author | SHA1 | Date | |
|---|---|---|---|
| c60ac50c43 | |||
| 275dc62d26 | |||
| d22735af68 | |||
| fb9fb6ca85 | |||
| 1d243c989b | |||
| 44c52143a7 | |||
| 7bd5bbc3c0 | |||
| 9c5b1a5641 | |||
| 90b69d0d21 | |||
| 8713ea9495 | |||
| 7c3021e320 | |||
| 0108d87c1c | |||
| 9b5c9553f0 | |||
| 2ea56fd045 | |||
| ac13c730a8 | |||
| 3de96080c2 | |||
| 1def3cc520 | |||
| d3f83f6f42 | |||
| 0711f9b226 | |||
| a7b7e589e1 | |||
| 0a5f9a95c4 | |||
| a1adcb7033 | |||
| 32a32d2ad3 | |||
| 7bac247e48 | |||
| bafa8fcfd3 | |||
| 39d18b4ff0 | |||
| c9100acf66 | |||
| 0ab8fb125d | |||
| b24ade080f | |||
| 62d63b2f84 | |||
| f5b43f7ea1 | |||
| 640e81bda0 | |||
| 7a00ea84ed | |||
| d3d1755e98 | |||
| b63a268dac | |||
| ce9e32977d | |||
| 29e560b11b | |||
| 30a006b971 | |||
| aa24f100fa | |||
| f9825002eb | |||
| 47f413b55d | |||
| b0ba26918a | |||
| 3f756a78f4 | |||
| 80464c8342 | |||
| a587278586 | |||
| 00e8a342c0 | |||
| 203430c224 | |||
| 8c2a33b54d | |||
| 3f1832387a | |||
| cb78e4bc1d | |||
| f17adb764b | |||
| c73a940bae | |||
| 805b9ba2dc | |||
| 66bd753689 | |||
| c1358ef72f | |||
| 25bb62f622 | |||
| aab63aa8cc | |||
| 5e941b889c | |||
| b6c0ff80b6 | |||
| 97b24da0ed | |||
| a34a951a33 | |||
| 12ecc32e44 | |||
| b44f5c3678 | |||
| bdfae19796 | |||
| 5cb9bdd6dd | |||
| 9b8e6763af | |||
| 1e53bc1b37 | |||
| cfa77051e5 | |||
| 08de047d91 | |||
| da24fc6b20 | |||
| f4357b87db | |||
| 9fb761a38e | |||
| a79addc543 | |||
| 5edd63b2af | |||
| 7f1d68bf3a | |||
| 0d7ba4744f | |||
| c5c4091cf6 | |||
| 778c328a79 | |||
| 99f22c6a28 | |||
| 51719420ba | |||
| e5a8f12a15 | |||
| 3dc3404327 | |||
| 67fe7e655c | |||
| 4f55ea1b9f | |||
| 4f5ba6f14f | |||
| a7a4067a7f | |||
| 4d9fa6b961 | |||
| 55ea14864c | |||
| de1b690f36 | |||
| caafde56c8 | |||
| cb549b4995 | |||
|
|
d04c094543 | ||
|
|
2b51358c63 | ||
| 033eff6fcc | |||
| d5b34ed2c3 | |||
|
|
541318fbba | ||
| eab635cab6 | |||
| e4aa241351 | |||
|
|
760f6db560 | ||
|
|
d5fd97a83a | ||
|
|
d4fbdd149e | ||
|
|
3a1d398874 | ||
| 4b925199e5 | |||
| 599bb9b5bc | |||
| cdeea09dab | |||
| 710162a654 | |||
| 8347713f55 | |||
| afee47b6bc | |||
| 318d088fff | |||
| 08ec7643f7 | |||
|
|
0e66340b42 | ||
| 6c3c1f3423 | |||
| a748870195 | |||
| 5c8a573382 | |||
| db477e5d42 | |||
| 7c4d359aec | |||
| 88d3274241 | |||
| 00689a2036 | |||
| 39dae95f28 | |||
| 0c1bb71520 | |||
| 763abda557 | |||
| 3f75333542 | |||
| 11cfa40d78 | |||
| e884a2ebad | |||
| fac0dee693 | |||
| 2f28b0a66e | |||
| ad9b48b0d2 | |||
| 0e6a67d24a | |||
| eb7f9667ba | |||
| b8964c8017 | |||
| 1a08892868 | |||
|
|
42619e6555 | ||
|
|
eac4849326 | ||
|
|
0d99a7b24d | ||
| 6d0b1deebe | |||
| 959aa9f8e6 | |||
| 6814880b40 | |||
|
|
569bff9d60 | ||
| b9787a0a9f | |||
| 42d03e25c6 | |||
| 13f3b1ccce | |||
| 3981bbd37e | |||
| 67e71691eb | |||
| 567d142613 | |||
| 1b11be6827 | |||
| 519f771859 | |||
| 49a7e430cf | |||
| da7d07a891 | |||
| bf838ed5e4 | |||
| 8b795a0a7d | |||
| 243dfdd595 | |||
| 8bbc28d3c2 | |||
| c8f51adfaa | |||
| 4845a4b0cf | |||
|
|
ee4c121a54 | ||
|
|
8f340c9a3b | ||
| 67504198ec | |||
| ba0f505e34 | |||
| 33e2f705c3 | |||
| a26526b047 | |||
|
|
04e4fd1083 | ||
| 6e3b5114be | |||
| 6c40da165d | |||
| 7964145677 | |||
| f032f8b469 | |||
| e79e85af81 | |||
| 68d9d7f5b5 | |||
| 3454302a98 | |||
| 75b32ad3e0 | |||
| 20c035873e | |||
| 346ed469c8 | |||
|
|
029b115628 | ||
|
|
c7a91766af | ||
|
|
d00f925e58 | ||
|
|
fc3b28e978 | ||
| c4afa7ac60 | |||
| 3c3b0af49f | |||
| f206766191 | |||
| 67afb37f27 | |||
| ad150143a8 | |||
| 5d3b046c70 | |||
| 18bed926b3 | |||
| 1c868ae201 | |||
|
|
4820ade1f5 | ||
| bc2e6c1a85 | |||
| 6f45884f94 | |||
| a1cf871a84 | |||
| 7834dae075 | |||
| 15cba14cc3 | |||
| 3f74654ea2 | |||
| f16399ec2f | |||
| 0060e47db5 | |||
| 8bdb1233e8 | |||
| 2642b190b0 | |||
| 8975cbd71d | |||
| 32ac3c8421 | |||
| f5180dc144 | |||
| dac3ea8698 | |||
| 4ae8ea85f7 | |||
| 47495e7b8d | |||
| 73d25247f0 | |||
| f7c37e83ae | |||
| cf407f9a80 | |||
| d98217b679 | |||
|
|
269f844f43 | ||
|
|
488961c600 | ||
|
|
a5f0734201 | ||
| 94849c51e7 | |||
| 907d9d8dcf | |||
| 6641b6f458 | |||
| 98ef6a876f | |||
| d05f841bb4 | |||
| 4da3bb0209 | |||
|
|
2e471129b8 | ||
| 0ad1491634 | |||
| da32aa0a72 | |||
| f6117a4ec0 | |||
| 580ecb8c75 | |||
| 3c8ea907de | |||
| 8e68fb10ad | |||
| c9d7299092 | |||
| 0b6f6fccb1 | |||
| 6937f2b7fb | |||
| 086814cafa | |||
| 8021455a94 | |||
| c995f2232e | |||
| 6dc47f2b96 | |||
| af74503b99 | |||
| 58ecd41952 | |||
| e579c8dd24 | |||
| 7c600be77e | |||
| e3f7a2b738 | |||
| a90f49b324 | |||
| 3e9ecc8a7c | |||
| 7bb66de5f2 | |||
| 9b64128c92 | |||
| 6822c833be | |||
| cefe60c722 | |||
| ee885a173c | |||
|
|
d7c15163e1 | ||
| 879c458256 | |||
| 1a25e2a3f1 | |||
| 006a04683a | |||
| 3623a26a08 | |||
| c428a367a1 | |||
| 480108f3a2 | |||
| 2884a82dbf | |||
| ac4b392db8 | |||
| c3d360fa63 | |||
| 2d06ec7811 | |||
| 3f199f32ab | |||
|
|
1994d99294 | ||
|
|
cbc62f4903 | ||
| f40a82df57 | |||
|
|
0ef47da7b6 | ||
| 42cf8bf238 | |||
| 9cf915e5f7 | |||
| 478d9db2e2 | |||
| b824882eb2 | |||
|
|
4b3efc2e72 | ||
|
|
abf121bba4 | ||
|
|
c1bc10eca8 | ||
| 0e09258bfa | |||
|
|
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 |
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.17
|
||||
Version: 1.5.2
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: webif-channelicons(>=1.1.12-2),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: prpr
|
||||
Depends: tcpfix,webif-channelicons(>=1.1.27),lighttpd(>=1.4.39-1),jim(>=0.81-3),jim-cgi(>=0.7-2),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.11),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/10760/
|
||||
|
||||
@@ -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: auto; 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>
|
||||
"
|
||||
}
|
||||
@@ -84,7 +113,7 @@ if {[$record get event_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th>CRID</th><td>
|
||||
<a href=/cgi-bin/epg/search.jim?crid=[$record get event_crid]>
|
||||
<a href=/cgi-bin/epg/search.jim?crid=[cgi_quote_url [$record get event_crid]]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$record get channel_crid][$record get event_crid]
|
||||
@@ -98,7 +127,7 @@ if {[$record get series_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th nowrap>Series CRID</th><td>
|
||||
<a href=/cgi-bin/epg/search.jim?scrid=[$record get series_crid]>
|
||||
<a href=/cgi-bin/epg/search.jim?scrid=[cgi_quote_url [$record get series_crid]]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$record get channel_crid][$record get series_crid]
|
||||
@@ -112,7 +141,7 @@ if {[$record get rec_crid] != ""} {
|
||||
set rec [$record recommended]
|
||||
if {$rec != ""} {
|
||||
puts "<tr><th>Recommends</th><td>
|
||||
<a href=/cgi-bin/epg/search.jim?crid=[$rec get event_crid]>
|
||||
<a href=/cgi-bin/epg/search.jim?crid=[cgi_quote_url [$rec get event_crid]]>
|
||||
<img border=0 height=14
|
||||
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
||||
[$rec get name]
|
||||
@@ -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>"
|
||||
|
||||
@@ -9,12 +9,12 @@ header
|
||||
|
||||
require totop
|
||||
|
||||
set ct [cgi_get ct 0]
|
||||
set crid [cgi_get crid ""]
|
||||
set scrid [cgi_get scrid ""]
|
||||
set ct [cgi_unquote_input [cgi_get ct 0]]
|
||||
set crid [cgi_unquote_input [cgi_get crid ""]]
|
||||
set scrid [cgi_unquote_input [cgi_get scrid ""]]
|
||||
|
||||
if {[cgi_exists term]} {
|
||||
set lterm [cgi_get term]
|
||||
set lterm [cgi_unquote_input [cgi_get term]]
|
||||
|
||||
if {[string match {CRID:*} $lterm]} {
|
||||
set crid [string range $lterm 5 end]
|
||||
@@ -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 {
|
||||
@@ -105,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,44 +2,81 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pkg.class system.class
|
||||
require pkg.class system.class settings.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"
|
||||
|
||||
if {![system connectivity]} {
|
||||
puts ""
|
||||
puts "!! ERROR - No network connectivity to package repository !!"
|
||||
puts ""
|
||||
puts "Check your Internet connection and DNS service and then try again."
|
||||
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
|
||||
|
||||
if {$cmd eq "update" || $cmd eq "upgrade"} {
|
||||
puts "Updating package meta information"
|
||||
pkg fetchmeta
|
||||
puts "Done."
|
||||
puts ""
|
||||
puts "Updating diagnostic meta information"
|
||||
pkg fetchdiagmeta
|
||||
puts "Done."
|
||||
if {$cmd eq "remove" && [[settings] noautoremove] ne "1"} {
|
||||
append cmd " --autoremove"
|
||||
}
|
||||
|
||||
opkg "$cmd $cmdargs"
|
||||
|
||||
if {$cmd eq "update" || $cmd eq "upgrade"} {
|
||||
putsf "Updating package meta information"
|
||||
pkg fetchmeta
|
||||
putsf "Done."
|
||||
putsf ""
|
||||
putsf "Updating diagnostic meta information"
|
||||
pkg fetchdiagmeta
|
||||
pkg removemuxdb
|
||||
}
|
||||
|
||||
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,12 +2,12 @@
|
||||
|
||||
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 }
|
||||
|
||||
set schedtime 1200
|
||||
set schedtime 1200
|
||||
switch $runmode {
|
||||
cgi {
|
||||
set type [cgi_get type "full"]
|
||||
@@ -15,7 +15,7 @@ switch $runmode {
|
||||
}
|
||||
cli {
|
||||
set type "full"
|
||||
if {"-X" in $argv} { set schedtime 7200 }
|
||||
if {[lsearch -nocase $argv "-x"] >= 0} { set schedtime 7200 }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,120 +30,224 @@ 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 stream tsr tsrcnt
|
||||
|
||||
set ret {}
|
||||
if {[catch {set data \
|
||||
[exec /mod/webif/lib/bin/lsof -X -Fns -p $pid]} msg]} {
|
||||
[exec /mod/webif/lib/bin/lsof -Fnsa -p $pid]} msg]} {
|
||||
debug "Error: $msg"
|
||||
set ret {}
|
||||
} else {
|
||||
set size 0
|
||||
foreach line [split $data "\n"] {
|
||||
set typ [string index $line 0]
|
||||
switch $typ {
|
||||
a {
|
||||
set access [string index $line 1]
|
||||
}
|
||||
s {
|
||||
set size [string range $line 1 end]
|
||||
}
|
||||
n {
|
||||
if {[string first Video/ $line] == -1 && \
|
||||
[string first /media/ $line] == -1} {
|
||||
# strip initial n and trailing " (...)" if
|
||||
# present
|
||||
regsub -all -- {(^n)|( \([^\)]+\)$)} \
|
||||
$line "" line
|
||||
set file [subst -nocommands -novariables $line]
|
||||
set ext [file extension $line]
|
||||
# Note but skip TSR buffers
|
||||
if {[file rootname $file] eq $tsr} {
|
||||
if {$ext eq ".nts"} {
|
||||
incr tsrcnt
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if {[string first Video/ $line] >= 0 ||
|
||||
[string first /media/ $line] >= 0} {
|
||||
if {$ext ni $exts} {
|
||||
continue
|
||||
}
|
||||
} elseif {[string first $line /] >= 0} {
|
||||
# fast skip other files
|
||||
continue
|
||||
} elseif {[regexp -- {[A-Za-z0-9._-]+:([0-9]+)->([A-Za-z0-9._-]+):([0-9]+)} $line _ sprt host dprt]} {
|
||||
if {$sprt == 9000} {
|
||||
incr stream
|
||||
continue
|
||||
} elseif {$dprt == 9000} {
|
||||
set file [\
|
||||
format "DLNA from %s" $host]
|
||||
set size 0
|
||||
set ext ""
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
regsub -- { \([^\)]+\)$} $line "" line
|
||||
set ext [file extension $line]
|
||||
if {$ext ni $exts} continue
|
||||
set file [string range $line 1 end]
|
||||
# Handle chase play (same file open twice
|
||||
# and recently written)
|
||||
if {[dict exists $ret $file] && \
|
||||
if {[dict exists $ret $file] &&
|
||||
$ext eq ".ts"} {
|
||||
set age [expr [clock seconds] - \
|
||||
[file mtime $file]]
|
||||
set age [expr {[clock seconds] \
|
||||
- [file mtime $file]}]
|
||||
if {$age < 60} {
|
||||
set ret($file) -1
|
||||
set access [lindex \
|
||||
[dict get $ret $file] 1]
|
||||
set ret($file) [list -1 $access]
|
||||
}
|
||||
} else {
|
||||
set ret($file) $size
|
||||
} else {
|
||||
debug "$file = $size,$access"
|
||||
set ret($file) [list $size $access]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$opfile ne "" && $opfile ni $ret} {
|
||||
set ret($opfile) [file size $opfile]
|
||||
}
|
||||
foreach file [dict keys $::ops] {
|
||||
if {![dict exists $ret $file]} {
|
||||
set sz 0
|
||||
if {[file exists $file]} { set sz [file size $file] }
|
||||
set ret($file) [list $sz u]
|
||||
}
|
||||
}
|
||||
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 stream 0
|
||||
set output {}
|
||||
set ops {}
|
||||
set model [system model]
|
||||
set tsr [file rootname [system tsr]]
|
||||
set tsrcnt 0
|
||||
|
||||
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"
|
||||
}
|
||||
set bnames [lsort [lmap x [array names data] { file tail $x }]]
|
||||
foreach file [array names data] {
|
||||
set bname [file rootname [file tail $file]]
|
||||
set bname [file tail $file]
|
||||
|
||||
if {$file eq $opfile} {
|
||||
set mode $op
|
||||
} elseif {$data($file) == -1} {
|
||||
regexp {(^/(mnt/hd2/My Video|media/drive[1-9]+/Video)/)?(.*)(\.ts)?$}\
|
||||
$file _ _ _ name
|
||||
|
||||
if {[lindex $data($file) 0] == -1} {
|
||||
set mode chase
|
||||
} elseif {$rr} {
|
||||
if {$file in $recs} {
|
||||
set mode rec
|
||||
} elseif {[llength [\
|
||||
lsearch -all $bnames $bname]] == 2} {
|
||||
# two different files having same file.ext open
|
||||
set mode copy
|
||||
} else {
|
||||
set mode play
|
||||
}
|
||||
} else {
|
||||
if {![dict exists $ndata $file]} continue
|
||||
if {$ndata($file) > $data($file)} {
|
||||
if {[lindex $ndata($file) 0] > \
|
||||
[lindex $data($file) 0]} {
|
||||
set mode rec
|
||||
} else {
|
||||
set mode play
|
||||
}
|
||||
}
|
||||
|
||||
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 _ mode
|
||||
|
||||
switch $mode {
|
||||
chase {
|
||||
incr rec
|
||||
@@ -158,52 +262,32 @@ if {[llength $data]} {
|
||||
}
|
||||
play {
|
||||
incr play
|
||||
set mode "Playing"
|
||||
set icon "745_1_10_Video_2Live.png"
|
||||
if {$play > $stream} {
|
||||
set mode "Playing"
|
||||
set icon "745_1_10_Video_2Live.png"
|
||||
} else {
|
||||
set mode "Streaming"
|
||||
set icon "/img/dlna.png"
|
||||
}
|
||||
}
|
||||
dec {
|
||||
set mode "Decrypting"
|
||||
set icon "/img/decrypt.png "
|
||||
append icon "style=\"padding: 0 0.2em 0 0.5em\""
|
||||
copy {
|
||||
if {[lindex $data($file) 1] ne "r"} {
|
||||
continue
|
||||
}
|
||||
set mode "Copying"
|
||||
set icon "/img/dlna.png"
|
||||
}
|
||||
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 +297,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
|
||||
@@ -231,21 +315,33 @@ if {![system instandby] && $play < 1} {
|
||||
if {[llength $epgs] == 1} {
|
||||
lassign $epgs epg
|
||||
set prog "- [$epg get name] ("
|
||||
append prog "[clock format [$epg get start] -format %H:%M] - "
|
||||
append prog "[clock format $([$epg get start] + [$epg get duration]) -format %H:%M]"
|
||||
append prog "[clock format [\
|
||||
$epg get start] -format %H:%M] - "
|
||||
append prog "[clock format $([$epg get start] \
|
||||
+ [$epg get duration]) -format %H:%M]"
|
||||
append prog ") \[[$epg percent]%\]"
|
||||
}
|
||||
|
||||
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" \
|
||||
]
|
||||
# 0 => no TSR; >=2 => TSR
|
||||
if {$tsrcnt == 0 || $tsrcnt == 2} {
|
||||
set s "Watching"
|
||||
} elseif {$tsrcnt == 3} {
|
||||
set s "Watching (delayed)"
|
||||
} else {
|
||||
lappend output "Watching $lcn: $name $prog"
|
||||
debug "tsrcnt=$tsrcnt"
|
||||
set s "Not watching"
|
||||
}
|
||||
if {$runmode eq "cgi"} {
|
||||
lappend output [format "
|
||||
<span class=\"va stitem\">
|
||||
[epg channelicon %s 30 \
|
||||
{vertical-align: middle; padding: 0 4px 0 2px}]
|
||||
<span>%s <i>%s: %s %s</i></span>
|
||||
</span>
|
||||
" $name $s $lcn $name $prog]
|
||||
} else {
|
||||
lappend output [format "%s %s: %s %s" \
|
||||
$s $lcn $name $prog]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +367,7 @@ if {[system instandby]} {
|
||||
# Upcoming recordings
|
||||
|
||||
set events [rsv list tbl_reservation \
|
||||
" where ersvtype = 3 and nsttime - [clock seconds] < $schedtime
|
||||
" where ersvtype = 3 and nsttime - [clock seconds] < $schedtime
|
||||
and nsttime > [clock seconds] "]
|
||||
foreach event $events {
|
||||
if {$runmode eq "cgi"} {
|
||||
@@ -284,6 +380,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 +390,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
|
||||
}
|
||||
}
|
||||
|
||||
60
webif/cgi-bin/usbinfo.jim
Executable file
60
webif/cgi-bin/usbinfo.jim
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/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 ""
|
||||
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,53 +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 {
|
||||
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>
|
||||
}
|
||||
|
||||
@@ -109,6 +103,8 @@ if {[llength $plugins(dmenu)]} {
|
||||
}
|
||||
}
|
||||
|
||||
# the maxlength values for title and synopsis are 1 less than the maximum to
|
||||
# allow for an extra byte to indicate character encoding (see rename.jim)
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
@@ -137,20 +133,51 @@ puts {
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename_title" id="rename_title"
|
||||
value="" size=70 maxlength=48
|
||||
value="" size=70 maxlength=47
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="rename_seriesnum" style="padding-top: 0.5em">
|
||||
<b>New Series Number</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<span title="Series number">
|
||||
<input type=number name="rename_seriesnum" id="rename_seriesnum"
|
||||
value=0 max=255
|
||||
class="uint8_t ui-widget-content ui-corner-all">
|
||||
</span>
|
||||
<label for="rename_episodenum" style="padding-top: 0.5em">
|
||||
<b>Episode</b>
|
||||
</label>
|
||||
<span title="Episode number">
|
||||
<input type=number name="rename_episodenum"
|
||||
id="rename_episodenum" value=0 max=255
|
||||
class="uint8_t ui-widget-content ui-corner-all">
|
||||
</span>
|
||||
<label for="rename_episodetot" style="padding-top: 0.5em">
|
||||
<b>of</b>
|
||||
</label>
|
||||
<span title="Episode total">
|
||||
<input type=number name="rename_episodetot"
|
||||
id="rename_episodetot" value=0 max=255
|
||||
class="uint8_t ui-widget-content ui-corner-all">
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="rename_synopsis" style="padding-top: 0.5em">
|
||||
<b>New Synopsis</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<td colspan=3>
|
||||
<textarea name="rename_synopsis" id="rename_synopsis"
|
||||
value="" cols=70 rows=4
|
||||
value="" cols=70 rows=4 maxlength=251
|
||||
class="text ui-widget-content ui-corner-all"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -180,9 +207,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 +256,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 +275,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 +371,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 +397,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,25 +18,12 @@ 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"
|
||||
set token [system startop -multiple mp3 $rfile]
|
||||
puts [$ts mkmp3 $slow]
|
||||
system endop $token
|
||||
|
||||
#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 xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
set xtime [expr {[expr {[clock milliseconds] - $xstart}] / 1000.0}]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ if {![file exists "${bfile}.mp3"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [expr [file size "${bfile}.mp3"] / 0.3]
|
||||
set nsz [expr {[file size "${bfile}.mp3"] / 0.3}]
|
||||
|
||||
set perc [expr $nsz * 100 / $sz]
|
||||
set perc [expr {$nsz * 100 / $sz}]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size
|
||||
require ts.class system.class pretty_size
|
||||
|
||||
jscss script.js style.css
|
||||
jqplugin touchpunch
|
||||
@@ -15,9 +15,12 @@ set erfile [string map {' \\'} $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
|
||||
set start -1
|
||||
set incr 1
|
||||
set limit $(1-$start)
|
||||
|
||||
puts "
|
||||
<script type=text/javascript>
|
||||
var initbookmarks = '[$ts bookmarks]';
|
||||
var len = [$ts duration 1];
|
||||
var file = '$erfile';
|
||||
var dir = '$dir';
|
||||
@@ -25,25 +28,61 @@ var dir = '$dir';
|
||||
<fieldset class=cleft>
|
||||
<legend>Manage Bookmarks</legend>
|
||||
|
||||
<table class=keyval cellpadding=5>
|
||||
<table class=keyval>
|
||||
<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<br><span class=footnote>(enter in seconds)</span></th><td>
|
||||
<input id=bookmarks size=80 maxlength=255 init=\"[$ts bookmarks]\"
|
||||
value=\"\" />
|
||||
<input id=bookmarks size=80 maxlength=255 value=\"[$ts bookmarks]\" />
|
||||
<button id=update>Update</button>
|
||||
<br>
|
||||
<span id=bookmarkstime></span>
|
||||
</td></tr><tr><td align=right>
|
||||
</td></tr><tr><td class=cell-align-right>
|
||||
<button class=left id=addbmark>Add Bookmark</button>
|
||||
<button class=left id=delbmark>Remove Bookmark</button>
|
||||
</td><td><div id=slider></div></td></tr>
|
||||
<tr><td class=cell-align-right>
|
||||
<span class=left>Current: <span id=curbmk></span></span><br><br><br>
|
||||
"
|
||||
if {![$ts flag "ODEncrypted"]} {
|
||||
puts "
|
||||
<button id=genthumbs title=\"Generate Thumbnails\"
|
||||
class=left>Generate Thumbnails</button>
|
||||
"
|
||||
}
|
||||
puts "
|
||||
</td><td>
|
||||
<div id=thumbs class=hidden>
|
||||
<table><tr>
|
||||
"
|
||||
set times {}
|
||||
loop v $start $limit $incr {
|
||||
lappend times $v
|
||||
puts "
|
||||
<th class=mark><span class=mark>
|
||||
[format "%+d" $v]</span>s</th>
|
||||
"
|
||||
}
|
||||
puts "</tr><tr>"
|
||||
foreach v $times {
|
||||
puts "<td><img class=bmp data-pos=$v alt=\"thumbnail @ $v s\"></td>"
|
||||
}
|
||||
puts "
|
||||
</tr></table>
|
||||
</div></td></tr>
|
||||
</table>
|
||||
<div id=buttons>
|
||||
<button id=save>Save Bookmarks</button>
|
||||
<button id=back>Back to Media Browser</button>
|
||||
"
|
||||
if {[system pkginst nicesplice]} {
|
||||
puts "<button id=crop>Go to Crop</button>"
|
||||
}
|
||||
puts "
|
||||
</div>
|
||||
<div id=results class=\"hidden blood\"></div>
|
||||
</fieldset>
|
||||
"
|
||||
|
||||
footer
|
||||
|
||||
|
||||
@@ -1,132 +1,225 @@
|
||||
var curval = 0;
|
||||
var $slider;
|
||||
|
||||
/* using var len defined in inline script, index.jim */
|
||||
/* using var file defined in inline script, index.jim */
|
||||
/* using var dir defined in inline script, index.jim */
|
||||
function
|
||||
setvals()
|
||||
toTimeStr(tval)
|
||||
{
|
||||
values = $.trim($('#bookmarks').val()).split(/ +/);
|
||||
if (!values.length || values[0] == '')
|
||||
{
|
||||
refreshtimes();
|
||||
return;
|
||||
}
|
||||
nvalues = [];
|
||||
$.each(values, function(k, v) {
|
||||
if (v > len)
|
||||
v = len;
|
||||
if (v < 0)
|
||||
v = 0;
|
||||
nvalues.push(v);
|
||||
});
|
||||
values = nvalues;
|
||||
$('#bookmarks').val(values.join(' '));
|
||||
sortmarks();
|
||||
refreshtimes();
|
||||
return new Date(null, null, null, null, null, tval)
|
||||
.toTimeString().match(/\d{2}:\d{2}:\d{2}/)[0];
|
||||
}
|
||||
|
||||
function
|
||||
draw_slider()
|
||||
valarray(valstr)
|
||||
{
|
||||
if ($slider)
|
||||
$slider.slider('destroy');
|
||||
else
|
||||
$slider = $('#slider');
|
||||
setvals();
|
||||
values = $.trim($('#bookmarks').val()).split(/ +/);
|
||||
if (!values.length || values[0] == '')
|
||||
{
|
||||
$slider = null;
|
||||
return;
|
||||
}
|
||||
$slider.slider({
|
||||
min: 0,
|
||||
max: len,
|
||||
step: 1,
|
||||
values: values,
|
||||
start: function(event, ui) {
|
||||
curval = ui.value;
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
curval = ui.value;
|
||||
sortmarks();
|
||||
refreshtimes();
|
||||
},
|
||||
slide: function(event, ui) {
|
||||
var marks = '';
|
||||
for (var i = 0; i < ui.values.length; ++i)
|
||||
marks += ui.values[i] + ' ';
|
||||
$('#bookmarks').val($.trim(marks));
|
||||
setvals();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function
|
||||
refreshtimes()
|
||||
{
|
||||
var t = '';
|
||||
values = $.trim($('#bookmarks').val()).split(/ +/);
|
||||
if (!values.length || values[0] == '')
|
||||
{
|
||||
$('#bookmarkstime').text(t);
|
||||
return;
|
||||
}
|
||||
$.each(values, function(k, v) {
|
||||
t += new Date(null, null, null, null, null, v)
|
||||
.toTimeString().match(/\d{2}:\d{2}:\d{2}/)[0] + ' ';
|
||||
});
|
||||
$('#bookmarkstime').text(t);
|
||||
}
|
||||
|
||||
function
|
||||
sortmarks()
|
||||
{
|
||||
var a = $.trim($('#bookmarks').val()).split(/ +/);
|
||||
a.sort(function(a, b){return a-b});
|
||||
$('#bookmarks').val(a.join(" "));
|
||||
return valstr.trim().split(/\s+/);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var curval = 0;
|
||||
var $slider;
|
||||
var values;
|
||||
|
||||
$('#bookmarks').val($('#bookmarks').attr('init'));
|
||||
draw_slider();
|
||||
function
|
||||
sortmarks()
|
||||
{
|
||||
values.sort(function(a, b){return a - b});
|
||||
$('#bookmarks').val(values.join(" "));
|
||||
}
|
||||
|
||||
function
|
||||
refreshtimes()
|
||||
{
|
||||
var t = '';
|
||||
if (values.length > 0 && values[0] != '')
|
||||
{
|
||||
$.each(values, function(k, v) {
|
||||
if (t != '') t += ', ';
|
||||
t += toTimeStr(v);
|
||||
});
|
||||
$('#slider .ui-slider-handle').each(function(i) {
|
||||
if (values[i]|0 > 0)
|
||||
$(this).attr('title', toTimeStr(values[i]))
|
||||
else $(this).attr('title', '');
|
||||
});
|
||||
$('#curbmk').html(toTimeStr(curval));
|
||||
$('#genthumbs').button('enable');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#genthumbs').button('disable');
|
||||
$('#curbmk').html('');
|
||||
}
|
||||
$('#bookmarkstime').text(t);
|
||||
}
|
||||
|
||||
function
|
||||
setvals()
|
||||
{
|
||||
var nvalues;
|
||||
values = valarray($('#bookmarks').val());
|
||||
nvalues = new Set();
|
||||
$.each(values, function(k, v) {
|
||||
if (v > len)
|
||||
v = len;
|
||||
if (v < 0)
|
||||
v = 0;
|
||||
nvalues.add(v);
|
||||
});
|
||||
values = Array.from(nvalues);
|
||||
sortmarks();
|
||||
}
|
||||
|
||||
function
|
||||
regenthumbs(curbmkstr)
|
||||
{
|
||||
$('#curbmk').html(curbmkstr);
|
||||
$('#thumbs').hide();
|
||||
$('#genthumbs')
|
||||
.button(curbmkstr ? 'enable': 'disable')
|
||||
.button('option', 'icon', 'ui-icon-zoomin');
|
||||
}
|
||||
|
||||
function
|
||||
draw_slider()
|
||||
{
|
||||
if ($slider)
|
||||
$slider.slider('destroy');
|
||||
else
|
||||
$slider = $('#slider');
|
||||
setvals();
|
||||
$slider.slider({
|
||||
min: 0,
|
||||
max: len,
|
||||
step: 1,
|
||||
disabled: values.length <= 0 || values[0] == '',
|
||||
values: values,
|
||||
start: function(event, ui) {
|
||||
curval = ui.value;
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
curval = ui.value;
|
||||
sortmarks();
|
||||
refreshtimes();
|
||||
},
|
||||
slide: function(event, ui) {
|
||||
var marks = '';
|
||||
for (var i = 0; i < ui.values.length; ++i)
|
||||
marks += ui.values[i] + ' ';
|
||||
$('#bookmarks').val(marks.trim());
|
||||
setvals();
|
||||
}
|
||||
});
|
||||
refreshtimes();
|
||||
|
||||
/* slider values are strings */
|
||||
var curvalstr = "" + curval;
|
||||
if (!values.includes(curvalstr)) {
|
||||
/* try to map current selected bmk to new bmk */
|
||||
var ovalues = $slider.slider("option", "values");
|
||||
var nn = ovalues.indexOf(curvalstr);
|
||||
if (nn < 0) {
|
||||
curval = 0;
|
||||
regenthumbs('');
|
||||
} else {
|
||||
if (nn >= values.length)
|
||||
nn = values.length - 1;
|
||||
if (nn >= 0) {
|
||||
regenthumbs(toTimeStr(curval = values[nn]));
|
||||
} else {
|
||||
curval = 0;
|
||||
regenthumbs('');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$('#genthumbs').button({icons: {primary: "ui-icon-zoomin"}, disabled: true})
|
||||
.on('click', function() {
|
||||
var start;
|
||||
var incr = -1;
|
||||
var last;
|
||||
$(this)
|
||||
.button('disable')
|
||||
.button('option', 'icon', 'ui-icon-refresh');
|
||||
$('img.bmp').each(function(i) {
|
||||
if (start === undefined) {
|
||||
start = $(this).attr('data-pos') | 0;
|
||||
} else {
|
||||
last = $(this).attr('data-pos') | 0;
|
||||
}
|
||||
incr++;
|
||||
$(this).attr('src', '/img/generating.png');
|
||||
});
|
||||
$('#thumbs').show();
|
||||
|
||||
incr = (last - start) / incr;
|
||||
|
||||
$.get('/browse/thumbnail/mkrange.jim', {
|
||||
'file': file,
|
||||
's': start+curval,
|
||||
'e': last+curval,
|
||||
'i': incr
|
||||
}, function() {
|
||||
$('img.bmp').each(function(i) {
|
||||
/* cast to "int" */
|
||||
var pos = $(this).attr('data-pos')|0;
|
||||
$(this).attr('src',
|
||||
'/browse/thumbnail/fetch.jim?' +
|
||||
'file=' + encodeURIComponent(file) +
|
||||
'&pos=' + (curval+pos).toFixed(1));
|
||||
});
|
||||
$('#genthumbs').button('option', 'icon', 'ui-icon-zoomin');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#addbmark').button({icons: {primary: "ui-icon-plus"}, text: false})
|
||||
.on('click', function() {
|
||||
$('#bookmarks').val('0 ' + $('#bookmarks').val());
|
||||
draw_slider();
|
||||
});
|
||||
|
||||
$('#delbmark').button({icons: {primary: "ui-icon-minus"}, text: false})
|
||||
.on('click', function() {
|
||||
var cur = $('#bookmarks').val();
|
||||
cur = $.trim(cur.replace(
|
||||
new RegExp('(^| )' + curval + '( |$)', ''), ' '));
|
||||
$('#bookmarks').val(cur);
|
||||
draw_slider();
|
||||
});
|
||||
$('#addbmark').button({icons: {primary: "ui-icon-plus"}, text: false})
|
||||
.on('click', function() {
|
||||
$('#bookmarks').val('0 ' + $('#bookmarks').val());
|
||||
curval = 0;
|
||||
draw_slider();
|
||||
});
|
||||
|
||||
$('#save').button({icons: {primary: "ui-icon-disk"}})
|
||||
.on('click', function() {
|
||||
$.post('save.jim', {
|
||||
file: file,
|
||||
bookmarks: $('#bookmarks').val()
|
||||
}, function(data) {
|
||||
$('#results').html(data)
|
||||
.slideDown('slow').delay(5000).slideUp('slow');
|
||||
$('#delbmark').button({icons: {primary: "ui-icon-minus"}, text: false})
|
||||
.on('click', function() {
|
||||
var cur = $('#bookmarks').val();
|
||||
cur = cur.replace(
|
||||
new RegExp('(^| )' + curval + '( |$)', ''), ' ').trim();
|
||||
$('#bookmarks').val(cur);
|
||||
draw_slider();
|
||||
});
|
||||
|
||||
$('#save').button({icons: {primary: "ui-icon-disk"}})
|
||||
.on('click', function() {
|
||||
$.post('save.jim', {
|
||||
file: file,
|
||||
bookmarks: $('#bookmarks').val()
|
||||
}, function(data) {
|
||||
$('#results').html(data)
|
||||
.slideDown('slow').delay(5000).slideUp('slow');
|
||||
});
|
||||
});
|
||||
|
||||
$('#back').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"}})
|
||||
.on('click', function() {
|
||||
window.location = '/go/browse?dir=' + encodeURIComponent(dir);
|
||||
});
|
||||
|
||||
$('#crop').button({icons: {primary: "ui-icon-arrowreturnthick-1-e"}})
|
||||
.on('click', function() {
|
||||
window.location =
|
||||
window.location.href.replace('/bookmarks/?','/crop/crop.jim?');
|
||||
});
|
||||
|
||||
$('#update').button()
|
||||
.on('click', draw_slider);
|
||||
|
||||
$('#slider')
|
||||
.on('slidechange', function(evt, ui) {
|
||||
var tstr = toTimeStr(curval);
|
||||
if (tstr != $('#curbmk').html())
|
||||
regenthumbs(tstr);
|
||||
});
|
||||
});
|
||||
|
||||
$('#back').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"}})
|
||||
.on('click', function() {
|
||||
window.location = '../index.jim?dir=' + dir;
|
||||
});
|
||||
|
||||
$('#update').button()
|
||||
.on('click', function() {
|
||||
draw_slider();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -14,3 +14,20 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* <table class=keyval ... cellpadding=5> */
|
||||
.keyval th, .keyval td
|
||||
{
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* <td align=right> */
|
||||
.cell-align-right
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* <th style="text-align: center"> */
|
||||
th.mark
|
||||
{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -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"} {
|
||||
@@ -80,6 +82,7 @@ switch $action {
|
||||
set path [$item get path]
|
||||
set file [file tail $path]
|
||||
set mode [$item get action]
|
||||
set fileonly 0
|
||||
|
||||
puts "Pasting $file"
|
||||
|
||||
@@ -103,8 +106,13 @@ switch $action {
|
||||
"$dir/[file tail $f]"}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
set fileonly 1
|
||||
}
|
||||
} else {
|
||||
set fileonly 1
|
||||
}
|
||||
if {$fileonly} {
|
||||
if {$mode eq "cut"} {
|
||||
catch {file rename $path \
|
||||
"$dir/[file tail $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]
|
||||
@@ -14,6 +14,7 @@ set ts [ts fetch $rfile]
|
||||
set dir [file dirname $rfile]
|
||||
|
||||
set len [$ts duration 1]
|
||||
set planwidth 500
|
||||
|
||||
puts "
|
||||
<fieldset>
|
||||
@@ -23,18 +24,23 @@ 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>"
|
||||
# set minimum width as positioned contents doesn't resize its cell
|
||||
puts "</td></tr><tr><th> </th><td id=cutplan style=\"min-width: ${planwidth}px\">"
|
||||
|
||||
puts "<div style=\"position: relative; top: -10px\">"
|
||||
|
||||
proc div {type left right} {
|
||||
set width $($right - $left)
|
||||
if {$width < 0} {
|
||||
# negative values are invalid for CSS width
|
||||
set width 0
|
||||
}
|
||||
puts "<div class=$type style=\"left: ${left}px; width: ${width}px\">
|
||||
$type</div>"
|
||||
}
|
||||
@@ -48,17 +54,24 @@ 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)
|
||||
set left $($start * $planwidth / $len)
|
||||
set right $($end * $planwidth / $len)
|
||||
|
||||
div cut $last $($left - 1)
|
||||
div keep $left $($right - 1)
|
||||
@@ -69,12 +82,17 @@ foreach b $bookmarks {
|
||||
}
|
||||
|
||||
if {$start > 0} {
|
||||
# Still in a keep section...
|
||||
incr keeping $($len - $start)
|
||||
set left $($start * 500 / $len)
|
||||
set left $($start * $planwidth / $len)
|
||||
div cut $last $($left - 1)
|
||||
div keep $left 500
|
||||
div keep $left $planwidth
|
||||
} else {
|
||||
div cut $last 500
|
||||
div cut $last $planwidth
|
||||
}
|
||||
|
||||
if {$cur > $keeping - 8 && $keeping - 8 > 0} {
|
||||
set newbookmarks [lreplace $newbookmarks end end $($keeping - 8)]
|
||||
}
|
||||
|
||||
set keepperc $($keeping * 100.0 / $len)
|
||||
@@ -86,30 +104,53 @@ puts "
|
||||
</td></tr>
|
||||
<tr><th>Keeping:</th><td>
|
||||
[clock format $keeping -format "%T"] ([format "%.2f" $keepperc]%)
|
||||
</td></tr>
|
||||
<tr><th>Time:</th>
|
||||
</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 id=esttime><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>
|
||||
<label id=saveitlabel for=saveit>Save new bookmarks?</label>
|
||||
<input id=saveit type=checkbox name=saveit checked>
|
||||
|
||||
</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>
|
||||
|
||||
"
|
||||
|
||||
|
||||
@@ -2,42 +2,82 @@ var handle = 0;
|
||||
|
||||
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');
|
||||
$('#back').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"}})
|
||||
.on('click', function() {
|
||||
window.location = '/go/browse?dir=' + $('#params').attr('dir');
|
||||
});
|
||||
|
||||
$('#cropit').button().click(function() {
|
||||
$('#cropdiv').hide('slow');
|
||||
$('#progressdiv').show('slow');
|
||||
handle = setInterval("update()", 1000);
|
||||
$('#output').show().text('Please do not interrupt...')
|
||||
.load('execute.jim?file=' + $('#params').attr('file') +
|
||||
'&invert=' + $('#invert').attr('invert'),
|
||||
function() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#back').show();
|
||||
$('#progressbar').reportprogress(100);
|
||||
$('#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());
|
||||
$('#esttime').hide();
|
||||
if ($('#results').html().indexOf(' successful') < 0) {
|
||||
$('#saveit').hide();
|
||||
$('#saveitlabel').hide();
|
||||
$('#save').show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#invert').button().on('click', function() {
|
||||
window.location = 'crop.jim?file=' + $('#params').attr('file') +
|
||||
'&invert=' + ($(this).attr('invert') == '1' ? '0' : '1');
|
||||
$('#cropit').button({icons: {primary: "ui-icon-scissors"}})
|
||||
.on('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() {
|
||||
clearInterval(handle);
|
||||
handle = 0;
|
||||
$('#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({icons: {primary: "ui-icon-shuffle"}})
|
||||
.on('click', function() {
|
||||
window.location = window.location.href.replace(/&invert=[01]/,'') +
|
||||
'&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]
|
||||
@@ -50,7 +50,7 @@ set cmd [list /mod/bin/nicesplice \
|
||||
-out "$dir/$shname"]
|
||||
|
||||
if {$invert} {
|
||||
if {[expr [llength $bookmarks] % 2] != 0} {
|
||||
if {[expr {[llength $bookmarks] % 2}] != 0} {
|
||||
lappend bookmarks [$ts duration 1]
|
||||
}
|
||||
foreach k [array names bookmarks] {
|
||||
@@ -60,22 +60,17 @@ 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.
|
||||
# No longer required - nicesplice now sets this flag.
|
||||
#exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
|
||||
|
||||
set croptime [expr [expr [clock milliseconds] - $cropstart] / 1000.0]
|
||||
set croptime [expr {[expr {[clock milliseconds] - $cropstart}] / 1000.0}]
|
||||
puts "Time taken: $croptime"
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ if {![file exists $newfile]} {
|
||||
set expected $($sz / 100 * $perc)
|
||||
set nsz [file size $newfile]
|
||||
|
||||
set perc [expr $nsz * 100 / $expected]
|
||||
set perc [expr {$nsz * 100 / $expected}]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
18
webif/html/browse/crop/style.css
Normal file
18
webif/html/browse/crop/style.css
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
div.switchlabel
|
||||
{
|
||||
height: 27px;
|
||||
line-height: 27px;
|
||||
}
|
||||
|
||||
div.sliderlabel
|
||||
{
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
#cutplan {
|
||||
/* ensure cut plan segments are aligned left */
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
@@ -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,39 +49,55 @@ 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]
|
||||
set xtime [expr {[expr {[clock milliseconds] - $xstart}] / 1000.0}]
|
||||
puts "Time taken: $xtime"
|
||||
|
||||
|
||||
@@ -7,14 +7,21 @@ 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]
|
||||
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>"
|
||||
|
||||
@@ -10,7 +10,7 @@ set urlbase [cgi_get base ""]
|
||||
|
||||
# Default to just downloading the raw file.
|
||||
set url $file
|
||||
set mime "video/ts"
|
||||
set mime "video/mp2t"
|
||||
|
||||
if {[string match {*.ts} $file]} {
|
||||
if {![catch {set ts [ts fetch $file]}]} {
|
||||
|
||||
@@ -7,7 +7,6 @@ require ts.class
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file]
|
||||
set ts [ts fetch $file]
|
||||
if {[set ts [ts fetch $file]] != 0} {
|
||||
set action enc
|
||||
if {[$ts flag "Encrypted"]} { set action unenc }
|
||||
|
||||
@@ -2,18 +2,22 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class
|
||||
require ts.class json
|
||||
|
||||
httpheader "application/json"
|
||||
|
||||
set file [cgi_get file]
|
||||
if {$file == 0} exit
|
||||
set ts [ts fetch $file]
|
||||
if {$ts == 0} exit
|
||||
|
||||
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 "\"seriesnum\" : [jescape [$ts get seriesnum]],"
|
||||
puts "\"episodenum\" : [jescape [$ts get episodenum]],"
|
||||
puts "\"episodetot\" : [jescape [$ts get episodetot]]"
|
||||
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
|
||||
|
||||
@@ -13,10 +13,20 @@ if {$file == 0} exit
|
||||
|
||||
set sz [pretty_size [file size $file]]
|
||||
|
||||
set flags {}
|
||||
set url ""
|
||||
|
||||
# assumption: the type is only ts if fetch has already been checked
|
||||
if {$type eq "ts"} {
|
||||
require epg.class ts.class
|
||||
|
||||
set ts [ts fetch $file]
|
||||
set ts [ts fetch $file 1]
|
||||
|
||||
# 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>
|
||||
@@ -25,20 +35,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 +121,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>"
|
||||
@@ -71,18 +154,25 @@ if {$type eq "ts"} {
|
||||
<td>"
|
||||
puts [clock format [$ts get end] -format "%c %Z"]
|
||||
puts "<font class=also>(Scheduled: [clock format \
|
||||
[expr [$ts get schedstart] + [$ts get scheddur]] \
|
||||
[expr {[$ts get schedstart] + [$ts get scheddur]}] \
|
||||
-format "%c %Z"])</font>"
|
||||
set duration [$ts duration]
|
||||
set durmins $($duration == 1 ? "minute" : "minutes")
|
||||
set resume [$ts get resume]
|
||||
set resmins $($resume == 1 ? "minute" : "minutes")
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[$ts duration] minute(s).
|
||||
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
|
||||
<td>$duration $durmins.
|
||||
<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.
|
||||
[progressbar $([$ts get resume] * 100 / [$ts duration 1])]
|
||||
<td>[expr {$resume / 60}] $resmins into recording.
|
||||
[progressbar $($resume * 100 / [$ts duration 1])]
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
@@ -100,7 +190,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,38 +201,72 @@ 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>[set flags [$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 "<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
|
||||
}
|
||||
}
|
||||
|
||||
# Otherwise, for a general file.
|
||||
|
||||
puts "
|
||||
if {$type ne "ts"} {
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
@@ -149,20 +274,33 @@ puts "
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
</tr><tr>
|
||||
<th>Info</th>
|
||||
<td class=pre id=ffmpeg>
|
||||
<img src=/img/loading.gif><i>Loading...</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
"
|
||||
|
||||
set url "/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
|
||||
puts { <script type="text/javascript"> }
|
||||
puts "var url = \"$url\";"
|
||||
puts {
|
||||
$('#ffmpeg').load(url);
|
||||
</script>
|
||||
</tr>"
|
||||
}
|
||||
|
||||
set hasffmpeg 0
|
||||
if {$type ne "ts" || ("ODEncrypted" ni $flags && $url eq "") } {
|
||||
puts "<tr>
|
||||
<th>Info</th>
|
||||
<td class=pre id=ffmpeg>
|
||||
<img src=/img/spin.gif><i>Loading...</i>
|
||||
</td>
|
||||
</tr>"
|
||||
set hasffmpeg 1
|
||||
} elseif {$type eq "ts" && $url ne ""} {
|
||||
puts [format {
|
||||
<script type="text/javascript">
|
||||
$('#playDL').attr('href','%s').enable();
|
||||
</script> } $url]
|
||||
}
|
||||
puts "
|
||||
</table>
|
||||
"
|
||||
|
||||
if {$hasffmpeg} {
|
||||
set url "/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
|
||||
puts [format {
|
||||
<script type="text/javascript">
|
||||
var url = "%s";
|
||||
$('#ffmpeg').load(url, function() { $('#play, #playDL').enable(); });
|
||||
</script> } $url]
|
||||
}
|
||||
|
||||
@@ -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 .webm}
|
||||
|
||||
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 ""} {
|
||||
@@ -49,20 +58,25 @@ proc icon {img {hover ""} {extra ""} {class "va"}} {
|
||||
puts ">"
|
||||
}
|
||||
|
||||
proc nbsp {str} {
|
||||
return [string map {" " } $str]
|
||||
}
|
||||
|
||||
proc directory {file bfile tbfile} {
|
||||
puts "<div class=\"va relative\">"
|
||||
set img "/images/711_1_09_Media_Folder.png"
|
||||
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]\">"
|
||||
puts "$bfile</a><span class=filesize id=\"$tbfile\">
|
||||
file=\"[cgi_quote_html $file]\">"
|
||||
puts "[nbsp $bfile]</a><span class=filesize id=\"ID$tbfile\">
|
||||
</span>"
|
||||
|
||||
lassign [{dir iconset} $file] icons attrs
|
||||
lassign [dir iconset $file] icons attrs
|
||||
|
||||
puts "<span class=iconset>"
|
||||
puts [join $icons ""]
|
||||
@@ -94,15 +108,14 @@ 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
|
||||
directory $file $bfile [b64uencode [jsescape $bfile]]
|
||||
return
|
||||
}
|
||||
set ext [string tolower [file extension $file]]
|
||||
@@ -114,14 +127,29 @@ 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 {[$ts get definition] eq ""} {
|
||||
set type gen
|
||||
set ts 0
|
||||
set img Video_Other
|
||||
set omenu oopt
|
||||
} else {
|
||||
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,8 +184,8 @@ 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=#>
|
||||
$bfile
|
||||
file=\"[cgi_quote_html $file]\" type=$type href=#>
|
||||
[nbsp $bfile]
|
||||
</a>
|
||||
"
|
||||
|
||||
@@ -166,77 +194,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 +234,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 +243,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 +303,7 @@ if {$parent ne ""} {
|
||||
"
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
proc s_file_stat {a b attr {rev 0}} {
|
||||
global dir
|
||||
|
||||
set a "$dir/$a"
|
||||
@@ -309,18 +321,48 @@ 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 }
|
||||
if {$at < $bt} { return [expr {$rev ? 1 : -1}] }
|
||||
if {$at > $bt} { return [expr {$rev ? -1 : 1}] }
|
||||
return 0
|
||||
}
|
||||
|
||||
proc s_time {a b} {
|
||||
tailcall s_file_stat $a $b mtime
|
||||
}
|
||||
|
||||
proc s_time_r {a b} {
|
||||
tailcall s_file_stat $a $b mtime 1
|
||||
}
|
||||
|
||||
proc s_size {a b} {
|
||||
tailcall s_file_stat $a $b size
|
||||
}
|
||||
|
||||
proc s_size_r {a b} {
|
||||
tailcall s_file_stat $a $b size 1
|
||||
}
|
||||
|
||||
proc s_ext {a b} {
|
||||
set at [file extension $a]
|
||||
set bt [file extension $b]
|
||||
if {$at == $bt} {
|
||||
return [string compare -nocase $a $b]
|
||||
} else {
|
||||
return [string compare -nocase $at $bt]
|
||||
}
|
||||
}
|
||||
|
||||
set files [readdir -nocomplain $dir]
|
||||
switch $order {
|
||||
1 { set files [lsort -command s_time $files] }
|
||||
2 { set files [lsort -command s_time_r $files] }
|
||||
3 { set files [lsort -command s_size $files] }
|
||||
4 { set files [lsort -command s_size_r $files] }
|
||||
5 { set files [lsort -command s_ext $files] }
|
||||
default { set files [lsort -nocase $files] }
|
||||
}
|
||||
|
||||
@@ -328,29 +370,38 @@ set dinuse [system dirinuse $dir]
|
||||
foreach file $files { entry "$dir/$file" }
|
||||
|
||||
puts "
|
||||
<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>
|
||||
|
||||
Directories: $dircount, Files: $filecount
|
||||
Select: <a href=# id=selectall>All</a> | <a href=# id=deselectall>None</a>
|
||||
Folders: $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}}
|
||||
{5 sort_type Type {Type 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 +413,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 +432,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,11 +21,13 @@ 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
|
||||
|
||||
set jointime [expr [expr [clock milliseconds] - $joinstart] / 1000.0]
|
||||
set jointime [expr {[expr {[clock milliseconds] - $joinstart}] / 1000.0}]
|
||||
puts "Time taken: $jointime"
|
||||
|
||||
|
||||
@@ -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,14 +6,17 @@ 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"
|
||||
} else {
|
||||
set sz [file size $file]
|
||||
|
||||
set perc [expr $sz * 100 / $expected]
|
||||
set perc [expr {$sz * 100 / $expected}]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ require ts.class
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file ""]
|
||||
set ts [ts fetch $file]
|
||||
if {[set ts [ts fetch $file]] != 0} {
|
||||
set action lock
|
||||
if {[$ts flag "Locked"]} { set action unlock }
|
||||
|
||||
@@ -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 -nocomplain $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,15 +14,10 @@ set len [$ts duration 1]
|
||||
|
||||
set xstart [clock milliseconds]
|
||||
|
||||
set base [file rootname $rfile]
|
||||
set shname [file tail $base]
|
||||
puts "Processing $shname"
|
||||
set token [system startop -multiple mpg $rfile]
|
||||
$ts mkmpg
|
||||
system endop $token
|
||||
|
||||
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
|
||||
-i $rfile \
|
||||
-map 0:0 -map 0:1 \
|
||||
-vcodec copy -acodec copy "${base}.mpg"]
|
||||
|
||||
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
|
||||
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() {
|
||||
|
||||
@@ -14,9 +14,9 @@ if {![file exists "${bfile}.mpg"]} {
|
||||
puts "0"
|
||||
} else {
|
||||
set sz [file size $rfile]
|
||||
set nsz [expr [file size "${bfile}.mpg"] / 0.75]
|
||||
set nsz [expr {[file size "${bfile}.mpg"] / 0.75}]
|
||||
|
||||
set perc [expr $nsz * 100 / $sz]
|
||||
set perc [expr {$nsz * 100 / $sz}]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ require ts.class
|
||||
httpheader
|
||||
|
||||
set file [cgi_get file]
|
||||
set ts [ts fetch $file]
|
||||
if {[set ts [ts fetch $file]] != 0} {
|
||||
set action new
|
||||
if {[$ts flag "New"]} { set action watched }
|
||||
|
||||
@@ -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,"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
62
webif/html/browse/play.jim
Executable file
62
webif/html/browse/play.jim
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require system.class
|
||||
require ts.class
|
||||
|
||||
set file [cgi_get file]
|
||||
set urlbase [cgi_get base ""]
|
||||
set duration [cgi_get duration 1]
|
||||
set fmts [split [cgi_get fmts ""] ","]
|
||||
set vc [cgi_get vc ""]
|
||||
|
||||
# Default to just downloading the raw file.
|
||||
set url $file
|
||||
|
||||
# Prefer to use DLNA server ... (necessary if encrypted)
|
||||
set dlna [system dlnaurl [file normalize $url] $urlbase]
|
||||
if {[llength $dlna]} {
|
||||
set url [lindex $dlna 0]
|
||||
} elseif {[regexp {^(https?://(.+:.*@)?[[:alnum:].]+(:[[:digit:]]+)?)/} $urlbase x y]} {
|
||||
set url "$y$url"
|
||||
} else {
|
||||
set url "http://[system ip]$url"
|
||||
}
|
||||
|
||||
if {[file extension $file] in {.ts .TS}} {
|
||||
if {![catch {set ts [ts fetch $file]}] && $ts != 0} {
|
||||
set duration [$ts duration 1]
|
||||
}
|
||||
}
|
||||
|
||||
set file [file tail $file]
|
||||
set playlist [file tempfile "[env "TMPDIR" [env "TMP" "/tmp"]]/playXXXXXX"]
|
||||
set pl ""
|
||||
try {
|
||||
set pl [open $playlist w]
|
||||
$pl puts "#EXTM3U"
|
||||
$pl puts "#EXTINF:$duration,$file"
|
||||
$pl puts "#PLAYLIST:$file"
|
||||
$pl puts $url
|
||||
} finally {
|
||||
if {$pl ne ""} {
|
||||
$pl close
|
||||
}
|
||||
}
|
||||
|
||||
httpheader "application/x-mpegurl" 0 [list \
|
||||
"Content-Disposition" "attachment; filename=\"[file rootname $file].m3u\"" \
|
||||
"Content-Length" "[file size $playlist]" \
|
||||
]
|
||||
set pl ""
|
||||
try {
|
||||
set pl [open $playlist r]
|
||||
$pl copyto stdout
|
||||
} finally {
|
||||
if {$pl ne ""} {
|
||||
$pl close
|
||||
}
|
||||
}
|
||||
catch {file delete $playlist}
|
||||
|
||||
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,18 +23,60 @@ 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 {$attr eq "genre"} {
|
||||
set new [ts genre $new]
|
||||
}
|
||||
if {$new ne $old} {
|
||||
if {$attr eq "guidance" ||
|
||||
[string length $new] > 0} {
|
||||
if {$attr eq "guidance" || $new ne ""} {
|
||||
$ts set$attr $new
|
||||
}
|
||||
}
|
||||
} msg]} {
|
||||
puts "$attr: $msg"
|
||||
stderr puts "$attr: $msg"
|
||||
}
|
||||
}
|
||||
# deal with series number/ep num/ep total, which get set together
|
||||
# list the old values seen in case a later one is changed
|
||||
set epdataold {}
|
||||
# list values to be set, or {}
|
||||
set epdatanew {}
|
||||
foreach attr {seriesnum episodenum episodetot} {
|
||||
if {[catch {
|
||||
set new [string map {"\n" ""} [
|
||||
string trim [cgi_get "rename_$attr"]]]
|
||||
set old [$ts get $attr]
|
||||
if {$new ne $old} {
|
||||
switch $attr {
|
||||
seriesnum {
|
||||
set epdatanew [list $new]
|
||||
}
|
||||
episodenum -
|
||||
episodetot {
|
||||
if {$epdatanew eq {}} {
|
||||
set epdatanew $epdataold
|
||||
}
|
||||
lappend epdatanew $new
|
||||
}
|
||||
}
|
||||
} elseif {$epdatanew eq {}} {
|
||||
# nothing to be changed yet
|
||||
lappend epdataold $old
|
||||
} else {
|
||||
# fill to-be-set list with old value
|
||||
lappend epdatanew $old
|
||||
}
|
||||
} msg]} {
|
||||
stderr puts "$attr: $msg"
|
||||
}
|
||||
}
|
||||
if {$epdatanew ne {}} {
|
||||
if {[catch {$ts storeepisode $epdatanew} msg]} {
|
||||
puts "ts::storeepisode: $msg"
|
||||
}
|
||||
}
|
||||
|
||||
if {"$dir/$newfile.ts" ne "$file"} { ts renamegroup $file $newfile }
|
||||
} else {
|
||||
|
||||
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,39 +2,53 @@
|
||||
|
||||
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/"]
|
||||
|
||||
#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"] {
|
||||
if {[catch {exec /mod/bin/busybox/du -h -l -d 1 "$dir/"} dutxt]} {
|
||||
set dutxt ""
|
||||
}
|
||||
foreach line [split $dutxt "\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.
|
||||
foreach file [readdir $dir] {
|
||||
foreach file [readdir -nocomplain $dir] {
|
||||
set file "$dir/$file"
|
||||
if {[catch {set lk [file readlink $file]}]} continue
|
||||
|
||||
if {![string match "/*" $lk]} { set lk "$dir/$lk" }
|
||||
|
||||
if {![file isdirectory $lk]} continue
|
||||
foreach line [split [exec /mod/bin/busybox/du -h "$lk"] "\n"] {
|
||||
if {[catch {exec /mod/bin/busybox/du -h "$lk"} dutxt]} {
|
||||
set dutxt ""
|
||||
}
|
||||
foreach line [split $dutxt "\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\" : \"\""
|
||||
if {[catch {exec /mod/bin/busybox/du -hs "$dir/"} dutxt]} {
|
||||
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"
|
||||
@@ -50,6 +51,6 @@ ts renamegroup "$dir/$shname.ts" $newname
|
||||
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
|
||||
exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
|
||||
|
||||
set striptime [expr [expr [clock milliseconds] - $stripstart] / 1000.0]
|
||||
set striptime [expr {[expr {[clock milliseconds] - $stripstart}] / 1000.0}]
|
||||
puts "Time taken: $striptime"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ if {![file exists $ntsfile]} {
|
||||
set sz [file size $origfile]
|
||||
set nsz [file size $ntsfile]
|
||||
|
||||
set perc [expr $nsz * 100 / $sz]
|
||||
set perc [expr {$nsz * 100 / $sz}]
|
||||
if {$perc > 100} { set perc 100 }
|
||||
puts $perc
|
||||
}
|
||||
|
||||
@@ -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,32 @@ 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;
|
||||
}
|
||||
|
||||
input.uint8_t
|
||||
{
|
||||
width: 6ch;
|
||||
}
|
||||
|
||||
/* a link that looks like a button */
|
||||
button + a.ui-button
|
||||
{
|
||||
margin-right: 0.4em;
|
||||
}
|
||||
.ui-button:link
|
||||
{
|
||||
background-color: rgb(254, 206, 47) !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,11 +59,11 @@ puts "<div style=\"width=100%; text-align: center\">
|
||||
<input name=pos id=pos size=5 maxlength=4 value=\"$pos\">
|
||||
second(s) into recording.
|
||||
</form>
|
||||
<button class=mvpos pos=[expr $pos - 30]><< 30 seconds</button>
|
||||
<button class=mvpos pos=[expr $pos - 5]>< 5 seconds</button>
|
||||
<button class=mvpos pos=[expr {$pos - 30}]><< 30 seconds</button>
|
||||
<button class=mvpos pos=[expr {$pos - 5}]>< 5 seconds</button>
|
||||
<button id=repos>Update</button>
|
||||
<button class=mvpos pos=[expr $pos + 5]>> 5 seconds</button>
|
||||
<button class=mvpos pos=[expr $pos + 30]>>> 30 seconds</button>
|
||||
<button class=mvpos pos=[expr {$pos + 5}]>> 5 seconds</button>
|
||||
<button class=mvpos pos=[expr {$pos + 30}]>>> 30 seconds</button>
|
||||
</div>
|
||||
<span id=start class=hidden>$start</span>
|
||||
<span id=end class=hidden>$limit</span>
|
||||
@@ -71,7 +71,7 @@ puts "<div style=\"width=100%; text-align: center\">
|
||||
<tr>
|
||||
"
|
||||
|
||||
for {set i [expr $start + 0.0]} {$i <= $limit} {set i [expr $i + 0.5]} {
|
||||
for {set i [expr {$start + 0.0}]} {$i <= $limit} {set i [expr {$i + 0.5}]} {
|
||||
lappend times $i
|
||||
puts "<th style=\"text-align: center\">
|
||||
@ <span class=mark>$i</span>s</th>"
|
||||
|
||||
@@ -9,11 +9,11 @@ httpheader
|
||||
set rfile [cgi_get file]
|
||||
set s [cgi_get s 0]
|
||||
set e [cgi_get e $($s + 2)]
|
||||
set i [expr [cgi_get i 0.5] + 0.0]
|
||||
set i [expr {[cgi_get i 0.5] + 0.0}]
|
||||
|
||||
if {![catch {set ts [ts fetch $rfile]}]} {
|
||||
$ts cleanbmp
|
||||
for {set n [expr $s + 0.0]} {$n <= $e} {set n [expr $n + $i]} {
|
||||
for {set n [expr {$s + 0.0}]} {$n <= $e} {set n [expr {$n + $i}]} {
|
||||
puts "Generating thumbnail for pos $n"
|
||||
$ts mkbmp $n ".pos$n"
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user