Add buttons to delete all 3rd party metadata lookup info in the settings

This commit is contained in:
JonnyWong16 2020-03-14 14:00:17 -07:00
commit 90374bb46f
4 changed files with 47 additions and 10 deletions

View file

@ -860,10 +860,10 @@ DOCUMENTATION :: END
% if data.get('tvmaze_id') or data.get('themoviedb_id') or data.get('musicbrainz_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 msg = 'Are you sure you want to delete all the metadata lookup info for <strong>' + $(this).data('title') + '</strong>?' +
'<br /><br />Tautulli will lookup the metadata info 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 data = { rating_key: $(this).data('id') };
var callback = function () {
$('#delete-lookup-info').closest('.btn-group').remove();
};

View file

@ -1239,6 +1239,19 @@
</label>
<p class="help-block">Enable to lookup links to MusicBrainz for music when available.</p>
</div>
<div class="form-group">
<label for="maxmind_license_key">Delete Lookup Info</label>
<p class="help-block">Delete all cached metadata lookup info in Tautulli.</p>
<div class="row">
<div class="col-md-9">
<div class="btn-group">
<button class="btn btn-form delete_all_lookups" type="button" data-service="themoviedb">TheMovieDB</button>
<button class="btn btn-form delete_all_lookups" type="button" data-service="tvmaze">TVmaze</button>
<button class="btn btn-form delete_all_lookups" type="button" data-service="musicbrainz">MusicBrainz</button>
</div>
</div>
</div>
</div>
<div class="padded-header">
<h3>Geolocation Database</h3>
@ -2806,12 +2819,23 @@ $(document).ready(function() {
var name = image_hosting_option.text();
var msg = 'Are you sure you want to delete all uploaded images on <strong>' + name + '</strong>?' +
'<br />All previous links to the images will no longer work. This cannot be undone!';
'<br /><br />All previous links to the images will no longer work. This cannot be undone!';
var url = 'delete_hosted_images';
var data = { service: name, delete_all: true };
confirmAjaxCall(url, msg, data, false);
});
$('body').on('click', '.delete_all_lookups', function () {
var service = $(this).data('service');
var name = $(this).text();
var msg = 'Are you sure you want to delete all the metadata lookup info from <strong>' + name + '</strong>?' +
'<br /><br />Tautulli will lookup the metadata info again the next time a notification is sent.';
var url = 'delete_lookup_info';
var data = { service: service, delete_all: true };
confirmAjaxCall(url, msg, data, false);
});
function baseURLSet() {
if ($('#http_base_url').val()) {
$('.base-url-warning').hide();