tvdb improvements

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2533 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2015-11-02 23:17:11 +00:00
parent 79dadbec68
commit b373ccb3dc
9 changed files with 53 additions and 14 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.2.5-4
Version: 1.2.5-5
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.35-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=2.0.7),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),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7)

View File

@ -42,7 +42,9 @@ if {$type eq "ts"} {
if {[llength $sdata]} {
set sid [$sdata get seriesid]
if {$sid} {
append series "/<a href=/db/index.jim?db=$sid.db>$sid</a>"
append series " / <a target=_blank href=[\
tvdb seriesurl $sid]><img height=20 src=/img/tvdb.png></a>"
append series " / <a href=/db/index.jim?db=$sid.db>DB:$sid</a>"
}
}
puts "<td>[$ts epstr] - $epname (<i>$series</i>)<td>

View File

@ -8,7 +8,7 @@ require ts.class pretty_size system.class settings.class escape browse.class \
set mroot [system mediaroot]
set dir [cgi_get dir $mroot]
jqplugin contextMenu bar enadis blockui
jqplugin contextMenu bar enadis blockui dialogue
jscss script.js style.css
if {[system has tvdb]} { jscss tvdb/script.js tvdb/style.css }

View File

@ -5,7 +5,7 @@ require classdump
if {[file exists "$dir/.tvdbseriesid"]} {
set seriesid [string trim [file read "$dir/.tvdbseriesid"]]
set tvdb_series [set v [tvdb series [file tail $dir] $seriesid]]
puts "<div>"
puts "<div class=tvdbbanner sid=$seriesid>"
if {[set banner [$v get banner]] ne ""} {
puts "
<img class=tvdbbannertop src=\"[tvdb bannerurl $banner]\">

View File

@ -7,8 +7,7 @@ function select_episode()
$('.tvdbresults').hide();
$('#tvdbresults_saving').show();
$('#tvdbresults').dialog('option', 'position', {
my: "center", at: "center", of: window });
$('#tvdbresults').diagrefresh();
$.get('tvdb/store.jim', { dir: dir, sid: sid }, function(data) {
if (data <= 0)
@ -24,8 +23,7 @@ function select_episode()
.on('click', function() {
$('.tvdbresults').hide();
$('#tvdbresults_saving').show();
$('#tvdbresults').dialog('option', 'position', {
my: "center", at: "center", of: window });
$('#tvdbresults').diagrefresh();
$.get('tvdb/store.jim', {
dir: dir,
sid: sid,
@ -37,7 +35,8 @@ function select_episode()
});
}
$('#tvdbsetseries').button().on('click', function() {
$('#tvdbsetseries').button().on('click', function(e) {
e.stopPropagation();
val = $('#tvdbseriesname').text();
if (!val)
val = dir.split(/[\\/]/).pop();
@ -78,9 +77,10 @@ $('#tvdbsetseries').button().on('click', function() {
.on('click', select_episode);
$('#tvdbresults_loading').slideUp('slow');
$('#tvdbresults_inner').show();
$('#tvdbresults').dialog('option',
'position', {
my: "center", at: "center", of: window });
$('#tvdbresults').diagrefresh({
width: $(window).width() - 100,
height: $(window).height() - 100
});
});
}
},
@ -108,5 +108,13 @@ $('#tvdbsetseries').button().on('click', function() {
});
});
$('img.tvdbbannertop').hover(
function() { $(this).css('cursor', 'pointer'); },
function() { $(this).css('cursor', 'auto'); }
).on('click', function() {
var sid = $(this).closest('div').attr('sid');
window.open('http://thetvdb.com/?tab=series&id=' + sid, '_blank');
});
});

View File

@ -13,7 +13,9 @@ foreach series [[tvdb] searchseries $term] {
puts "
<div>
<div class=tvdbseries>
<a target=_blank href=[tvdb seriesurl $series(seriesid)]>
<img class=tvdbbanner src=\"[tvdb bannerurl $series(banner)]\">
</a>
<span title=\"Series ID: $series(seriesid)\">
$series(seriesname)
</span>

View File

@ -0,0 +1,21 @@
(function($)
{
$.fn.diagrefresh = function(options)
{
var defaults = {
height: 'auto',
width: 'auto'
};
var settings = $.extend(defaults, options);
return this.each(function() {
$(this)
.dialog('option', 'position', {
my: "center", at: "center", of: window
})
.dialog('option', 'height', settings.height)
.dialog('option', 'width', settings.width);
});
};
})(jQuery);

Binary file not shown.

View File

@ -252,8 +252,10 @@ tvdb method wordcount {db words extra} {
set ret [$db query {
select episode_id from episode
where overview like '%%%s%%' %s
} $w $extra]
where overview like '%%%s%%'
or name like '%%%s%%'
%s
} $w $w $extra]
foreach row $ret {
#puts "&nbsp;&nbsp;> FOUND: ($w)<br>"
ladd _phrases $w
@ -340,3 +342,7 @@ proc {tvdb bannerurl} {banner} {
return "http://$::tvdb::mirror/banners/$banner"
}
proc {tvdb seriesurl} {seriesid} {
return "http://$::tvdb::mirror/?tab=series&id=$seriesid"
}