mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 13:23:24 -07:00
Add button to delete 3rd party API lookup info
This commit is contained in:
parent
7d31079897
commit
3380e39de2
5 changed files with 171 additions and 7 deletions
|
@ -388,6 +388,15 @@ DOCUMENTATION :: END
|
|||
</a>
|
||||
</div>
|
||||
% endif
|
||||
% if data.get('tvmaze_id') or data.get('themoviedb_id'):
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-danger btn-edit" data-toggle="modal" aria-pressed="false" autocomplete="off" id="delete-lookup-info"
|
||||
data-id="${data['grandparent_rating_key'] if data['media_type'] in ('episode', 'track') else data['parent_rating_key'] if data['media_type'] in ('season', 'album') else data['rating_key']}"
|
||||
data-title="${data['grandparent_title'] if data['media_type'] in ('episode', 'track') else data['parent_title'] if data['media_type'] in ('season', 'album') else data['title']}">
|
||||
<i class="fa fa-search"></i> Delete Lookup Info
|
||||
</button>
|
||||
</div>
|
||||
% endif
|
||||
% if data.get('poster_url'):
|
||||
<div class="btn-group">
|
||||
% if data['media_type'] == 'artist' or data['media_type'] == 'album' or data['media_type'] == 'track':
|
||||
|
@ -396,7 +405,8 @@ DOCUMENTATION :: END
|
|||
<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="modal" 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']}">
|
||||
data-id="${data['parent_rating_key'] if data['media_type'] in ('episode', 'track') else data['rating_key']}"
|
||||
data-title="${data["poster_title"]}">
|
||||
<i class="fa fa-picture-o"></i> Delete Imgur Poster
|
||||
</button>
|
||||
</span>
|
||||
|
@ -706,13 +716,27 @@ DOCUMENTATION :: END
|
|||
});
|
||||
|
||||
$('#delete-imgur-poster').on('click', function () {
|
||||
var msg = 'Are you sure you want to delete the Imgur poster for <strong>${data["poster_title"]}</strong>?<br><br>' +
|
||||
var msg = 'Are you sure you want to delete the Imgur poster for <strong>' + $(this).data('title') + '</strong>?<br><br>' +
|
||||
'All previous links to this image will no longer work.';
|
||||
var url = 'delete_imgur_poster';
|
||||
var data = { rating_key: $(this).data('id') };
|
||||
var callback = function () {
|
||||
$('.imgur-poster-tooltip').popover('destroy');
|
||||
$('#delete-imgur-poster').closest('span').remove();
|
||||
$('#delete-imgur-poster').closest('.btn-group').remove();
|
||||
};
|
||||
confirmAjaxCall(url, msg, data, false, callback);
|
||||
});
|
||||
</script>
|
||||
% endif
|
||||
% if data.get('tvmaze_id') or data.get('themoviedb_id'):
|
||||
<script>
|
||||
$('#delete-lookup-info').on('click', function () {
|
||||
var msg = 'Are you sure you want to delete the 3rd party API lookup for <strong>' + $(this).data('title') + '</strong>?<br><br>' +
|
||||
'The info will be looked up again the next time a notification is sent.';
|
||||
var url = 'delete_lookup_info';
|
||||
var data = { rating_key: $(this).data('id'), title: $(this).data('title') };
|
||||
var callback = function () {
|
||||
$('#delete-lookup-info').closest('.btn-group').remove();
|
||||
};
|
||||
confirmAjaxCall(url, msg, data, false, callback);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue