mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Add watch time and user stats to info pages (#1471)
* watch time stats for show * watch time stats for movie * User Stats for movies and shows * implementation for missing media types * cleanup * no data + rescrict guest access implementation Co-authored-by: herby2212 <jannes.nagel@gmx.de>
This commit is contained in:
parent
22f4b33087
commit
c6ff8940b4
3 changed files with 322 additions and 1 deletions
|
@ -539,6 +539,34 @@ DOCUMENTATION :: END
|
|||
</div>
|
||||
</div>
|
||||
% endif
|
||||
% if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track'):
|
||||
<div class="col-md-12">
|
||||
<div class="table-card-header">
|
||||
<div class="header-bar">
|
||||
<span><i class="fa fa-line-chart"></i> Global Stats</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-card-back">
|
||||
<div id="watch-time-stats" class="user-overview-stats-wrapper">
|
||||
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Loading data...</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="table-card-header">
|
||||
<div class="header-bar">
|
||||
<span><i class="fa fa-group"></i> User Stats</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-card-back">
|
||||
<div id="user-stats" class="user-player">
|
||||
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Loading data...</div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
<%
|
||||
history_type = data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track')
|
||||
history_active = 'active' if history_type else ''
|
||||
|
@ -894,6 +922,28 @@ DOCUMENTATION :: END
|
|||
});
|
||||
</script>
|
||||
% endif
|
||||
% if data['media_type'] in ('movie', 'show', 'season', 'episode', 'artist', 'album', 'track'):
|
||||
<script>
|
||||
// Populate watch time stats
|
||||
$.ajax({
|
||||
url: 'item_watch_time_stats',
|
||||
async: true,
|
||||
data: { rating_key: "${data['rating_key']}", media_type: "${data['media_type']}" },
|
||||
complete: function(xhr, status) {
|
||||
$("#watch-time-stats").html(xhr.responseText);
|
||||
}
|
||||
});
|
||||
// Populate user stats
|
||||
$.ajax({
|
||||
url: 'item_user_stats',
|
||||
async: true,
|
||||
data: { rating_key: "${data['rating_key']}", media_type: "${data['media_type']}" },
|
||||
complete: function(xhr, status) {
|
||||
$("#user-stats").html(xhr.responseText);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
% endif
|
||||
% if data['media_type'] == 'collection':
|
||||
<script>
|
||||
$.ajax({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue