diff --git a/CONTROL/control b/CONTROL/control index 02627e9e..8da07f88 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.7.3 +Version: 0.7.3-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk 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.5),hmt(>=1.0.6),ssmtp diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index 95b9d059..ecb26eb0 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -189,6 +189,32 @@ puts { + +
@@ -232,5 +258,21 @@ foreach file [lsort [glob -nocomplain "$dir"]] { puts "" +# De-duplicate + +puts { + +} + +# Streamer file + +if {[file exists /mnt/hd3/Streamer_down_file]} { + puts { + +} +} + footer diff --git a/var/mongoose/cgi-bin/browse/browse.js b/var/mongoose/cgi-bin/browse/browse.js index 6ee49955..99607182 100755 --- a/var/mongoose/cgi-bin/browse/browse.js +++ b/var/mongoose/cgi-bin/browse/browse.js @@ -88,6 +88,18 @@ function rename_submit() function() { window.location.reload(true); }); } +function savestream_submit() +{ + var s = $('#savestream_form').serialize(); + var sf = $('#save_stream').attr('file'); + $('#savestream_spin').show(); + $.get('/cgi-bin/browse/savestream.jim?sfile=' + + encodeURIComponent(sf) + '&' + s, + function() { + window.location.reload(true); + }); +} + var $confirm; // Populated after DOM is loaded. function confirm_action(action, callback, file, type, id) @@ -266,6 +278,19 @@ var menuclick = function(action, el, pos) close: function() { $('#rename').val(''); } }); + $('#savestreamform').dialog({ + autoOpen: false, + height: 'auto', width: 'auto', + modal: true, + buttons: { + "Save": savestream_submit, + "Cancel": function() { + $(this).dialog('close'); + } + }, + close: function() { $('#savestream_name').val(''); } + }); + // Create re-usable confirmation dialogue. $confirm = $('#confirm').dialog({ modal: true, autoOpen: false, @@ -283,5 +308,18 @@ var menuclick = function(action, el, pos) // Flag folders with unwatched items $.getJSON('/cgi-bin/browse/newdir.jim?dir=' + encodeURIComponent(dir), new_folder_callback); + + $('#dedup').button().click(function() { + window.location = '/cgi-bin/dedup.jim?dir=' + + encodeURIComponent(dir); + }); + + $('#save_stream').button().click(function() { + $('#savestream_spin').hide(); + $('#savestreamform').dialog('open'); + $('#savestream_detail').load( + '/cgi-bin/browse/ffmpeg.jim?file=' + + encodeURIComponent($('#save_stream').attr('file'))); + }); }); diff --git a/var/mongoose/cgi-bin/browse/savestream.jim b/var/mongoose/cgi-bin/browse/savestream.jim new file mode 100755 index 00000000..464b6820 --- /dev/null +++ b/var/mongoose/cgi-bin/browse/savestream.jim @@ -0,0 +1,21 @@ +#!/mod/bin/jimsh + +package require cgi +source /mod/var/mongoose/lib/ts.class + +puts "Content-Type: text/html" +puts "" + +cgi_input +#cgi_dump + +set dir [cgi_get dir "/media/My Video"] +set file [file tail [cgi_get savestream_name]] +set sfile [cgi_get savestream_source "/mnt/hd3/Streamer_down_file"] +if {$file == "0"} { exit } +if {[string length [string trim $file]] == 0} { exit } + +if {[file extension $file] ne ".mp4"} { append file ".mp4" } + +file copy $sfile "$dir/$file" + diff --git a/var/mongoose/cgi-bin/dedup.jim b/var/mongoose/cgi-bin/dedup.jim new file mode 100755 index 00000000..8a662d8e --- /dev/null +++ b/var/mongoose/cgi-bin/dedup.jim @@ -0,0 +1,102 @@ +#!/mod/bin/jimsh + +package require cgi +source /mod/var/mongoose/lib/setup +require ts.class pretty_size altrow + +puts "Content-Type: text/html" +puts "" + +cgi_input +#cgi_dump + +set dir [cgi_get dir "/media/My Video"] +set doit [cgi_get doit 0] + +# Strip double slashes + +header + +puts "
+De-duplicate $dir + + + + + + + +" + +regsub -all -- {\/+} "$dir/*" "/" dir + +foreach file [lsort [glob -nocomplain "$dir"]] { + if {[file extension $file] ne ".hmt"} { continue } + altrow + set ts [ts fetch $file 1] + set base [file tail [file rootname $file]] + puts "" + set syn [$ts get synopsis] + regsub -nocase -all -- {^new series\.* *} $syn "" syn + regsub -all -- { *[:].*$} $syn "" syn + if {[string length $syn] > 40} { + regsub -all -- { *[\.].*$} $syn "" syn + } + if {[string length $syn] < 6} { + append syn " [$ts get title]" + } + regsub -all -- {[\/ &]} $syn "_" fn + puts "" + puts "" + puts "" + puts "" +} + +puts { +
FileProposed FilenameProposed TitleStatus
$base$fn$syn" + if {[file exists "$dir/$fn.hmt"]} { + puts "Duplicate" + } elseif {[string length $syn] > 40} { + puts "Cannot process" + } elseif {$base eq $fn} { + puts "Already done" + } elseif {$doit} { + # Dooooo, it. + $ts settitle $syn + $ts renamegroup $file $fn + puts "Done" + } + + puts "
+
+
+ + +} + +if {!$doit} { puts "" } + +puts { + + +
+ +" + +footer + diff --git a/var/mongoose/cgi-bin/xepg.jim b/var/mongoose/cgi-bin/xepg.jim index 1b668e81..b4b5f233 100755 --- a/var/mongoose/cgi-bin/xepg.jim +++ b/var/mongoose/cgi-bin/xepg.jim @@ -41,8 +41,9 @@ set ett $(int($stt + $seconds)) set offset $(($ostt - $stt) / 1800.0) set chanpx 120 -set eventpx 780 +set eventpx 1000 set totalpx $($chanpx + $eventpx) +set contwidth $($totalpx + 50) set hourpx $($eventpx / $hours) set minpx $($hourpx / 60.0) @@ -65,7 +66,8 @@ puts "" puts "" puts " -
+
+
" @@ -96,7 +98,8 @@ foreach e $records { puts "[$e channel_icon 30] " puts "$chnum - + [$e get channel_name]
"