Create a new database table for poster urls

This commit is contained in:
JonnyWong16 2016-10-15 16:55:41 -07:00 committed by JonnyWong16
parent ffdd9c9cbf
commit ed6a42f747
5 changed files with 98 additions and 98 deletions

View file

@ -150,7 +150,7 @@ DOCUMENTATION :: END
</a>
</div>
<div class="summary-content-title">
% if data['media_type'] == 'movie' or data['media_type'] == 'show' or data['media_type'] == 'artist':
% if data['media_type'] in ('movie', 'show', 'artist'):
<h1>&nbsp;</h1><h1>${data['title']}</h1>
% elif data['media_type'] == 'season':
<h1>&nbsp;</h1><h1><a href="info?rating_key=${data['parent_rating_key']}">${data['parent_title']}</a></h1>
@ -185,7 +185,7 @@ DOCUMENTATION :: END
% else:
<div class="summary-content-padding hidden-xs hidden-sm">
% endif
% if data['media_type'] == 'movie' or data['media_type'] == 'episode' or data['media_type'] == 'track':
% if data['media_type'] in ('movie', 'episode', 'track'):
<div class="summary-content-media-info-wrapper">
% if data['media_type'] != 'track' and data['video_codec']:
<img class="summary-content-media-flag" title="${data['video_codec']}" src="${http_root}images/media_flags/video_codec/${data['video_codec'] | vf}.png" />
@ -377,7 +377,8 @@ DOCUMENTATION :: END
% else:
<span class="imgur-poster-tooltip" data-toggle="popover" data-img="${data['poster_url']}" data-height="120" data-width="80" style="display: inline-flex;">
% endif
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="delete-imgur-poster">
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="delete-imgur-poster"
data-id="${data['parent_rating_key'] if data['media_type'] in ('episode', 'track') else data['rating_key']}">
<i class="fa fa-picture-o"></i> Reset Imgur Poster
</button>
</span>
@ -447,7 +448,7 @@ DOCUMENTATION :: END
% if data:
<script src="${http_root}js/tables/history_table.js"></script>
% if data['media_type'] == 'show' or data['media_type'] == 'artist':
% if data['media_type'] in ('show', 'artist'):
<script>
function get_history() {
history_table_options.ajax = {
@ -463,7 +464,7 @@ DOCUMENTATION :: END
}
}
</script>
% elif data['media_type'] == 'season' or data['media_type'] == 'album':
% elif data['media_type'] in ('season', 'album'):
<script>
function get_history() {
history_table_options.ajax = {
@ -479,7 +480,7 @@ DOCUMENTATION :: END
}
}
</script>
% elif data['media_type'] == 'episode' or data['media_type'] == 'track' or data['media_type'] == 'movie':
% elif data['media_type'] in ('movie', 'episode', 'track'):
<script>
function get_history() {
history_table_options.ajax = {
@ -543,13 +544,13 @@ DOCUMENTATION :: END
});
});
</script>
% if data['media_type'] == 'show' or data['media_type'] == 'season' or data['media_type'] == 'artist' or data['media_type'] == 'album':
% if data['media_type'] in ('show', 'season', 'artist', 'album'):
<script>
$.ajax({
url: 'get_item_children',
type: 'GET',
async: true,
data: { rating_key : ${data['rating_key']} },
data: { rating_key : "${data['rating_key']}" },
complete: function(xhr, status) {
$("#children-list").html(xhr.responseText); }
});
@ -566,26 +567,22 @@ DOCUMENTATION :: END
html: true,
container: 'body',
trigger: 'hover',
placement: 'left',
placement: 'top',
template: '<div class="popover history-thumbnail-popover" role="tooltip"><div class="arrow" style="top: 50%;"></div><div class="popover-content"></div></div>',
content: function () {
return '<div class="history-thumbnail" style="background-image: url(' + $(this).data('img') + '); height: ' + $(this).data('height') + 'px; width: ' + $(this).data('width') + 'px;" />';
}
});
$('#delete-imgur-poster').on('click', function() {
$.ajax({
url: 'delete_poster_url',
type: 'POST',
async: true,
data: { poster_url : "${data['poster_url']}" },
success: function (data) {
var msg = '<i class="fa fa-check"></i>&nbsp; Imgur poster reset';
showMsg(msg, false, true, 2000);
$('.imgur-poster-tooltip').popover('destroy');
$('#delete-imgur-poster').closest('span').remove();
}
});
$('#delete-imgur-poster').on('click', function () {
var msg = 'Are you sure you want to reset the Imgur poster for <strong>${data["poster_title"]}</strong>?';
var url = 'delete_poster_url';
var data = { rating_key: $(this).data('id') }
var callback = function () {
$('.imgur-poster-tooltip').popover('destroy');
$('#delete-imgur-poster').closest('span').remove();
}
confirmAjaxCall(url, msg, data, false, callback);
});
</script>
% endif