Fix invalid link to playlist in sync table (Fixes Tautulli/Tautulli-Issues#34)

This commit is contained in:
JonnyWong16 2018-03-25 12:39:20 -07:00
parent 683a782723
commit 2aff7713cd
2 changed files with 10 additions and 3 deletions

View file

@ -37,7 +37,6 @@ sync_table_options = {
"data": "state", "data": "state",
"createdCell": function (td, cellData, rowData, row, col) { "createdCell": function (td, cellData, rowData, row, col) {
if (cellData === 'pending') { if (cellData === 'pending') {
$(td).addClass('currentlyWatching');
$(td).html('Pending...'); $(td).html('Pending...');
} else { } else {
$(td).html(cellData.toProperCase()); $(td).html(cellData.toProperCase());
@ -66,7 +65,7 @@ sync_table_options = {
"data": "sync_title", "data": "sync_title",
"createdCell": function (td, cellData, rowData, row, col) { "createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== '') { if (cellData !== '') {
if (rowData['metadata_type'] !== '') { if (rowData['rating_key']) {
$(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>'); $(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>');
} else { } else {
$(td).html(cellData); $(td).html(cellData);
@ -74,7 +73,7 @@ sync_table_options = {
} }
}, },
"className": "datatable-wrap" "className": "datatable-wrap"
}, },
{ {
"targets": [4], "targets": [4],
"data": "metadata_type", "data": "metadata_type",
@ -150,6 +149,11 @@ sync_table_options = {
"preDrawCallback": function (settings) { "preDrawCallback": function (settings) {
var msg = "<i class='fa fa-refresh fa-spin'></i>&nbspFetching rows..."; var msg = "<i class='fa fa-refresh fa-spin'></i>&nbspFetching rows...";
showMsg(msg, false, false, 0) showMsg(msg, false, false, 0)
},
"rowCallback": function (row, rowData, rowIndex) {
if (rowData['state'] === 'pending') {
$(row).addClass('current-activity-row');
}
} }
}; };

View file

@ -3716,6 +3716,9 @@ class WebInterface(object):
@cherrypy.expose @cherrypy.expose
@requireAuth() @requireAuth()
def info(self, rating_key=None, source=None, query=None, **kwargs): def info(self, rating_key=None, source=None, query=None, **kwargs):
if rating_key and not str(rating_key).isdigit():
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
metadata = None metadata = None
config = { config = {