mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 08:16:06 -07:00
Set max width on media title in history tables
Add watch history to show media info page
This commit is contained in:
parent
01601605e1
commit
a4a44ec34f
6 changed files with 30 additions and 6 deletions
|
@ -65,9 +65,9 @@ A python based web front-end for plexWatch.
|
||||||
- top 10 viewed tv shows
|
- top 10 viewed tv shows
|
||||||
- top 10 viewed tv episodes
|
- top 10 viewed tv episodes
|
||||||
|
|
||||||
* content information pages **PARTIALLY IMPLEMENTED**
|
* content information pages
|
||||||
- movies (includes watching history)
|
- movies (includes watching history)
|
||||||
- tv shows (includes top 10 watched episodes)
|
- tv shows (includes watching history)
|
||||||
- tv seasons
|
- tv seasons
|
||||||
- tv episodes (includes watching history)
|
- tv episodes (includes watching history)
|
||||||
|
|
||||||
|
|
|
@ -8149,4 +8149,10 @@ ol.test >li {
|
||||||
background-color: #282828;
|
background-color: #282828;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.history-table-title {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: 350px;
|
||||||
}
|
}
|
|
@ -136,7 +136,7 @@
|
||||||
<div class='row-fluid'>
|
<div class='row-fluid'>
|
||||||
<div class='span12'>
|
<div class='span12'>
|
||||||
<div class='wellbg'>
|
<div class='wellbg'>
|
||||||
% if metadata['type'] == 'movie' or metadata['type'] == 'episode':
|
% if metadata['type'] == 'movie' or metadata['type'] == 'episode' or metadata['type'] == 'show':
|
||||||
<div class="wellheader">
|
<div class="wellheader">
|
||||||
<div class="dashboard-wellheader">
|
<div class="dashboard-wellheader">
|
||||||
<h3>Watch history for <strong>${metadata['title']}</strong></h3>
|
<h3>Watch history for <strong>${metadata['title']}</strong></h3>
|
||||||
|
@ -221,7 +221,21 @@
|
||||||
history_table.column(5).visible(false);
|
history_table.column(5).visible(false);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
%endif
|
% elif metadata['type'] == 'show':
|
||||||
|
<script src="interfaces/default/js/tables/history_table.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
history_table_options.ajax = {
|
||||||
|
"url": "get_history",
|
||||||
|
"data": function(d) {
|
||||||
|
d.grandparent_rating_key = ${metadata['ratingKey']};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
history_table = $('#history_table').DataTable(history_table_options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
% endif
|
||||||
% if metadata['type'] == 'season':
|
% if metadata['type'] == 'season':
|
||||||
<script>
|
<script>
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
|
@ -82,7 +82,7 @@ history_table_options = {
|
||||||
"name":"title",
|
"name":"title",
|
||||||
"createdCell": function (td, cellData, rowData, row, col) {
|
"createdCell": function (td, cellData, rowData, row, col) {
|
||||||
if (cellData !== '') {
|
if (cellData !== '') {
|
||||||
$(td).html('<a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a>');
|
$(td).html('<div class="history-table-title"><a href="info?rating_key=' + rowData['rating_key'] + '">' + cellData + '</a></div>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -224,7 +224,8 @@ class PlexWatch(object):
|
||||||
'xml',
|
'xml',
|
||||||
'round((julianday(datetime(stopped, "unixepoch", "localtime")) - \
|
'round((julianday(datetime(stopped, "unixepoch", "localtime")) - \
|
||||||
julianday(datetime(time, "unixepoch", "localtime"))) * 86400) - \
|
julianday(datetime(time, "unixepoch", "localtime"))) * 86400) - \
|
||||||
(case when paused_counter is null then 0 else paused_counter end) as duration'
|
(case when paused_counter is null then 0 else paused_counter end) as duration,'
|
||||||
|
'grandparentRatingKey as grandparent_rating_key'
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
query = data_tables.ssp_query(table_name=self.get_history_table_name(),
|
query = data_tables.ssp_query(table_name=self.get_history_table_name(),
|
||||||
|
|
|
@ -362,6 +362,9 @@ class WebInterface(object):
|
||||||
if 'rating_key' in kwargs:
|
if 'rating_key' in kwargs:
|
||||||
rating_key = kwargs.get('rating_key', "")
|
rating_key = kwargs.get('rating_key', "")
|
||||||
custom_where = 'rating_key = %s' % rating_key
|
custom_where = 'rating_key = %s' % rating_key
|
||||||
|
if 'grandparent_rating_key' in kwargs:
|
||||||
|
rating_key = kwargs.get('grandparent_rating_key', "")
|
||||||
|
custom_where = 'grandparent_rating_key = %s' % rating_key
|
||||||
|
|
||||||
plex_watch = plexwatch.PlexWatch()
|
plex_watch = plexwatch.PlexWatch()
|
||||||
history = plex_watch.get_history(start, length, kwargs, custom_where)
|
history = plex_watch.get_history(start, length, kwargs, custom_where)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue