Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WebUI: Add thetvdb search, icon buttons, DVR database search
  • Loading branch information
ProfYaffle authored and perexg committed Nov 2, 2015
1 parent ac55457 commit 0061c24
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 10 deletions.
25 changes: 25 additions & 0 deletions src/webui/static/app/dvr.js
Expand Up @@ -58,6 +58,30 @@ tvheadend.dvrDetails = function(uuid) {
if (timerec_caption)
content += '<div class="x-epg-meta"><div class="x-epg-prefix">' + _('Time Scheduler') + ':</div> ' + timerec_caption + '</div>';

var buttons = [];

buttons.push(new Ext.Button({
handler: searchIMDB,
iconCls: 'imdb',
tooltip: _('Search IMDB (for title)'),
}));

buttons.push(new Ext.Button({
handler:searchTheTVDB,
iconCls:'thetvdb',
tooltip:_('Search TheTVDB (for title)'),
}));

function searchIMDB() {
window.open('http://akas.imdb.com/find?q=' +
encodeURIComponent(title), '_blank');
}

function searchTheTVDB(){
window.open('http://thetvdb.com/?string='+
encodeURIComponent(title)+'&searchseriesid=&tab=listseries&function=Search','_blank');
}

var win = new Ext.Window({
title: title,
iconCls: 'info',
Expand All @@ -66,6 +90,7 @@ tvheadend.dvrDetails = function(uuid) {
height: 450,
constrainHeader: true,
buttonAlign: 'center',
buttons: buttons,
html: content
});

Expand Down
29 changes: 19 additions & 10 deletions src/webui/static/app/epg.js
Expand Up @@ -140,15 +140,19 @@ tvheadend.epgDetails = function(event) {
var recording = event.dvrState.indexOf('recording') === 0;
var scheduled = event.dvrState.indexOf('scheduled') === 0;

if (!recording && !scheduled) {
buttons.push(new Ext.Button({
disabled: !event.title,
handler: searchIMDB,
iconCls: 'find',
tooltip: _('Search IMDB (for title)'),
text: _("Search IMDB")
}));
}
buttons.push(new Ext.Button({
disabled: !event.title,
handler: searchIMDB,
iconCls: 'find',
tooltip: _('Search IMDB (for title)'),
}));

buttons.push(new Ext.Button({
disabled:!event.title,
handler:searchTheTVDB,
iconCls:'thetvdb',
tooltip:_('Search TheTVDB (for title)'),
}));

buttons.push(new Ext.Button({
disabled: event.start > now || event.stop < now,
Expand Down Expand Up @@ -234,7 +238,7 @@ tvheadend.epgDetails = function(event) {
title: _('Broadcast Details'),
iconCls: 'broadcast_details',
layout: 'fit',
width: 650,
width: 675,
height: 450,
constrainHeader: true,
buttons: buttons,
Expand All @@ -249,6 +253,11 @@ tvheadend.epgDetails = function(event) {
encodeURIComponent(event.title), '_blank');
}

function searchTheTVDB(){
window.open('http://thetvdb.com/?string='+
encodeURIComponent(event.title)+'&searchseriesid=&tab=listseries&function=Search','_blank');
}

function playProgram() {
var title = event.title;
if (event.episodeOnscreen)
Expand Down
8 changes: 8 additions & 0 deletions src/webui/static/app/ext.css
Expand Up @@ -168,6 +168,14 @@
background-image: url(../icons/find.png) !important;
}

.imdb {
background-image: url(../icons/imdb.png) !important;
}

.thetvdb {
background-image: url(../icons/thetvdb.png) !important;
}

.add {
background-image: url(../icons/add.png) !important;
}
Expand Down
Binary file added src/webui/static/icons/imdb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/webui/static/icons/thetvdb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0061c24

Please sign in to comment.