mirror of
https://github.com/Tautulli/Tautulli.git
synced 2024-11-21 04:50:36 -08:00
905 lines
48 KiB
HTML
905 lines
48 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: library.html
|
|
Version: 0.1
|
|
Variable names: data [list]
|
|
|
|
data :: Usable parameters
|
|
|
|
section_id Returns the library id of the library.
|
|
section_name Returns the name of the library.
|
|
section_type Returns the type of the library.
|
|
library_thumb Returns the thumbnail for the library.
|
|
custom_thumb Returns the custom thumbnail for the library.
|
|
library_art Returns the artwork for the library.
|
|
count Returns the item count for the library.
|
|
parent_count Returns the parent item count for the library.
|
|
child_count Returns the child item count for the library.
|
|
do_notify Returns bool value for whether to send notifications for the library.
|
|
keep_history Returns bool value for whether to keep history for the library.
|
|
|
|
DOCUMENTATION :: END
|
|
|
|
</%doc>
|
|
|
|
<%inherit file="base.html"/>
|
|
|
|
<%def name="headIncludes()">
|
|
<link rel="stylesheet" href="${http_root}css/dataTables.bootstrap.min.css">
|
|
<link rel="stylesheet" href="${http_root}css/dataTables.colVis.css">
|
|
<link rel="stylesheet" href="${http_root}css/tautulli-dataTables.css">
|
|
</%def>
|
|
|
|
<%def name="body()">
|
|
% if data:
|
|
<%
|
|
from plexpy.common import LIVE_TV_SECTION_ID
|
|
from plexpy.helpers import page
|
|
%>
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
% if data['library_art']:
|
|
<div class="art-face" style="background-image:url(${page('pms_image_proxy', data['library_art'], None, 1920, 1080)})"></div>
|
|
% if _session['user_group'] == 'admin':
|
|
<span class="overlay-refresh-image info-art" title="Refresh background image"><i class="fa fa-refresh refresh_pms_image"></i></span>
|
|
% endif
|
|
% endif
|
|
<div class="summary-container">
|
|
<div class="summary-navbar">
|
|
<div class="col-md-12">
|
|
<div class="summary-navbar-list">
|
|
<ul class="list-unstyled breadcrumb">
|
|
<li class="active">${data['section_name']}</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="summary-content-wrapper" style="min-height: calc(100% - 50px);">
|
|
<div class="col-md-12">
|
|
<div class="table-card-back">
|
|
<div class="user-info-wrapper">
|
|
% if data['library_thumb'].startswith('http'):
|
|
<div class="library-info-poster-face" style="background-image: url(${page('pms_image_proxy', data['library_thumb'], None, 80, 80)});">
|
|
% if not data['is_active']:
|
|
<span class="inactive-library-tooltip" data-toggle="tooltip" title="Library not on Plex server">
|
|
<i class="fa fa-2x fa-exclamation-triangle"></i>
|
|
</span>
|
|
% endif
|
|
</div>
|
|
% else:
|
|
<div class="library-info-poster-face svg-icon library-${data['section_type']}">
|
|
% if not data['is_active']:
|
|
<span class="inactive-library-tooltip" data-toggle="tooltip" title="Library not on Plex server">
|
|
<i class="fa fa-2x fa-exclamation-triangle"></i>
|
|
</span>
|
|
% endif
|
|
</div>
|
|
% endif
|
|
<div class="user-info-username">
|
|
<span class="set-username">${data['section_name']}</span>
|
|
% if _session['user_group'] == 'admin':
|
|
<span id="edit-library-tooltip" data-target="tooltip" title="Edit library details">
|
|
<a href="#" data-toggle="modal" data-target="#edit-library-modal" id="toggle-edit-library-modal"><i class="fa fa-pencil"></i></a>
|
|
</span>
|
|
% endif
|
|
</div>
|
|
<div class="user-info-nav">
|
|
<ul class="nav nav-list nav-pills" role="tablist">
|
|
<li class="active"><a id="nav-tabs-profile" href="#tabs-profile" role="tab" data-toggle="tab">Profile</a></li>
|
|
<li><a id="nav-tabs-history" href="#tabs-history" role="tab" data-toggle="tab">History</a></li>
|
|
% if data['section_id'] != LIVE_TV_SECTION_ID:
|
|
% if _session['user_group'] == 'admin':
|
|
<li><a id="nav-tabs-mediainfo" href="#tabs-mediainfo" role="tab" data-toggle="tab">Media Info</a></li>
|
|
% endif
|
|
% if data['section_type'] != 'photo':
|
|
<li><a id="nav-tabs-collections" href="#tabs-collections" role="tab" data-toggle="tab">Collections</a></li>
|
|
% endif
|
|
<li><a id="nav-tabs-playlists" href="#tabs-playlists" role="tab" data-toggle="tab">Playlists</a></li>
|
|
% if _session['user_group'] == 'admin':
|
|
<li><a id="nav-tabs-export" href="#tabs-export" role="tab" data-toggle="tab">Export</a></li>
|
|
% endif
|
|
% endif
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-content">
|
|
<div role="tabpanel" class="tab-pane active" id="tabs-profile">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<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="library-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>
|
|
</div>
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<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="library-user-stats" class="user-player">
|
|
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Loading data...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="table-card-header">
|
|
<ul class="nav nav-header nav-dashboard pull-right">
|
|
<li>
|
|
<a href="#" id="recently-watched-page-left" class="paginate-watched btn-gray disabled" data-id="-1"><i class="fa fa-lg fa-chevron-left"></i></a>
|
|
</li>
|
|
<li>
|
|
<a href="#" id="recently-watched-page-right" class="paginate-watched btn-gray disabled" data-id="+1"><i class="fa fa-lg fa-chevron-right"></i></a>
|
|
</li>
|
|
</ul>
|
|
<div class="header-bar">
|
|
<span><i class="fa fa-history"></i> Recently Played</span>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<div id="library-recently-watched">
|
|
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Loading data...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% if data['section_id'] != LIVE_TV_SECTION_ID:
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="table-card-header">
|
|
<ul class="nav nav-header nav-dashboard pull-right">
|
|
<li>
|
|
<a href="#" id="recently-added-page-left" class="paginate-added btn-gray disabled" data-id="-1"><i class="fa fa-lg fa-chevron-left"></i></a>
|
|
</li>
|
|
<li>
|
|
<a href="#" id="recently-added-page-right" class="paginate-added btn-gray disabled" data-id="+1"><i class="fa fa-lg fa-chevron-right"></i></a>
|
|
</li>
|
|
</ul>
|
|
<div class="header-bar">
|
|
<span><i class="fa fa-history"></i> Recently Added</span>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<div id="library-recently-added">
|
|
<div class='muted'><i class="fa fa-refresh fa-spin"></i> Loading data...</div>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane" id="tabs-history">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span>
|
|
<i class="fa fa-history"></i> History for <strong>
|
|
<span class="set-username">${data['section_name']}</span>
|
|
</strong>
|
|
</span>
|
|
</div>
|
|
<div class="button-bar">
|
|
% if _session['user_group'] == 'admin':
|
|
<div class="btn-group">
|
|
<button class="btn btn-danger btn-edit" data-toggle="button" aria-pressed="false" autocomplete="off" id="row-edit-mode">
|
|
<i class="fa fa-trash-o"></i> Delete mode
|
|
</button>
|
|
</div>
|
|
% endif
|
|
<div class="btn-group" data-toggle="buttons" id="transcode_decision-selection">
|
|
<label class="btn btn-dark btn-filter">
|
|
<input type="checkbox" name="transcode_decision-filter" id="history-transcode_decision-direct_play" value="direct play" autocomplete="off"><i class="fa fa-play-circle"></i> Direct Play
|
|
</label>
|
|
<label class="btn btn-dark btn-filter">
|
|
<input type="checkbox" name="transcode_decision-filter" id="history-transcode_decision-direct_stream" value="copy" autocomplete="off"><i class="fa fa-stream"></i> Direct Stream
|
|
</label>
|
|
<label class="btn btn-dark btn-filter">
|
|
<input type="checkbox" name="transcode_decision-filter" id="history-transcode_decision-transcode" value="transcode" autocomplete="off"><i class="fa fa-server"></i> Transcode
|
|
</label>
|
|
</div>
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark refresh-history-button" id="refresh-history-list"><i class="fa fa-refresh"></i> Refresh history</button>
|
|
</div>
|
|
<div class="btn-group colvis-button-bar" id="button-bar-history"></div>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<table class="display history_table" id="history_table-SID-${data['section_id']}" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th align="left" id="delete">Delete</th>
|
|
<th align="left" id="date">Date</th>
|
|
<th align="left" id="friendly_name">User</th>
|
|
<th align="left" id="ip_address">IP Address</th>
|
|
<th align="left" id="platform">Platform</th>
|
|
<th align="left" id="product">Product</th>
|
|
<th align="left" id="player">Player</th>
|
|
<th align="left" id="title">Title</th>
|
|
<th align="left" id="started">Started</th>
|
|
<th align="left" id="paused_counter">Paused</th>
|
|
<th align="left" id="stopped">Stopped</th>
|
|
<th align="left" id="play_duration">Duration</th>
|
|
<th align="left" id="percent_complete"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% if _session['user_group'] == 'admin':
|
|
<div role="tabpanel" class="tab-pane" id="tabs-mediainfo">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
% if config['get_file_sizes'] and data['section_id'] in config['get_file_sizes_hold']['section_ids']:
|
|
<div id="get_file_sizes_message" style="text-align: center; margin-top: 20px;">
|
|
<i class="fa fa-refresh fa-spin"></i> Tautulli is calculating the file sizes for the library's media info. This could take a few minutes depending on the size of your library.
|
|
<br />
|
|
You may leave this page and check back later.
|
|
</div>
|
|
% endif
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span>
|
|
<i class="fa fa-info-circle"></i> Media Info for <strong>
|
|
<span class="set-username">${data['section_name']}</span>
|
|
</strong>
|
|
</span>
|
|
</div>
|
|
<div class="button-bar">
|
|
% if _session['user_group'] == 'admin':
|
|
<div class="btn-group">
|
|
% if config['get_file_sizes'] and data['section_id'] in config['get_file_sizes_hold']['section_ids']:
|
|
<button class="btn btn-dark refresh-media-info-table-button" id="refresh-media-info-table" disabled>
|
|
<i class="fa fa-refresh"></i> Refresh media info
|
|
</button>
|
|
% else:
|
|
<button class="btn btn-dark refresh-media-info-table-button" id="refresh-media-info-table">
|
|
<i class="fa fa-refresh"></i> Refresh media info
|
|
</button>
|
|
% endif
|
|
</div>
|
|
% endif
|
|
<div class="btn-group colvis-button-bar" id="button-bar-media-info"></div>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<table class="display media_info_table" id="media_info_table-SID-${data['section_id']}" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th align="left" id="added_at">Added At</th>
|
|
<th align="left" id="title">Title</th>
|
|
<th align="left" id="container">Container</th>
|
|
<th align="left" id="bitrate">Bitrate</th>
|
|
<th align="left" id="video_codec">Video Codec</th>
|
|
<th align="left" id="video_resolution">Video Resolution</th>
|
|
<th align="left" id="video_resolution">Video Framerate</th>
|
|
<th align="left" id="audio_codec">Audio Codec</th>
|
|
<th align="left" id="audio_channels">Audio Channels</th>
|
|
<th align="left" id="file_size">File Size</th>
|
|
<th align="left" id="last_played">Last Played</th>
|
|
<th align="left" id="total_plays">Total Plays</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
% if data['section_type'] != 'photo':
|
|
<div role="tabpanel" class="tab-pane" id="tabs-collections">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span>
|
|
<i class="fa fa-folder-open"></i> Collections for <strong>
|
|
<span class="set-username">${data['section_name']}</span>
|
|
</strong>
|
|
</span>
|
|
</div>
|
|
<div class="button-bar">
|
|
% if _session['user_group'] == 'admin':
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark export-button" id="toggle-export-modal" data-toggle="modal" data-target="#export-modal"
|
|
data-section_id="${data['section_id']}" data-media_type="collection" data-sub_media_type="${data['section_type']}"
|
|
data-export_type="collection">
|
|
<i class="fa fa-file-export"></i> Export collections
|
|
</button>
|
|
</div>
|
|
% endif
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark refresh-collections-table-button" id="refresh-collections-table">
|
|
<i class="fa fa-refresh"></i> Refresh collections
|
|
</button>
|
|
</div>
|
|
<div class="btn-group colvis-button-bar" id="button-bar-collections"></div>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<table class="display collections_table" id="collections_table-SID-${data['section_id']}" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th align="left" id="collectionTitle">Collection Title</th>
|
|
<th align="left" id="collectionMode">Collection Mode</th>
|
|
<th align="left" id="collectionSort">Collection Sort</th>
|
|
<th align="left" id="collectionItems">Collection Items</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
<div role="tabpanel" class="tab-pane" id="tabs-playlists">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span>
|
|
<i class="fa fa-list-alt"></i> Playlists for <strong>
|
|
<span class="set-username">${data['section_name']}</span>
|
|
</strong>
|
|
</span>
|
|
</div>
|
|
<div class="button-bar">
|
|
% if _session['user_group'] == 'admin':
|
|
<% playlist_sub_media_type = {'movie': 'video', 'show': 'video', 'artist': 'audio', 'photo': 'photo'} %>
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark export-button" id="toggle-export-modal" data-toggle="modal" data-target="#export-modal"
|
|
data-section_id="${data['section_id']}" data-media_type="playlist" data-sub_media_type="${playlist_sub_media_type.get(data['section_type'])}"
|
|
data-export_type="playlist">
|
|
<i class="fa fa-file-export"></i> Export playlists
|
|
</button>
|
|
</div>
|
|
% endif
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark refresh-playlists-table-button" id="refresh-playlists-table">
|
|
<i class="fa fa-refresh"></i> Refresh playlists
|
|
</button>
|
|
</div>
|
|
<div class="btn-group colvis-button-bar" id="button-bar-playlists"></div>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<table class="display playlists_table" id="playlists_table-SID-${data['section_id']}" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th align="left" id="playlistTitle">Playlist Title</th>
|
|
<th align="left" id="playlistLeafCount">Playlist Items</th>
|
|
<th align="left" id="playlistDuration">Playlist Duration</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% if _session['user_group'] == 'admin':
|
|
<div role="tabpanel" class="tab-pane" id="tabs-export">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class='table-card-header'>
|
|
<div class="header-bar">
|
|
<span>
|
|
<i class="fa fa-file-export"></i> Metadata Exports for <strong>
|
|
<span class="set-username">${data['section_name']}</span>
|
|
</strong>
|
|
</span>
|
|
</div>
|
|
<div class="button-bar">
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark export-button" id="toggle-export-modal" data-toggle="modal" data-target="#export-modal"
|
|
data-section_id="${data['section_id']}" data-media_type="${'photoalbum' if data['section_type'] == 'photo' else data['section_type']}"
|
|
data-export_type="all">
|
|
<i class="fa fa-file-export"></i> Export metadata
|
|
</button>
|
|
</div>
|
|
<div class="btn-group">
|
|
<button class="btn btn-dark refresh-export-table-button" id="refresh-export-table">
|
|
<i class="fa fa-refresh"></i> Refresh exports
|
|
</button>
|
|
</div>
|
|
<div class="btn-group colvis-button-bar" id="button-bar-export"></div>
|
|
</div>
|
|
</div>
|
|
<div class="table-card-back">
|
|
<table class="display export_table" id="export_table-SID-${data['section_id']}" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th align="left" id="timestamp">Exported At</th>
|
|
<th align="left" id="media_type_title">Media Type</th>
|
|
<th align="left" id="rating_key">Rating Key</th>
|
|
<th align="left" id="filename">Filename</th>
|
|
<th align="left" id="file_format">File Format</th>
|
|
<th align="left" id="metadata_level">Metadata Level</th>
|
|
<th align="left" id="media_info_level">Media Info Level</th>
|
|
<th align="left" id="media_info_level">Custom Fields</th>
|
|
<th align="left" id="file_size">File Size</th>
|
|
<th align="left" id="complete">Download</th>
|
|
<th align="left" id="delete">Delete</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer></footer>
|
|
% 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 library information. Please see the logs for more details.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
</%def>
|
|
|
|
<%def name="modalIncludes()">
|
|
<div id="edit-library-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="edit-library-modal">
|
|
</div>
|
|
<div class="modal fade" id="info-modal" tabindex="-1" role="dialog" aria-labelledby="info-modal">
|
|
</div>
|
|
<div class="modal fade" id="ip-info-modal" tabindex="-1" role="dialog" aria-labelledby="ip-info-modal">
|
|
</div>
|
|
<div class="modal fade" id="confirm-modal-delete" tabindex="-1" role="dialog" aria-labelledby="confirm-modal-delete">
|
|
<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 Delete</h4>
|
|
</div>
|
|
<div class="modal-body" style="text-align: center;">
|
|
<p>Are you REALLY sure you want to delete <strong><span id="deleteCount"></span></strong> history item(s)?</p>
|
|
<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-delete">Delete</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="export-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="export-modal">
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="javascriptIncludes()">
|
|
<script src="${http_root}js/jquery.dataTables.min.js"></script>
|
|
<script src="${http_root}js/dataTables.colVis.js"></script>
|
|
<script src="${http_root}js/dataTables.bootstrap.min.js"></script>
|
|
<script src="${http_root}js/dataTables.bootstrap.pagination.js"></script>
|
|
% if data:
|
|
<% from plexpy.common import LIVE_TV_SECTION_ID %>
|
|
<%
|
|
history_user_id = '' if _session['user_group'] == 'admin' else _session['user_id']
|
|
%>
|
|
<script>
|
|
% if str(data['section_id']).isdigit():
|
|
var section_id = ${data['section_id']};
|
|
% else:
|
|
var section_id = null;
|
|
% endif
|
|
var section_name = '${data['section_name'].replace("'", "\\'")}';
|
|
var refresh_table = false;
|
|
|
|
% if config['get_file_sizes']:
|
|
var get_file_sizes = false;
|
|
% else:
|
|
var get_file_sizes = null;
|
|
% endif
|
|
</script>
|
|
<script src="${http_root}js/tables/history_table.js${cache_param}"></script>
|
|
<script src="${http_root}js/tables/media_info_table.js${cache_param}"></script>
|
|
<script src="${http_root}js/tables/collections_table.js${cache_param}"></script>
|
|
<script src="${http_root}js/tables/playlists_table.js${cache_param}"></script>
|
|
<script src="${http_root}js/tables/export_table.js${cache_param}"></script>
|
|
<script>
|
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
|
|
});
|
|
|
|
$(".inactive-library-tooltip").tooltip();
|
|
|
|
function loadHistoryTable(transcode_decision) {
|
|
// Build watch history table
|
|
history_table_options.ajax = {
|
|
url: 'get_history',
|
|
type: 'POST',
|
|
data: function ( d ) {
|
|
return {
|
|
json_data: JSON.stringify( d ),
|
|
section_id: section_id,
|
|
user_id: "${history_user_id}",
|
|
transcode_decision: transcode_decision
|
|
};
|
|
}
|
|
};
|
|
history_table = $('#history_table-SID-${data["section_id"]}').DataTable(history_table_options);
|
|
|
|
var colvis = new $.fn.dataTable.ColVis(history_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark', exclude: [0, 12] });
|
|
$(colvis.button()).appendTo('#button-bar-history');
|
|
|
|
clearSearchButton('history_table-SID-${data["section_id"]}', history_table);
|
|
|
|
$('#transcode_decision-selection').on('change', function () {
|
|
$('#transcode_decision-selection > label').removeClass('active');
|
|
var selected_filter = $('input[name=transcode_decision-filter]:checked', '#transcode_decision-selection');
|
|
$(selected_filter).closest('label').addClass('active');
|
|
transcode_decision = $(selected_filter).map(function () { return $(this).val(); }).get().join(',');
|
|
setLocalStorage('library_' + section_id + 'history_transcode_decision', transcode_decision);
|
|
history_table.draw();
|
|
});
|
|
}
|
|
|
|
$('#nav-tabs-history').on('shown.bs.tab', function() {
|
|
if (typeof(history_table) === 'undefined') {
|
|
var transcode_decision = getLocalStorage('library_' + section_id + 'history_transcode_decision', 'all');
|
|
$.each(transcode_decision.split(','), function (i, item) {
|
|
var history_transcode_decision = $('#history-transcode_decision-' + item.replace(' ', '_'));
|
|
history_transcode_decision.prop('checked', true);
|
|
history_transcode_decision.closest('label').addClass('active');
|
|
});
|
|
|
|
loadHistoryTable(transcode_decision);
|
|
}
|
|
});
|
|
|
|
$("#refresh-history-list").click(function () {
|
|
history_table.draw();
|
|
});
|
|
</script>
|
|
% if data['section_type'] != 'photo':
|
|
<script>
|
|
function loadCollectionsTable() {
|
|
// Build collections table
|
|
collections_table_options.ajax = {
|
|
url: 'get_collections_list',
|
|
type: 'POST',
|
|
data: function ( d ) {
|
|
return {
|
|
json_data: JSON.stringify( d ),
|
|
section_id: section_id
|
|
};
|
|
}
|
|
};
|
|
collections_table = $('#collections_table-SID-${data["section_id"]}').DataTable(collections_table_options);
|
|
|
|
var colvis = new $.fn.dataTable.ColVis(collections_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
|
|
$(colvis.button()).appendTo('#button-bar-collections');
|
|
|
|
clearSearchButton('collections_table-SID-${data["section_id"]}', collections_table);
|
|
}
|
|
|
|
$('#nav-tabs-collections').on('shown.bs.tab', function() {
|
|
if (typeof(collections_table) === 'undefined') {
|
|
loadCollectionsTable();
|
|
}
|
|
});
|
|
|
|
$("#refresh-collections-table").click(function () {
|
|
collections_table.draw();
|
|
});
|
|
</script>
|
|
% endif
|
|
<script>
|
|
function loadPlaylistsTable() {
|
|
// Build playlists table
|
|
playlists_table_options.ajax = {
|
|
url: 'get_playlists_list',
|
|
type: 'POST',
|
|
data: function ( d ) {
|
|
return {
|
|
json_data: JSON.stringify( d ),
|
|
section_id: section_id
|
|
};
|
|
}
|
|
};
|
|
playlists_table = $('#playlists_table-SID-${data["section_id"]}').DataTable(playlists_table_options);
|
|
|
|
var colvis = new $.fn.dataTable.ColVis(playlists_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
|
|
$(colvis.button()).appendTo('#button-bar-playlists');
|
|
|
|
clearSearchButton('playlists_table-SID-${data["section_id"]}', playlists_table);
|
|
}
|
|
|
|
$('#nav-tabs-playlists').on('shown.bs.tab', function() {
|
|
if (typeof(playlists_table) === 'undefined') {
|
|
loadPlaylistsTable();
|
|
}
|
|
});
|
|
|
|
$("#refresh-playlists-table").click(function () {
|
|
playlists_table.draw();
|
|
});
|
|
|
|
function recentlyWatched() {
|
|
// Populate recently watched
|
|
$.ajax({
|
|
url: 'library_recently_watched',
|
|
async: true,
|
|
data: {
|
|
section_id: section_id,
|
|
limit: 50
|
|
},
|
|
complete: function(xhr, status) {
|
|
$("#library-recently-watched").html(xhr.responseText);
|
|
highlightScrollerButton("#recently-watched");
|
|
paginateScroller("#recently-watched", ".paginate-watched");
|
|
}
|
|
});
|
|
}
|
|
|
|
function recentlyAdded() {
|
|
// Populate recently added
|
|
$.ajax({
|
|
url: 'library_recently_added',
|
|
async: true,
|
|
data: {
|
|
section_id: section_id,
|
|
limit: 50
|
|
},
|
|
complete: function(xhr, status) {
|
|
$("#library-recently-added").html(xhr.responseText);
|
|
highlightScrollerButton("#recently-added");
|
|
paginateScroller("#recently-added", ".paginate-added");
|
|
}
|
|
});
|
|
}
|
|
|
|
recentlyWatched();
|
|
% if data['section_id'] != LIVE_TV_SECTION_ID:
|
|
recentlyAdded();
|
|
% endif
|
|
|
|
$('div.art-face').animate({ opacity: 0.2 }, { duration: 1000 });
|
|
|
|
$(document).ready(function () {
|
|
|
|
// Javascript to enable link to tab
|
|
var hash = document.location.hash;
|
|
var prefix = "tab_";
|
|
if (hash) {
|
|
$('.nav-list #nav-' + hash.replace('#' + prefix, "")).tab('show').trigger('show.bs.tab');
|
|
}
|
|
|
|
// Change hash for page-reload
|
|
$('.nav-list a').on('shown.bs.tab', function (e) {
|
|
window.location.hash = e.target.hash.replace("#", "#" + prefix);
|
|
});
|
|
|
|
// Populate watch time stats
|
|
$.ajax({
|
|
url: 'library_watch_time_stats',
|
|
async: true,
|
|
data: { section_id: section_id },
|
|
complete: function(xhr, status) {
|
|
$("#library-time-stats").html(xhr.responseText);
|
|
}
|
|
});
|
|
|
|
// Populate user stats
|
|
$.ajax({
|
|
url: 'library_user_stats',
|
|
async: true,
|
|
data: { section_id: section_id },
|
|
complete: function(xhr, status) {
|
|
$("#library-user-stats").html(xhr.responseText);
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
% if _session['user_group'] == 'admin':
|
|
<script>
|
|
function loadMediaInfoTable() {
|
|
// Build media info table
|
|
media_info_table_options.ajax = {
|
|
url: 'get_library_media_info',
|
|
type: 'POST',
|
|
data: function ( d ) {
|
|
return {
|
|
json_data: JSON.stringify( d ),
|
|
section_id: section_id,
|
|
refresh: refresh_table
|
|
};
|
|
}
|
|
};
|
|
media_info_table = $('#media_info_table-SID-${data["section_id"]}').DataTable(media_info_table_options);
|
|
|
|
var colvis = new $.fn.dataTable.ColVis(media_info_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
|
|
$(colvis.button()).appendTo('#button-bar-media-info');
|
|
|
|
clearSearchButton('media_info_table-SID-${data["section_id"]}', media_info_table);
|
|
}
|
|
|
|
$('#nav-tabs-mediainfo').on('shown.bs.tab', function() {
|
|
if (typeof(media_info_table) === 'undefined') {
|
|
loadMediaInfoTable();
|
|
}
|
|
});
|
|
|
|
$("#refresh-media-info-table").click(function () {
|
|
media_info_child_table = {};
|
|
refresh_table = true;
|
|
refresh_child_tables = true;
|
|
media_info_table.draw();
|
|
refresh_table = false;
|
|
});
|
|
|
|
function loadExportTable() {
|
|
// Build export table
|
|
export_table_options.ajax = {
|
|
url: 'get_export_list',
|
|
type: 'POST',
|
|
data: function ( d ) {
|
|
return {
|
|
json_data: JSON.stringify( d ),
|
|
section_id: section_id
|
|
};
|
|
}
|
|
};
|
|
export_table = $('#export_table-SID-${data["section_id"]}').DataTable(export_table_options);
|
|
export_table.columns([7]).visible(false);
|
|
|
|
var colvis = new $.fn.dataTable.ColVis(export_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' });
|
|
$(colvis.button()).appendTo('#button-bar-export');
|
|
|
|
clearSearchButton('export_table-SID-${data["section_id"]}', export_table);
|
|
}
|
|
|
|
$('#nav-tabs-export').on('shown.bs.tab', function() {
|
|
if (typeof(export_table) === 'undefined') {
|
|
loadExportTable();
|
|
}
|
|
});
|
|
|
|
$("#refresh-export-table").click(function () {
|
|
export_table.draw();
|
|
});
|
|
|
|
$("#edit-library-tooltip").tooltip();
|
|
|
|
// Load edit library modal
|
|
$("#toggle-edit-library-modal").click(function() {
|
|
$("#edit-library-tooltip").tooltip('hide');
|
|
$.ajax({
|
|
url: 'edit_library_dialog',
|
|
data: { section_id: section_id },
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#edit-library-modal").html(xhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
|
|
$(".export-button").click(function() {
|
|
$.ajax({
|
|
url: 'export_metadata_modal',
|
|
data: {
|
|
section_id: $(this).data('section_id'),
|
|
media_type: $(this).data('media_type'),
|
|
sub_media_type: $(this).data('sub_media_type'),
|
|
export_type: $(this).data('export_type')
|
|
},
|
|
cache: false,
|
|
async: true,
|
|
complete: function(xhr, status) {
|
|
$("#export-modal").html(xhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
|
|
$('#row-edit-mode').on('click', function() {
|
|
if ($(this).hasClass('active')) {
|
|
$(this).tooltip('destroy');
|
|
|
|
if (history_to_delete.length > 0) {
|
|
$('#deleteCount').text(history_to_delete.length);
|
|
$('#confirm-modal-delete').modal();
|
|
$('#confirm-modal-delete').one('click', '#confirm-delete', function () {
|
|
$.ajax({
|
|
url: 'delete_history_rows',
|
|
type: 'POST',
|
|
data: { row_ids: history_to_delete.join(',') },
|
|
async: true,
|
|
success: function (data) {
|
|
var msg = "History deleted";
|
|
showMsg(msg, false, true, 2000);
|
|
history_table.draw();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
$('.delete-control').each(function () {
|
|
$(this).addClass('hidden');
|
|
$('#row-edit-mode-alert').fadeOut(200);
|
|
});
|
|
|
|
} else {
|
|
$(this).tooltip({
|
|
container: '.body-container',
|
|
placement: 'bottom',
|
|
title: 'Select rows to delete. Data is deleted upon exiting delete mode.',
|
|
trigger: 'manual'
|
|
}).tooltip('show');
|
|
|
|
history_to_delete = [];
|
|
$('.delete-control').each(function() {
|
|
$(this).find('button.btn-danger').toggleClass('btn-warning').toggleClass('btn-danger');
|
|
$(this).removeClass('hidden');
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
% endif
|
|
% endif
|
|
</%def> |