diff --git a/data/interfaces/default/history.html b/data/interfaces/default/history.html
index 521fb8a4..17f8a76e 100644
--- a/data/interfaces/default/history.html
+++ b/data/interfaces/default/history.html
@@ -46,53 +46,6 @@
% if metadata['type'] == 'episode' or metadata['type'] == 'movie':
% if metadata['directors']:
- Directed by ${metadata['directors'][0]}
+ Directed by ${metadata['directors'][0]}
% else:
- Directed by unknown
+ Directed by unknown
% endif
% elif metadata['type'] == 'show':
- Studio ${metadata['studio']}
+ Studio ${metadata['studio']}
% endif
@@ -152,6 +190,10 @@
<%def name="javascriptIncludes()">
+
+
+
+
% if metadata:
% if metadata['type'] == 'movie':
% endif
+ % if metadata['type'] == 'movie' or metadata['type'] == 'episode':
+
+
+ %endif
% endif
%def>
diff --git a/data/interfaces/default/js/tables/history_table.js b/data/interfaces/default/js/tables/history_table.js
new file mode 100644
index 00000000..fc02822a
--- /dev/null
+++ b/data/interfaces/default/js/tables/history_table.js
@@ -0,0 +1,180 @@
+var date_format = 'YYYY-MM-DD';
+var time_format = 'hh:mm a';
+
+$.ajax({
+ url: 'get_date_formats',
+ type: 'GET',
+ success: function(data) {
+ date_format = data.date_format;
+ time_format = data.time_format;
+ }
+});
+
+history_table_options = {
+ "destroy": true,
+ "language": {
+ "search": "Search: ",
+ "lengthMenu":"Show _MENU_ entries per page",
+ "info":"Showing _START_ to _END_ of _TOTAL_ history items",
+ "infoEmpty":"Showing 0 to 0 of 0 entries",
+ "infoFiltered":"(filtered from _MAX_ total entries)",
+ "emptyTable": "No data in table",
+ },
+ "stateSave": true,
+ "sPaginationType": "bootstrap",
+ "processing": false,
+ "serverSide": true,
+ "pageLength": 10,
+ "order": [ 1, 'desc'],
+ "columnDefs": [
+ {
+ "targets": [0],
+ "data":"id",
+ "visible": false,
+ "searchable": false
+ },
+ {
+ "targets": [1],
+ "data":"date",
+ "createdCell": function (td, cellData, rowData, row, col) {
+ if (rowData['stopped'] === null) {
+ $(td).addClass('currentlyWatching');
+ $(td).html('Currently watching...');
+ } else {
+ $(td).html(moment(cellData,"X").format(date_format));
+ }
+ },
+ "searchable": false
+ },
+ {
+ "targets": [2],
+ "data":"user"
+ },
+ {
+ "targets": [3],
+ "data":"platform",
+ "createdCell": function (td, cellData, rowData, row, col) {
+ if (cellData !== '') {
+ $(td).html('
 '+cellData);
+ }
+ },
+ "className": "modal-control"
+ },
+ {
+ "targets": [4],
+ "data":"ip_address",
+ "createdCell": function (td, cellData, rowData, row, col) {
+ if ((cellData == '') || (cellData == '0')) {
+ $(td).html('n/a');
+ }
+ }
+ },
+ {
+ "targets": [5],
+ "data":"title",
+ "name":"title",
+ "createdCell": function (td, cellData, rowData, row, col) {
+ if (cellData !== '') {
+ $(td).html('
' + cellData + '');
+ }
+ }
+ },
+ {
+ "targets": [6],
+ "data":"started",
+ "render": function ( data, type, full ) {
+ return moment(data, "X").format(time_format);
+ },
+ "searchable": false
+ },
+ {
+ "targets": [7],
+ "data":"paused_counter",
+ "render": function ( data, type, full ) {
+ return Math.round(moment.duration(data, 'seconds').as('minutes')) + ' mins';
+ },
+ "searchable": false
+ },
+ {
+ "targets": [8],
+ "data":"stopped",
+ "render": function ( data, type, full ) {
+ if (data !== null) {
+ return moment(data, "X").format(time_format);
+ } else {
+ return data;
+ }
+ },
+ "searchable": false
+ },
+ {
+ "targets": [9],
+ "data":"duration",
+ "render": function ( data, type, full ) {
+ if (data !== null) {
+ return Math.round(moment.duration(data, 'seconds').as('minutes')) + ' mins';
+ } else {
+ return data;
+ }
+ },
+ "searchable": false
+ },
+ {
+ "targets": [10],
+ "data":"percent_complete",
+ "orderable": false,
+ "render": function ( data, type, full ) {
+ if (data < 95) {
+ return '
'+Math.round(data)+'%';
+ } else {
+ return '
100%';
+ }
+ },
+ "searchable": false
+ },
+ {
+ "targets": [11],
+ "data":"rating_key",
+ "visible": false,
+ "searchable": false
+ },
+ {
+ "targets": [12],
+ "data":"xml",
+ "searchable":false,
+ "visible":false
+ }
+ ],
+ "drawCallback": function (settings) {
+ // Jump to top of page
+ // $('html,body').scrollTop(0);
+ $('#ajaxMsg').addClass('success').fadeOut();
+ },
+ "preDrawCallback": function(settings) {
+ $('#ajaxMsg').html("
Fetching rows...
");
+ $('#ajaxMsg').addClass('success').fadeIn();
+ }
+}
+
+$('#history_table').on('mouseenter', 'td.modal-control span', function () {
+ $(this).tooltip();
+});
+
+$('#history_table').on('click', 'td.modal-control', function () {
+ var tr = $(this).parents('tr');
+ var row = history_table.row( tr );
+ var rowData = row.data();
+
+ function showStreamDetails() {
+ $.ajax({
+ url: 'get_stream_data',
+ data: {row_id: rowData['id'], user: rowData['user']},
+ cache: false,
+ async: true,
+ complete: function(xhr, status) {
+ $("#info-modal").html(xhr.responseText);
+ }
+ });
+ }
+ showStreamDetails();
+});
\ No newline at end of file
diff --git a/data/interfaces/default/stream_data.html b/data/interfaces/default/stream_data.html
new file mode 100644
index 00000000..fd3d899f
--- /dev/null
+++ b/data/interfaces/default/stream_data.html
@@ -0,0 +1,52 @@
+% if data is not None:
+
+
+
+
Stream Details
+
+ Video
+ - Stream Type: ${data['transcode_video_dec']}
+ - Video Resolution: ${data['transcode_height']}p
+ - Video Codec: ${data['transcode_video_codec']}
+ - Video Width: ${data['transcode_width']}
+ - Video Height: ${data['transcode_height']}
+
+
+ Audio
+ - Stream Type: ${data['transcode_audio_dec']}
+ - Audio Codec: ${data['transcode_audio_codec']}
+ - Audio Channels: ${data['transcode_audio_channels']}
+
+
+
+
Media Source Details
+ Container: ${data['container']}
+ Resolution: ${data['height']}p
+ Bitrate: ${data['bitrate']} kbps
+
+
+
Video Source Details
+
+ - Width: ${data['width']}
+ - Height: ${data['height']}
+ - Aspect Ratio: ${data['aspect_ratio']}
+ - Video Frame Rate: ${data['video_framerate']}
+ - Video Codec: ${data['video_codec']}
+
+
+
Audio Source Details
+
+ - Audio Codec: ${data['audio_codec']}
+ - Audio Channels: ${data['audio_channels']}
+
+
+
+
+% endif
\ No newline at end of file
diff --git a/data/interfaces/default/user.html b/data/interfaces/default/user.html
index 3f000be9..46d36fdf 100644
--- a/data/interfaces/default/user.html
+++ b/data/interfaces/default/user.html
@@ -121,17 +121,76 @@
- Table
-