Compare commits
4 Commits
0.6.2@2148
...
0.6.4@2148
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
767021557f | ||
|
|
4f900f47b4 | ||
|
|
8383651367 | ||
|
|
d764969b8f |
@@ -1,10 +1,10 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.6.2
|
||||
Version: 0.6.4
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hummypkg.org.uk
|
||||
Depends: mongoose(>=3.0),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.2),hmt(>=1.0.6),ssmtp
|
||||
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.2),hmt(>=1.0.6),ssmtp
|
||||
Replaces: af123-webif
|
||||
Conflicts: af123-webif
|
||||
Suggests: ffmpeg
|
||||
|
||||
@@ -203,7 +203,8 @@ var menuclick = function(action, el, pos)
|
||||
break;
|
||||
|
||||
case 'download':
|
||||
window.location.href = file;
|
||||
window.location.href = '/cgi-bin/browse/download.jim?file=' +
|
||||
encodeURIComponent(file);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
48
var/mongoose/cgi-bin/browse/download.jim
Executable file
48
var/mongoose/cgi-bin/browse/download.jim
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
package require sqlite3
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require ts.class
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set file [dict get $_cgi file]
|
||||
set rfile [file normalize $file]
|
||||
set ts [ts fetch $file]
|
||||
|
||||
set dmsfile /mnt/hd2/dms_cds.db
|
||||
|
||||
set url $file
|
||||
set mime "video/ts"
|
||||
if {[file exists $dmsfile]} {
|
||||
set db [sqlite3.open /mnt/hd2/dms_cds.db]
|
||||
set muri [$db query "
|
||||
select tblresource.mimetype, contenturi
|
||||
from tblresource join tblmedia using (mediaid)
|
||||
where localurl = '$rfile'
|
||||
"]
|
||||
if {$muri != ""} {
|
||||
set rec [lindex $muri 0]
|
||||
set xuri [lindex $rec 3]
|
||||
set mime [lindex $rec 1]
|
||||
set url "http://$env(HTTP_HOST):9000/web/$xuri"
|
||||
}
|
||||
}
|
||||
|
||||
puts "Content-Type: text/plain"
|
||||
puts "Refresh: 0; url=$url"
|
||||
puts "Content-length: 0"
|
||||
puts ""
|
||||
|
||||
#puts "Pragma: public"
|
||||
#puts "Expires: 0"
|
||||
#puts "Cache-Control: must-revalidate, post-check=0, pre-check=0"
|
||||
#puts "Content-Type: application/force-download"
|
||||
#puts "Content-Type: application/download"
|
||||
#puts "Content-Type: $mime"
|
||||
#puts "Content-Disposition: attachment; filename=\"[file tail $file]\""
|
||||
#puts "Content-Transfer-Encoding: binary"
|
||||
#puts "Content-Length: [file size $rfile]"
|
||||
|
||||
@@ -16,11 +16,24 @@ set event 0
|
||||
catch { set event [dict get $_cgi event] }
|
||||
if {! [dict exists $_cgi bare]} { header }
|
||||
|
||||
#set service 8384
|
||||
#set event 25293
|
||||
#set service 8448
|
||||
#set event 30843
|
||||
|
||||
set record [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
$record get_channel_info
|
||||
set others [$record othertimes]
|
||||
|
||||
puts {
|
||||
<style type=text/css>
|
||||
font.also
|
||||
{
|
||||
font-size: 0.9em;
|
||||
font-style: italic;
|
||||
color: #333;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
@@ -32,7 +45,29 @@ puts "
|
||||
<td>[$record get text]</td>
|
||||
</tr><tr>
|
||||
<th>Start</th>
|
||||
<td>[clock format [$record get start] -format {%c %Z}]</td>
|
||||
<td>[clock format [$record get start] -format {%c %Z}]
|
||||
"
|
||||
|
||||
foreach o $others {
|
||||
if {[$o ended]} { continue }
|
||||
$o get_channel_info
|
||||
$o process_sched
|
||||
if {[$o get series_crid] eq ""} { set ro 1 } else { set ro 2 }
|
||||
puts -nonewline "<br><font class=also> "
|
||||
puts -nonewline "Also: "
|
||||
puts -nonewline "<a class=event href=# xs=[$o get service_id] "
|
||||
puts -nonewline "xe=[$o get event_id] "
|
||||
puts -nonewline "sch=[$o get sched_type] rec=$ro>"
|
||||
puts -nonewline "[clock format [$o get start] -format {%c %Z}]"
|
||||
puts -nonewline " on "
|
||||
puts -nonewline [$o channel_icon 16]
|
||||
puts -nonewline "[$o get channel_name] "
|
||||
puts "</a>"
|
||||
puts "</font>"
|
||||
}
|
||||
|
||||
puts "
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[clock format [$record get duration] -format %T]
|
||||
@@ -60,8 +95,13 @@ if {[$record get warning] != ""} {
|
||||
if {[$record get event_crid] != ""} {
|
||||
puts "
|
||||
<tr>
|
||||
<th>CRID</th>
|
||||
<td>[$record get channel_crid][$record get event_crid]</td>
|
||||
<th>CRID</th><td>
|
||||
<a href=/cgi-bin/epg_search.jim?crid=[$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]
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
"
|
||||
}
|
||||
|
||||
@@ -95,9 +95,14 @@ foreach record [lsort -command rsort $records] {
|
||||
}
|
||||
altrow
|
||||
$record get_channel_info
|
||||
puts "<td nowrap>
|
||||
|
||||
set ended [$record ended]
|
||||
|
||||
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"]</td>"
|
||||
[clock format [$record get start] -format "%H:%M %Z"]"
|
||||
puts "</td>"
|
||||
puts "<td>[$record get channel_num]</td>"
|
||||
puts "<td>[$record channel_icon 50]</td>"
|
||||
puts "<td nowrap>
|
||||
|
||||
@@ -20,10 +20,7 @@ cgi_input
|
||||
|
||||
require epg_popup
|
||||
|
||||
set service 0
|
||||
set service 4351
|
||||
catch { set service [dict get $_cgi service] }
|
||||
|
||||
set service [cgi_get service 4351]
|
||||
set records [epg fetch dump -service $service]
|
||||
|
||||
set tr [lindex $records 0]
|
||||
@@ -55,13 +52,14 @@ set i 0
|
||||
foreach record $records {
|
||||
altrow
|
||||
$record get_channel_info
|
||||
set ended [$record ended]
|
||||
if {[$record showing]} {
|
||||
puts "<td><img src=/images/111_1_00_Cursor_2R_Arrow.png></td>"
|
||||
} else { puts "<td></td>" }
|
||||
puts "<td nowrap>
|
||||
[clock format [$record get start] -format "%a %d %b %Y"]</td>"
|
||||
puts "<td nowrap>
|
||||
[clock format [$record get start] -format "%H:%M"]</td>"
|
||||
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
|
||||
puts "[clock format [$record get start] -format "%a %d %b %Y"]</td>"
|
||||
if $ended { puts "<td nowrap class=blood>" } else { puts "<td nowrap>" }
|
||||
puts "[clock format [$record get start] -format "%H:%M"]</td>"
|
||||
puts [$record cell]
|
||||
puts "<td>[$record get text]</td>"
|
||||
puts "<td>[$record get warning]</td>"
|
||||
|
||||
@@ -17,7 +17,7 @@ foreach df [split [exec df -h 2>>/dev/null] "\n\r"] {
|
||||
extract $df
|
||||
break;
|
||||
}
|
||||
if {[string match *media/drive* $df]} {
|
||||
if {[string match *media/drive? $df]} {
|
||||
extract $df
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,15 @@ epg method percent {} {
|
||||
}
|
||||
|
||||
epg method showing {} {
|
||||
set percent [$self percent]
|
||||
if {$percent > 0 && $percent < 100} { return 1 } else { return 0 }
|
||||
set now [clock seconds]
|
||||
if {$start > $now} { return 0 }
|
||||
if {$start + $duration < $now} { return 0 }
|
||||
return 1
|
||||
}
|
||||
|
||||
epg method ended {} {
|
||||
if {$start + $duration < [clock seconds]} { return 1 }
|
||||
return 0
|
||||
}
|
||||
|
||||
epg method elapsed {} {
|
||||
@@ -152,6 +159,16 @@ epg method get_rsv {} {
|
||||
}
|
||||
}
|
||||
|
||||
epg method process_sched {} {
|
||||
set sched_type 0
|
||||
if {$event_crid ne "" && "$channel_hsvc$event_crid" in $::rsvlookup} {
|
||||
set sched_type 1
|
||||
} elseif {$series_crid ne "" &&
|
||||
"$channel_hsvc$series_crid" in $::rsvlookup} {
|
||||
set sched_type 2
|
||||
}
|
||||
}
|
||||
|
||||
epg method icon_set {{height 0}} {
|
||||
if {$height > 0} { set height "height=$height" } else { set height "" }
|
||||
set icon [$self type_icon]
|
||||
@@ -161,14 +178,10 @@ epg method icon_set {{height 0}} {
|
||||
alt=\"$content_type\" title=\"$content_type\">"
|
||||
}
|
||||
|
||||
set sched_type 0
|
||||
if {$event_crid ne "" && "$channel_hsvc$event_crid" in $::rsvlookup} {
|
||||
set sched_type 1
|
||||
$self process_sched
|
||||
if {$sched_type == 1} {
|
||||
lappend set \
|
||||
"<img src=/images/175_1_11_Reservation_Record.png $height>"
|
||||
} elseif {$series_crid ne "" &&
|
||||
"$channel_hsvc$series_crid" in $::rsvlookup} {
|
||||
set sched_type 2
|
||||
}
|
||||
|
||||
if {$sched_type == 2} {
|
||||
@@ -240,6 +253,18 @@ epg method recommended {} {
|
||||
return $rec
|
||||
}
|
||||
|
||||
epg method othertimes {} {
|
||||
if {$event_crid eq ""} { return "" }
|
||||
|
||||
set others ""
|
||||
foreach other [epg fetch dump -crid $event_crid] {
|
||||
if {[$other get service_id] == $service_id &&
|
||||
[$other get event_id] == $event_id} { continue }
|
||||
lappend others $other
|
||||
}
|
||||
return $others
|
||||
}
|
||||
|
||||
proc {epg parse} {line} {
|
||||
set e [epg new]
|
||||
$e _parse $line
|
||||
|
||||
@@ -1,63 +1,70 @@
|
||||
puts {
|
||||
<div id=dialogue></div>
|
||||
<script type=text/javascript>
|
||||
$(document).ready(function() {
|
||||
function doschedule(type)
|
||||
{
|
||||
$('#epginfo_extra').load('/cgi-bin/epg_schedule.jim?' +
|
||||
'service=' +
|
||||
encodeURIComponent($('#dialogue').attr('xs')) +
|
||||
'&event=' +
|
||||
encodeURIComponent($('#dialogue').attr('xe')) +
|
||||
'&type=' + type, function() {
|
||||
$('#restart_block')
|
||||
.load('/cgi-bin/restartblock.jim');
|
||||
});
|
||||
$(":button:contains('Record')").fadeOut('slow');
|
||||
}
|
||||
|
||||
var $buttons1 = {
|
||||
"Close" : function() {$(this).dialog('close');}
|
||||
};
|
||||
var $buttons2 = $.extend(
|
||||
{"Record Programme": function() { doschedule(1) }},
|
||||
$buttons1);
|
||||
var $buttons3 = $.extend(
|
||||
{"Record Series": function() { doschedule(2) }},
|
||||
$buttons2);
|
||||
$(document).ready(function() {
|
||||
function doschedule(type)
|
||||
{
|
||||
$('#epginfo_extra').load('/cgi-bin/epg_schedule.jim?' +
|
||||
'service=' +
|
||||
encodeURIComponent($('#dialogue').attr('xs')) +
|
||||
'&event=' +
|
||||
encodeURIComponent($('#dialogue').attr('xe')) +
|
||||
'&type=' + type, function() {
|
||||
$('#restart_block')
|
||||
.load('/cgi-bin/restartblock.jim');
|
||||
});
|
||||
$(":button:contains('Record')").fadeOut('slow');
|
||||
}
|
||||
|
||||
var $dialog = $('#dialogue').dialog({
|
||||
title: "Programme Details",
|
||||
modal: false, autoOpen: false,
|
||||
height: 500, width: 700,
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: true, resizable: true,
|
||||
buttons: $buttons1,
|
||||
close: function(e,u) { $('#dialogue').empty().html(
|
||||
'<img src="/img/loading.gif" alt="loading">'); }
|
||||
});
|
||||
$('a.event').click(function(e) {
|
||||
e.preventDefault();
|
||||
var sch = $(this).attr('sch');
|
||||
var rec = $(this).attr('rec');
|
||||
if (sch != 0)
|
||||
$dialog.dialog("option", "buttons", $buttons1);
|
||||
else if (rec == 2)
|
||||
$dialog.dialog("option", "buttons", $buttons3);
|
||||
else if (rec == 1)
|
||||
$dialog.dialog("option", "buttons", $buttons2);
|
||||
else
|
||||
$dialog.dialog("option", "buttons", $buttons1);
|
||||
var url = '/cgi-bin/epg_info.jim?service=' +
|
||||
$(this).attr('xs') + '&event=' +
|
||||
$(this).attr('xe') + '&bare=1';
|
||||
$('#dialogue').load(url);
|
||||
$('#dialogue')
|
||||
.attr('xs', $(this).attr('xs'))
|
||||
.attr('xe', $(this).attr('xe'));
|
||||
$dialog.dialog('open');
|
||||
});
|
||||
var $buttons1 = {
|
||||
"Close" : function() {$(this).dialog('close');}
|
||||
};
|
||||
var $buttons2 = $.extend(
|
||||
{"Record Programme": function() { doschedule(1) }},
|
||||
$buttons1);
|
||||
var $buttons3 = $.extend(
|
||||
{"Record Series": function() { doschedule(2) }},
|
||||
$buttons2);
|
||||
|
||||
var $dialog = $('#dialogue').dialog({
|
||||
title: "Programme Details",
|
||||
modal: false, autoOpen: false,
|
||||
height: 500, width: 700,
|
||||
show: 'scale', hide: 'fade',
|
||||
draggable: true, resizable: true,
|
||||
buttons: $buttons1,
|
||||
close: function(e,u) { $('#dialogue').empty().html(
|
||||
'<img src="/img/loading.gif" alt="loading">'); }
|
||||
});
|
||||
|
||||
function epgpopup(e, o)
|
||||
{
|
||||
e.preventDefault();
|
||||
var sch = o.attr('sch');
|
||||
var rec = o.attr('rec');
|
||||
if (sch != 0)
|
||||
$dialog.dialog("option", "buttons", $buttons1);
|
||||
else if (rec == 2)
|
||||
$dialog.dialog("option", "buttons", $buttons3);
|
||||
else if (rec == 1)
|
||||
$dialog.dialog("option", "buttons", $buttons2);
|
||||
else
|
||||
$dialog.dialog("option", "buttons", $buttons1);
|
||||
var url = '/cgi-bin/epg_info.jim?service=' +
|
||||
o.attr('xs') + '&event=' +
|
||||
o.attr('xe') + '&bare=1';
|
||||
$('#dialogue').load(url, function() {
|
||||
$('#dialogue a.event').click(function(e) {
|
||||
epgpopup(e, $(this));
|
||||
});
|
||||
});
|
||||
$('#dialogue')
|
||||
.attr('xs', o.attr('xs'))
|
||||
.attr('xe', o.attr('xe'));
|
||||
$dialog.dialog('open');
|
||||
}
|
||||
$('a.event').click(function(e) { epgpopup(e, $(this)) });
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ cts 9 "Education" "Education/Science/Factual"
|
||||
puts "</td><td>"
|
||||
cts 10 "Leisure" "Leisure"
|
||||
|
||||
puts "</td><td><a href=/epg.shtml>Now/Next</a>"
|
||||
|
||||
puts "</td></tr><tr><td>"
|
||||
|
||||
cts 7 "Art" "Arts/Culture"
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
/mod/bin/ffmpeg "$@" 2>&1 | sed '
|
||||
1,8d
|
||||
$d
|
||||
'
|
||||
if [ -x /mod/bin/ffprobe ]; then
|
||||
/mod/bin/ffprobe "$@" 2>&1 | sed '
|
||||
1,10d
|
||||
'
|
||||
else
|
||||
/mod/bin/ffmpeg "$@" 2>&1 | sed '
|
||||
1,8d
|
||||
$d
|
||||
'
|
||||
fi
|
||||
exit 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user