-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter history by local and remote plays #1961
base: nightly
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,57 +16,74 @@ | |||||
</div> | ||||||
% endif | ||||||
<div class='table-card-header'> | ||||||
<div class="header-bar"> | ||||||
<div class="header-bar" style="margin-top: 2.4rem;"> | ||||||
<span><i class="fa fa-history"></i> History</span> | ||||||
</div> | ||||||
<div class="button-bar"> | ||||||
% if _session['user_group'] == 'admin': | ||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> </div> | ||||||
<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 id="history-option-container" class="container"> | ||||||
<div class="button-bar history-option-bar" style="float: left;"> | ||||||
% if _session['user_group'] == 'admin': | ||||||
<div class="alert alert-danger alert-edit" role="alert" id="row-edit-mode-alert"><i class="fa fa-exclamation-triangle"></i> </div> | ||||||
<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 | ||||||
% if _session['user_group'] == 'admin': | ||||||
<div class="btn-group" id="user-selection"> | ||||||
<label> | ||||||
<select name="history-user" id="history-user" class="btn" style="color: inherit;"> | ||||||
<option value="">All Users</option> | ||||||
<option disabled>────────────</option> | ||||||
</select> | ||||||
</label> | ||||||
</div> | ||||||
% endif | ||||||
</div> | ||||||
% endif | ||||||
% if _session['user_group'] == 'admin': | ||||||
<div class="btn-group" id="user-selection"> | ||||||
<label> | ||||||
<select name="history-user" id="history-user" class="btn" style="color: inherit;"> | ||||||
<option value="">All Users</option> | ||||||
<option disabled>────────────</option> | ||||||
</select> | ||||||
</label> | ||||||
<div class="button-bar history-option-bar"> | ||||||
<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"></div> | ||||||
</div> | ||||||
% endif | ||||||
<div class="btn-group" data-toggle="buttons" id="media_type-selection"> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-movie" value="movie" autocomplete="off"><i class="fa fa-film"></i> Movies | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-episode" value="episode" autocomplete="off"><i class="fa fa-television"></i> TV Shows | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-track" value="track" autocomplete="off"><i class="fa fa-music"></i> Music | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-live" value="live" autocomplete="off"><i class="fa fa-broadcast-tower"></i> Live TV | ||||||
</label> | ||||||
<div class="button-bar history-option-bar"> | ||||||
<div class="btn-group-justified history-option-button-group" data-toggle="buttons" id="media_type-selection" style="padding-right: 0.5rem;"> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-movie" value="movie" autocomplete="off"><i class="fa fa-film"></i> Movies | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-episode" value="episode" autocomplete="off"><i class="fa fa-television"></i> TV Shows | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-track" value="track" autocomplete="off"><i class="fa fa-music"></i> Music | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="media_type-filter" id="history-media_type-live" value="live" autocomplete="off"><i class="fa fa-broadcast-tower"></i> Live TV | ||||||
</label> | ||||||
</div> | ||||||
<div class="btn-group-justified history-option-button-group" data-toggle="buttons" id="network_type-selection" style="padding-right: 0.5rem;"> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="network_type-filter" id="history-network_type-lan" value="lan" autocomplete="off"><i class="fa fa-server"></i> Local Play | ||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote Play | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="network_type-filter" id="history-network_type-cellular" value="cellular" autocomplete="off"><i class="fa fa-broadcast-tower"></i> Mobile Play | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</label> | ||||||
</div> | ||||||
<div class="btn-group-justified history-option-button-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-copy" 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> | ||||||
<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-copy" 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"></div> | ||||||
</div> | ||||||
</div> | ||||||
<div class="table-card-back"> | ||||||
|
@@ -145,14 +162,15 @@ <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4> | |||||
} | ||||||
}); | ||||||
|
||||||
function loadHistoryTable(media_type, transcode_decision, selected_user_id) { | ||||||
function loadHistoryTable(media_type, network_type, transcode_decision, selected_user_id) { | ||||||
history_table_options.ajax = { | ||||||
url: 'get_history', | ||||||
type: 'POST', | ||||||
data: function (d) { | ||||||
return { | ||||||
json_data: JSON.stringify(d), | ||||||
media_type: media_type, | ||||||
network_type: network_type, | ||||||
transcode_decision: transcode_decision, | ||||||
user_id: selected_user_id | ||||||
}; | ||||||
|
@@ -170,16 +188,25 @@ <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4> | |||||
|
||||||
$('#media_type-selection').on('change', function () { | ||||||
$('#media_type-selection > label').removeClass('active'); | ||||||
var selected_filter = $('input[name=media_type-filter]:checked', '#media_type-selection'); | ||||||
let selected_filter = $('input[name=media_type-filter]:checked', '#media_type-selection'); | ||||||
$(selected_filter).closest('label').addClass('active'); | ||||||
media_type = $(selected_filter).map(function () { return $(this).val(); }).get().join(','); | ||||||
setLocalStorage('history_media_type', media_type); | ||||||
history_table.draw(); | ||||||
}); | ||||||
|
||||||
$('#network_type-selection').on('change', function () { | ||||||
$('#network_type-selection > label').removeClass('active'); | ||||||
let selected_filter = $('input[name=network_type-filter]:checked', '#network_type-selection'); | ||||||
$(selected_filter).closest('label').addClass('active'); | ||||||
network_type = $(selected_filter).map(function () { return $(this).val(); }).get().join(','); | ||||||
setLocalStorage('history_network_type', network_type); | ||||||
history_table.draw(); | ||||||
}); | ||||||
|
||||||
$('#transcode_decision-selection').on('change', function () { | ||||||
$('#transcode_decision-selection > label').removeClass('active'); | ||||||
var selected_filter = $('input[name=transcode_decision-filter]:checked', '#transcode_decision-selection'); | ||||||
let 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('history_transcode_decision', transcode_decision); | ||||||
|
@@ -192,23 +219,30 @@ <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4> | |||||
}); | ||||||
} | ||||||
|
||||||
var selected_user_id = "${_session['user_group']}" == "admin" ? null : "${_session['user_id']}"; | ||||||
const selected_user_id = "${_session['user_group']}" == "admin" ? null : "${_session['user_id']}"; | ||||||
|
||||||
var media_type = getLocalStorage('history_media_type', 'all'); | ||||||
const media_type = getLocalStorage('history_media_type', 'all'); | ||||||
$.each(media_type.split(','), function (i, item) { | ||||||
var history_media_type = $('#history-media_type-' + item); | ||||||
let history_media_type = $('#history-media_type-' + item); | ||||||
history_media_type.prop('checked', true); | ||||||
history_media_type.closest('label').addClass('active'); | ||||||
}); | ||||||
|
||||||
var transcode_decision = getLocalStorage('history_transcode_decision', 'all'); | ||||||
const network_type = getLocalStorage('history_network_type', ''); | ||||||
$.each(network_type.split(','), function (i, item) { | ||||||
let history_network_type = $('#history-network_type-' + item); | ||||||
history_network_type.prop('checked', true); | ||||||
history_network_type.closest('label').addClass('active'); | ||||||
}); | ||||||
|
||||||
const transcode_decision = getLocalStorage('history_transcode_decision', 'all'); | ||||||
$.each(transcode_decision.split(','), function (i, item) { | ||||||
var history_transcode_decision = $('#history-transcode_decision-' + item.replace(' ', '_')); | ||||||
let history_transcode_decision = $('#history-transcode_decision-' + item.replace(' ', '_')); | ||||||
history_transcode_decision.prop('checked', true); | ||||||
history_transcode_decision.closest('label').addClass('active'); | ||||||
}); | ||||||
|
||||||
loadHistoryTable(media_type, transcode_decision, selected_user_id); | ||||||
loadHistoryTable(media_type, network_type, transcode_decision, selected_user_id); | ||||||
|
||||||
% if _session['user_group'] == 'admin': | ||||||
$('#row-edit-mode').on('click', function() { | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -216,6 +216,17 @@ | |||||
</button> | ||||||
</div> | ||||||
% endif | ||||||
<div class="btn-group" data-toggle="buttons" id="network_type-selection"> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="network_type-filter" id="history-network_type-lan" value="lan" autocomplete="off"><i class="fa fa-server"></i> Local Play | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote Play | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</label> | ||||||
<label class="btn btn-dark btn-filter"> | ||||||
<input type="checkbox" name="network_type-filter" id="history-network_type-cellular" value="cellular" autocomplete="off"><i class="fa fa-broadcast-tower"></i> Mobile Play | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</label> | ||||||
</div> | ||||||
<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 | ||||||
|
@@ -567,7 +578,7 @@ <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4> | |||||
|
||||||
$(".inactive-library-tooltip").tooltip(); | ||||||
|
||||||
function loadHistoryTable(transcode_decision) { | ||||||
function loadHistoryTable(network_type, transcode_decision) { | ||||||
// Build watch history table | ||||||
history_table_options.ajax = { | ||||||
url: 'get_history', | ||||||
|
@@ -577,6 +588,7 @@ <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4> | |||||
json_data: JSON.stringify( d ), | ||||||
section_id: section_id, | ||||||
user_id: "${history_user_id}", | ||||||
network_type: network_type, | ||||||
transcode_decision: transcode_decision | ||||||
}; | ||||||
} | ||||||
|
@@ -590,24 +602,38 @@ <h4 class="modal-title" id="myModalLabel">Confirm Delete</h4> | |||||
|
||||||
$('#transcode_decision-selection').on('change', function () { | ||||||
$('#transcode_decision-selection > label').removeClass('active'); | ||||||
var selected_filter = $('input[name=transcode_decision-filter]:checked', '#transcode_decision-selection'); | ||||||
let 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(); | ||||||
}); | ||||||
|
||||||
$('#network_type-selection').on('change', function () { | ||||||
$('#network_type-selection > label').removeClass('active'); | ||||||
let selected_filter = $('input[name=network_type-filter]:checked', '#network_type-selection'); | ||||||
$(selected_filter).closest('label').addClass('active'); | ||||||
network_type = $(selected_filter).map(function () { return $(this).val(); }).get().join(','); | ||||||
setLocalStorage('library_' + section_id + 'history_network_type', network_type); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
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'); | ||||||
const transcode_decision = getLocalStorage('library_' + section_id + 'history_transcode_decision', 'all'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Also fix |
||||||
$.each(transcode_decision.split(','), function (i, item) { | ||||||
var history_transcode_decision = $('#history-transcode_decision-' + item.replace(' ', '_')); | ||||||
let history_transcode_decision = $('#history-transcode_decision-' + item.replace(' ', '_')); | ||||||
history_transcode_decision.prop('checked', true); | ||||||
history_transcode_decision.closest('label').addClass('active'); | ||||||
}); | ||||||
|
||||||
loadHistoryTable(transcode_decision); | ||||||
const network_type = getLocalStorage('library_' + section_id + 'history_network_type', ''); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$.each(network_type.split(','), function (i, item) { | ||||||
let history_network_type = $('#history-network_type-' + item); | ||||||
history_network_type.prop('checked', true); | ||||||
history_network_type.closest('label').addClass('active'); | ||||||
}); | ||||||
loadHistoryTable(network_type, transcode_decision); | ||||||
} | ||||||
}); | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.