mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
200 lines
9.8 KiB
HTML
200 lines
9.8 KiB
HTML
<%doc>
|
|
USAGE DOCUMENTATION :: PLEASE LEAVE THIS AT THE TOP OF THIS FILE
|
|
|
|
For Mako templating syntax documentation please visit: http://docs.makotemplates.org/en/latest/
|
|
|
|
Filename: update_metadata.html
|
|
Version: 0.1
|
|
Variable names: query [list]
|
|
|
|
query :: Usable parameters
|
|
|
|
== Global keys ==
|
|
query_string Returns the string used for the search query.
|
|
title Returns the name of the movie, episode, or track.
|
|
parent_title Returns the name of the album.
|
|
grandparent_title Returns the name of the show, or artist.
|
|
media_index Returns the index number of the episode, or track.
|
|
parent_media_index Returns the index number of the season.
|
|
year Returns the release year of the movie, or show.
|
|
media_type Returns the type of media. Either 'movie', 'show', 'season', 'episode', 'artist', 'album', or 'track'.
|
|
rating_key Returns the unique identifier for the media item.
|
|
|
|
DOCUMENTATION :: END
|
|
</%doc>
|
|
|
|
<%inherit file="base.html"/>
|
|
|
|
<%def name="headIncludes()">
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
% if query:
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="summary-container">
|
|
<div class="summary-navbar">
|
|
<div class="col-md-12">
|
|
<div class="summary-navbar-list">
|
|
<ul class="list-unstyled breadcrumb">
|
|
% if query['media_type'] == 'movie':
|
|
<li>Movies</li>
|
|
<li class="active">${query['title']}</li>
|
|
% elif query['media_type'] == 'show':
|
|
<li>TV Shows</li>
|
|
<li class="active">${query['grandparent_title']}</li>
|
|
% elif query['media_type'] == 'season':
|
|
<li class="hidden-xs hidden-sm">TV Shows</li>
|
|
<li class="hidden-xs hidden-sm">${query['grandparent_title']}</li>
|
|
<li class="active">Season ${query['parent_media_index']}</li>
|
|
% elif query['media_type'] == 'episode':
|
|
<li class="hidden-xs hidden-sm">TV Shows</li>
|
|
<li class="hidden-xs hidden-sm">${query['grandparent_title']}</li>
|
|
<li>Season ${query['parent_media_index']}</li>
|
|
<li class="active">Episode ${query['media_index']} - ${query['title']}</li>
|
|
% elif query['media_type'] == 'artist':
|
|
<li><Music</li>
|
|
<li class="active">${query['grandparent_title']}</li>
|
|
% elif query['media_type'] == 'album':
|
|
<li class="hidden-xs hidden-sm">Music</li>
|
|
<li>${query['grandparent_title']}</li>
|
|
<li class="active">${query['parent_title']}</li>
|
|
% elif query['media_type'] == 'track':
|
|
<li class="hidden-xs hidden-sm">Music</li>
|
|
<li class="hidden-xs hidden-sm">${query['grandparent_title']}</li>
|
|
<li>${query['parent_title']}</li>
|
|
<li class="active">Track ${query['media_index']} - ${query['title']}</li>
|
|
% endif
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="summary-content-wrapper">
|
|
<div class='col-md-12'>
|
|
<div style="text-align: center; margin-top: 20px;">
|
|
<i class="fa fa-exclamation-triangle"></i> Error retrieving item metadata. This media item is not available in the Plex Media Server library.
|
|
</div>
|
|
<div style="text-align: center; margin-top: 20px;">
|
|
Please select the correct match below to update the PlexPy database.
|
|
</div>
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span>Search Results for <strong>${query['query_string']}</strong></span>
|
|
</div>
|
|
</div>
|
|
<div class='table-card-back'>
|
|
<div id="search-results-list"><i class="fa fa-refresh fa-spin"></i> Loading search results...</div>
|
|
</div>
|
|
<div class="modal fade" id="confirm-modal" tabindex="-1" role="dialog" aria-labelledby="confirm-modal">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-remove"></i></button>
|
|
<h4 class="modal-title" id="myModalLabel">Confirm Update</h4>
|
|
</div>
|
|
<div class="modal-body" style="text-align: center;">
|
|
<p>Are you REALLY sure you want to replace
|
|
<p><strong>
|
|
% if query['media_type'] == 'movie':
|
|
${query['title']}<br />${query['year']}
|
|
% elif query['media_type'] == 'show':
|
|
${query['grandparent_title']}
|
|
% elif query['media_type'] == 'season':
|
|
${query['grandparent_title']}<br />S${query['parent_media_index']}
|
|
% elif query['media_type'] == 'episode':
|
|
${query['grandparent_title']}<br />${query['title']}<br />S${query['parent_media_index']} · E${query['media_index']}
|
|
% elif query['media_type'] == 'artist':
|
|
${query['grandparent_title']}
|
|
% elif query['media_type'] == 'album':
|
|
${query['grandparent_title']}<br />${query['parent_title']}
|
|
% elif query['media_type'] == 'track':
|
|
${query['grandparent_title']}<br />${query['title']}<br />${query['parent_title']}
|
|
% endif
|
|
</strong></p>
|
|
<p> with </p>
|
|
<p><span id="new_title"></span></p>
|
|
% if query['media_type'] != 'movie':
|
|
<p>All items for <strong>${query['grandparent_title']}</strong> will also be updated.</p>
|
|
% endif
|
|
<p>This is permanent and cannot be undone!</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-dark" data-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-danger btn-ok" data-dismiss="modal" id="confirm-update">Update</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% else:
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="summary-container">
|
|
<div class="summary-navbar">
|
|
<div class="col-md-12">
|
|
<div class="summary-navbar-list">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="summary-content-wrapper">
|
|
<div class='col-md-12'>
|
|
<div style="text-align: center; margin-top: 20px;">
|
|
<i class="fa fa-exclamation-triangle"></i> Error retrieving item metadata. This media item is not available in the Plex Media Server library.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
|
|
% if query:
|
|
<script>
|
|
$.ajax({
|
|
url: 'get_search_results_children',
|
|
type: 'GET',
|
|
async: true,
|
|
data: {'query': "${query['query_string']}",
|
|
'media_type': "${query['media_type']}",
|
|
'season_index': "${query['parent_media_index']}"
|
|
},
|
|
complete: function(xhr, status) {
|
|
$("#search-results-list").html(xhr.responseText); }
|
|
});
|
|
$(document).on('click', '#search-results-list a', function (e) {
|
|
e.preventDefault();
|
|
var new_rating_key = $(this).attr("id");
|
|
var new_href = $(this).attr("href");
|
|
|
|
$('#new_title').html($(this).find('.item-children-instance-text-wrapper').html());
|
|
|
|
$('#confirm-modal').modal();
|
|
$('#confirm-modal').one('click', '#confirm-update', function () {
|
|
$(this).prop('disabled', true);
|
|
var msg = "<i class='fa fa-refresh fa-spin'></i> Updating database..."
|
|
showMsg(msg, false, false, 0)
|
|
|
|
$.ajax({
|
|
url: 'update_metadata_details',
|
|
data: {
|
|
old_rating_key: "${query['rating_key']}",
|
|
new_rating_key: new_rating_key,
|
|
media_type: "${query['media_type']}"
|
|
},
|
|
async: true,
|
|
success: function (data) {
|
|
window.location.href = new_href;
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
% endif
|
|
</%def>
|