mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
Display search results if metadata not found
This commit is contained in:
parent
d36de5a535
commit
25249e7538
6 changed files with 366 additions and 27 deletions
|
@ -1248,9 +1248,33 @@ a:hover .summary-poster-face-track .summary-poster-face-overlay span {
|
||||||
}
|
}
|
||||||
.item-children-wrapper {
|
.item-children-wrapper {
|
||||||
}
|
}
|
||||||
|
.item-children-section-title {
|
||||||
|
position: relative;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #2c2c2c;
|
||||||
|
border-bottom: 1px solid #3d3d3d;
|
||||||
|
border-top: 1px solid #282828;
|
||||||
|
height: 50px;
|
||||||
|
line-height: 22px;
|
||||||
|
padding: 13px 20px;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
.item-children-section-title h4 {
|
||||||
|
position: relative;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 22px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.item-children-instance {
|
.item-children-instance {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.item-children-instance li {
|
.item-children-instance li {
|
||||||
float: left;
|
float: left;
|
||||||
|
|
|
@ -32,6 +32,14 @@ directors Returns an array of directors.
|
||||||
studio Returns the name of the studio.
|
studio Returns the name of the studio.
|
||||||
originally_available_at Returns the air date of the item.
|
originally_available_at Returns the air date of the item.
|
||||||
|
|
||||||
|
query :: Usable parameters
|
||||||
|
|
||||||
|
== Global keys ==
|
||||||
|
rating_key Returns the unique identifier for the media item.
|
||||||
|
media_type Returns the type of media. Either 'movie', 'show', 'season', 'episode', 'artist', 'album', or 'track'.
|
||||||
|
title Returns the title for the search query.
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION :: END
|
DOCUMENTATION :: END
|
||||||
</%doc>
|
</%doc>
|
||||||
|
|
||||||
|
@ -361,11 +369,34 @@ DOCUMENTATION :: END
|
||||||
% else:
|
% else:
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="summary-container">
|
||||||
<h3>
|
<div class="summary-navbar"></div>
|
||||||
Error retrieving item data. This media may not be available in the Plex Media Server database
|
<div class="summary-content-title-wrapper">
|
||||||
anymore.
|
<div class="col-md-12">
|
||||||
</h3>
|
<h4>
|
||||||
|
Error retrieving item metadata. This media item is not available in the Plex Media Server library.
|
||||||
|
</h4>
|
||||||
|
% if query:
|
||||||
|
<h4>
|
||||||
|
If the item has been moved, please select the correct match below to update the PlexPy database.
|
||||||
|
</h4>
|
||||||
|
% endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="summary-content-wrapper">
|
||||||
|
<div class='col-md-12'>
|
||||||
|
% if query:
|
||||||
|
<div class='table-card-header'>
|
||||||
|
<div class="header-bar">
|
||||||
|
<span>Search Results for <strong>${query['title']}</strong></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='table-card-back'>
|
||||||
|
<div id="search-results-list"></div>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -381,13 +412,6 @@ DOCUMENTATION :: END
|
||||||
<script src="interfaces/default/js/moment-with-locale.js"></script>
|
<script src="interfaces/default/js/moment-with-locale.js"></script>
|
||||||
|
|
||||||
% if data:
|
% if data:
|
||||||
% if data['type'] == 'movie' or data['type'] == 'show' or data['type'] == 'episode':
|
|
||||||
<script>
|
|
||||||
// Convert rating to 5 star rating type
|
|
||||||
var starRating = Math.round(${data['rating']} / 2);
|
|
||||||
$('#stars').attr('data-rateit-value', starRating);
|
|
||||||
</script>
|
|
||||||
% endif
|
|
||||||
<script src="interfaces/default/js/tables/history_table.js"></script>
|
<script src="interfaces/default/js/tables/history_table.js"></script>
|
||||||
% if data['type'] == 'show' or data['type'] == 'artist':
|
% if data['type'] == 'show' or data['type'] == 'artist':
|
||||||
<script>
|
<script>
|
||||||
|
@ -488,10 +512,30 @@ DOCUMENTATION :: END
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
% endif
|
% endif
|
||||||
|
% if data['rating']:
|
||||||
|
<script>
|
||||||
|
// Convert rating to 5 star rating type
|
||||||
|
var starRating = Math.round(${data['rating']} / 2);
|
||||||
|
$('#stars').attr('data-rateit-value', starRating);
|
||||||
|
</script>
|
||||||
|
% endif
|
||||||
<script>
|
<script>
|
||||||
$("#airdate").html(moment($("#airdate").text()).format('MMM DD, YYYY'));
|
$("#airdate").html(moment($("#airdate").text()).format('MMM DD, YYYY'));
|
||||||
$("#runtime").html(millisecondsToMinutes($("#runtime").text(), true));
|
$("#runtime").html(millisecondsToMinutes($("#runtime").text(), true));
|
||||||
$('div.art-face').animate({ opacity: 0.2 }, { duration: 1000 });
|
$('div.art-face').animate({ opacity: 0.2 }, { duration: 1000 });
|
||||||
</script>
|
</script>
|
||||||
|
% elif query:
|
||||||
|
<script>
|
||||||
|
$.ajax({
|
||||||
|
url: 'get_search_results_children',
|
||||||
|
type: "GET",
|
||||||
|
async: true,
|
||||||
|
data: { query: "${query['title']}",
|
||||||
|
media_type: "${query['media_type']}"
|
||||||
|
},
|
||||||
|
complete: function(xhr, status) {
|
||||||
|
$("#search-results-list").html(xhr.responseText); }
|
||||||
|
});
|
||||||
|
</script>
|
||||||
% endif
|
% endif
|
||||||
</%def>
|
</%def>
|
||||||
|
|
222
data/interfaces/default/info_search_results_list.html
Normal file
222
data/interfaces/default/info_search_results_list.html
Normal file
|
@ -0,0 +1,222 @@
|
||||||
|
<%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: info_children_list.html
|
||||||
|
Version: 0.1
|
||||||
|
Variable names: data [list]
|
||||||
|
|
||||||
|
data :: Usable parameters
|
||||||
|
|
||||||
|
== Global keys ==
|
||||||
|
results_count Returns the number of search results.
|
||||||
|
results_list Returns a dictionary of search result types.
|
||||||
|
|
||||||
|
data['results_list'] :: Usable paramaters
|
||||||
|
|
||||||
|
== media_type keys ==
|
||||||
|
movie Returns an array of movie results
|
||||||
|
show Returns an array of show results
|
||||||
|
season Returns an array of season results
|
||||||
|
episode Returns an array of episode results
|
||||||
|
artist Returns an array of artist results
|
||||||
|
album Returns an array of album results
|
||||||
|
track Returns an array of track results
|
||||||
|
|
||||||
|
data['results_list'][media_type] :: Usable paramaters
|
||||||
|
|
||||||
|
== Global keys ==
|
||||||
|
rating_key Returns the unique identifier for the media item.
|
||||||
|
type Returns the type of media. Either 'movie', 'episode' or 'show' or 'season'.
|
||||||
|
art Returns the location of the item's artwork
|
||||||
|
title Returns the name of the episode, show, season or movie.
|
||||||
|
duration Returns the standard runtime of the media.
|
||||||
|
content_rating Returns the age rating for the media.
|
||||||
|
summary Returns a brief description of the media plot.
|
||||||
|
grandparent_title Returns the name of the TV show.
|
||||||
|
parent_index Returns the season number of the TV show.
|
||||||
|
index Returns the episode number.
|
||||||
|
parent_thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
|
writers Returns an array of writers.
|
||||||
|
thumb Returns the location of the item's thumbnail. Use with pms_image_proxy.
|
||||||
|
parent_title Returns the name of the TV show.
|
||||||
|
rating Returns the 5 star rating value for the movie. Between 1 and 5.
|
||||||
|
year Returns the release year of the movie.
|
||||||
|
genres Returns an array of genres.
|
||||||
|
actors Returns an array of actors.
|
||||||
|
directors Returns an array of directors.
|
||||||
|
studio Returns the name of the studio.
|
||||||
|
originally_available_at Returns the air date of the item.
|
||||||
|
|
||||||
|
DOCUMENTATION :: END
|
||||||
|
</%doc>
|
||||||
|
|
||||||
|
% if data != None:
|
||||||
|
% if data['results_count'] > 0:
|
||||||
|
% if 'movie' in data['results_list'] and data['results_list']['movie']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>Movies</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['movie']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face season-poster" style="background-image: url(pms_image_proxy?img=${child['thumb']}&width=300&height=450);"></div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper season-item">
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
<h3 class="text-muted">${child['year']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% if 'show' in data['results_list'] and data['results_list']['show']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>TV Shows</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['show']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face season-poster" style="background-image: url(pms_image_proxy?img=${child['thumb']}&width=300&height=450);"></div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper season-item">
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
<h3 class="text-muted">${child['year']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% if 'season' in data['results_list'] and data['results_list']['season']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>Seasons</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['season']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face season-poster" style="background-image: url(pms_image_proxy?img=${child['thumb']}&width=300&height=450);"></div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper season-item">
|
||||||
|
<h3 title="${child['parent_title']}">${child['parent_title']}</h3>
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% if 'episode' in data['results_list'] and data['results_list']['episode']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>Episodes</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['episode']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face episode-poster" style="background-image: url(pms_image_proxy?img=${child['thumb']}&width=300&height=450);">
|
||||||
|
<div class="item-children-card-overlay">
|
||||||
|
<div class="item-children-overlay-text">
|
||||||
|
Episode ${child['index']}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper episode-item">
|
||||||
|
<h3 title="${child['grandparent_title']}">${child['grandparent_title']}</h3>
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% if 'artist' in data['results_list'] and data['results_list']['artist']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>Artists</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['artist']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face album-poster" style="background-image: url(pms_image_proxy?img=${child['thumb']}&width=300&height=300);"></div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper album-item">
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% if 'album' in data['results_list'] and data['results_list']['album']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>Albums</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['album']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face album-poster" style="background-image: url(pms_image_proxy?img=${child['thumb']}&width=300&height=300);"></div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper album-item">
|
||||||
|
<h3 title="${child['parent_title']}">${child['parent_title']}</h3>
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% if 'track' in data['results_list'] and data['results_list']['track']:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
<div class="item-children-section-title">
|
||||||
|
<h4>Tracks</h4>
|
||||||
|
</div>
|
||||||
|
<ul class="item-children-instance list-unstyled">
|
||||||
|
% for child in data['results_list']['track']:
|
||||||
|
<li>
|
||||||
|
<a href="info?item_id=${child['rating_key']}" id="${child['rating_key']}">
|
||||||
|
<div class="item-children-poster">
|
||||||
|
<div class="item-children-poster-face album-poster" style="background-image: url(pms_image_proxy?img=${child['parent_thumb']}&width=300&height=300);"></div>
|
||||||
|
</div>
|
||||||
|
<div class="item-children-instance-text-wrapper album-item">
|
||||||
|
<h3 title="${child['grandparent_title']}">${child['grandparent_title']}</h3>
|
||||||
|
<h3 title="${child['title']}">${child['title']}</h3>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
% endfor
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% else:
|
||||||
|
<div class="item-children-wrapper">
|
||||||
|
No search results found.
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
% endif
|
||||||
|
|
|
@ -779,3 +779,48 @@ class DataFactory(object):
|
||||||
else:
|
else:
|
||||||
return 'Unable to delete items. Input user_id not valid.'
|
return 'Unable to delete items. Input user_id not valid.'
|
||||||
|
|
||||||
|
def get_search_query(self, rating_key=''):
|
||||||
|
monitor_db = database.MonitorDatabase()
|
||||||
|
|
||||||
|
if rating_key:
|
||||||
|
query = 'SELECT rating_key, parent_rating_key, grandparent_rating_key, title, parent_title, grandparent_title, media_type ' \
|
||||||
|
'FROM session_history_metadata ' \
|
||||||
|
'WHERE rating_key = ? ' \
|
||||||
|
'OR parent_rating_key = ? ' \
|
||||||
|
'OR grandparent_rating_key = ? ' \
|
||||||
|
'LIMIT 1'
|
||||||
|
result = monitor_db.select(query=query, args=[rating_key, rating_key, rating_key])
|
||||||
|
else:
|
||||||
|
result = []
|
||||||
|
|
||||||
|
query = {}
|
||||||
|
title = None
|
||||||
|
media_type = None
|
||||||
|
|
||||||
|
for item in result:
|
||||||
|
if str(item['rating_key']) == rating_key:
|
||||||
|
title = item['title']
|
||||||
|
media_type = item['media_type']
|
||||||
|
|
||||||
|
elif str(item['parent_rating_key']) == rating_key:
|
||||||
|
title = item['parent_title']
|
||||||
|
if item['media_type'] == episode:
|
||||||
|
media_type = 'season'
|
||||||
|
elif item['media_type'] == track:
|
||||||
|
media_type = 'album'
|
||||||
|
|
||||||
|
elif str(item['grandparent_rating_key']) == rating_key:
|
||||||
|
title = item['grandparent_title']
|
||||||
|
if item['media_type'] == episode:
|
||||||
|
media_type = 'show'
|
||||||
|
elif item['media_type'] == track:
|
||||||
|
media_type = 'artist'
|
||||||
|
|
||||||
|
if title and media_type:
|
||||||
|
query = {'title': title,
|
||||||
|
'media_type': media_type,
|
||||||
|
'rating_key': rating_key}
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
return query
|
||||||
|
|
|
@ -1382,13 +1382,13 @@ class PmsConnect(object):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
search_results_count = 0
|
search_results_count = 0
|
||||||
search_results_list = {'movies': [],
|
search_results_list = {'movie': [],
|
||||||
'shows': [],
|
'show': [],
|
||||||
'seasons': [],
|
'season': [],
|
||||||
'episodes': [],
|
'episode': [],
|
||||||
'artists': [],
|
'artist': [],
|
||||||
'albums': [],
|
'album': [],
|
||||||
'tracks': []
|
'track': []
|
||||||
}
|
}
|
||||||
|
|
||||||
totalSize = 0
|
totalSize = 0
|
||||||
|
@ -1409,9 +1409,9 @@ class PmsConnect(object):
|
||||||
rating_key = helpers.get_xml_attr(result, 'ratingKey')
|
rating_key = helpers.get_xml_attr(result, 'ratingKey')
|
||||||
metadata = self.get_metadata_details(rating_key=rating_key)
|
metadata = self.get_metadata_details(rating_key=rating_key)
|
||||||
if metadata['metadata']['type'] == 'movie':
|
if metadata['metadata']['type'] == 'movie':
|
||||||
search_results_list['movies'].append(metadata['metadata'])
|
search_results_list['movie'].append(metadata['metadata'])
|
||||||
elif metadata['metadata']['type'] == 'episode':
|
elif metadata['metadata']['type'] == 'episode':
|
||||||
search_results_list['episodes'].append(metadata['metadata'])
|
search_results_list['episode'].append(metadata['metadata'])
|
||||||
search_results_count += 1
|
search_results_count += 1
|
||||||
|
|
||||||
if a.getElementsByTagName('Directory'):
|
if a.getElementsByTagName('Directory'):
|
||||||
|
@ -1420,13 +1420,13 @@ class PmsConnect(object):
|
||||||
rating_key = helpers.get_xml_attr(result, 'ratingKey')
|
rating_key = helpers.get_xml_attr(result, 'ratingKey')
|
||||||
metadata = self.get_metadata_details(rating_key=rating_key)
|
metadata = self.get_metadata_details(rating_key=rating_key)
|
||||||
if metadata['metadata']['type'] == 'show':
|
if metadata['metadata']['type'] == 'show':
|
||||||
search_results_list['shows'].append(metadata['metadata'])
|
search_results_list['show'].append(metadata['metadata'])
|
||||||
elif metadata['metadata']['type'] == 'season':
|
elif metadata['metadata']['type'] == 'season':
|
||||||
search_results_list['seasons'].append(metadata['metadata'])
|
search_results_list['season'].append(metadata['metadata'])
|
||||||
elif metadata['metadata']['type'] == 'artist':
|
elif metadata['metadata']['type'] == 'artist':
|
||||||
search_results_list['artists'].append(metadata['metadata'])
|
search_results_list['artist'].append(metadata['metadata'])
|
||||||
elif metadata['metadata']['type'] == 'album':
|
elif metadata['metadata']['type'] == 'album':
|
||||||
search_results_list['albums'].append(metadata['metadata'])
|
search_results_list['album'].append(metadata['metadata'])
|
||||||
search_results_count += 1
|
search_results_count += 1
|
||||||
|
|
||||||
if a.getElementsByTagName('Track'):
|
if a.getElementsByTagName('Track'):
|
||||||
|
@ -1434,7 +1434,7 @@ class PmsConnect(object):
|
||||||
for result in result_data:
|
for result in result_data:
|
||||||
rating_key = helpers.get_xml_attr(result, 'ratingKey')
|
rating_key = helpers.get_xml_attr(result, 'ratingKey')
|
||||||
metadata = self.get_metadata_details(rating_key=rating_key)
|
metadata = self.get_metadata_details(rating_key=rating_key)
|
||||||
search_results_list['tracks'].append(metadata['metadata'])
|
search_results_list['track'].append(metadata['metadata'])
|
||||||
search_results_count += 1
|
search_results_count += 1
|
||||||
|
|
||||||
output = {'results_count': search_results_count,
|
output = {'results_count': search_results_count,
|
||||||
|
|
|
@ -749,6 +749,7 @@ class WebInterface(object):
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def info(self, item_id=None, source=None, **kwargs):
|
def info(self, item_id=None, source=None, **kwargs):
|
||||||
metadata = None
|
metadata = None
|
||||||
|
query = None
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER
|
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER
|
||||||
|
@ -762,12 +763,15 @@ class WebInterface(object):
|
||||||
result = pms_connect.get_metadata_details(rating_key=item_id)
|
result = pms_connect.get_metadata_details(rating_key=item_id)
|
||||||
if result:
|
if result:
|
||||||
metadata = result['metadata']
|
metadata = result['metadata']
|
||||||
|
else:
|
||||||
|
data_factory = datafactory.DataFactory()
|
||||||
|
query = data_factory.get_search_query(rating_key=item_id)
|
||||||
|
|
||||||
if metadata:
|
if metadata:
|
||||||
return serve_template(templatename="info.html", data=metadata, title="Info", config=config)
|
return serve_template(templatename="info.html", data=metadata, title="Info", config=config)
|
||||||
else:
|
else:
|
||||||
logger.warn('Unable to retrieve data.')
|
logger.warn('Unable to retrieve data.')
|
||||||
return serve_template(templatename="info.html", data=None, title="Info")
|
return serve_template(templatename="info.html", data=None, query=query, title="Info")
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def get_user_recently_watched(self, user=None, user_id=None, limit='10', **kwargs):
|
def get_user_recently_watched(self, user=None, user_id=None, limit='10', **kwargs):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue