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?
Conversation
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.
I'm not a fan of the "box" design for the filters. But I also don't have a better suggestion at the moment.
@@ -1898,6 +1898,7 @@ def get_history(self, user=None, user_id=None, grouping=None, include_activity=N | |||
after (str): History after and including the date, "YYYY-MM-DD" | |||
section_id (int): 2 | |||
media_type (str): "movie", "episode", "track", "live" | |||
network_type (str): "lan", "wan", "cellular" |
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.
Rename network_type
to location
so it is consistent with the rest of the API (i.e. get_activity
and get_history
).
history_network_type.closest('label').addClass('active'); | ||
}); | ||
|
||
const transcode_decision = getLocalStorage('user_' + user_id + 'history_transcode_decision', 'all'); |
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.
const transcode_decision = getLocalStorage('user_' + user_id + 'history_transcode_decision', 'all'); | |
const transcode_decision = getLocalStorage('user_' + user_id + '-history_transcode_decision', 'all'); |
Also fix setLocalStoage
on line 598.
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('user_' + user_id + 'history_network_type', network_type); |
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.
setLocalStorage('user_' + user_id + 'history_network_type', network_type); | |
setLocalStorage('user_' + user_id + '-history_network_type', network_type); |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
const network_type = getLocalStorage('library_' + section_id + 'history_network_type', ''); | |
const network_type = getLocalStorage('library_' + section_id + '-history_network_type', ''); |
} | ||
|
||
$('#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 comment
The reason will be displayed to describe this comment to others. Learn more.
const transcode_decision = getLocalStorage('library_' + section_id + 'history_transcode_decision', 'all'); | |
const transcode_decision = getLocalStorage('library_' + section_id + '-history_transcode_decision', 'all'); |
Also fix setLocalStoage
on line 608.
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote Play | |
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote |
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote Play | ||
</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 comment
The reason will be displayed to describe this comment to others. Learn more.
<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 | |
<input type="checkbox" name="network_type-filter" id="history-network_type-cellular" value="cellular" autocomplete="off"><i class="fa fa-broadcast-tower"></i> Mobile |
</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 |
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.
<input type="checkbox" name="network_type-filter" id="history-network_type-lan" value="lan" autocomplete="off"><i class="fa fa-server"></i> Local Play | |
<input type="checkbox" name="network_type-filter" id="history-network_type-lan" value="lan" autocomplete="off"><i class="fa fa-laptop-house"></i> Local |
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote Play | |
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote |
<input type="checkbox" name="network_type-filter" id="history-network_type-wan" value="wan" autocomplete="off"><i class="fa fa-globe"></i> Remote Play | ||
</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 comment
The reason will be displayed to describe this comment to others. Learn more.
<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 | |
<input type="checkbox" name="network_type-filter" id="history-network_type-cellular" value="cellular" autocomplete="off"><i class="fa fa-broadcast-tower"></i> Mobile |
Description
This PR aims to implement feature request #1813 by adding a filter for the history table to filter on elements played in the local network (lan), played remote (wan) or mobile (cellular).
The settings/filter bar has partly been reworked to account for the space needed by the new buttons. With this re-arrangement additional filters, selections or buttons can be integrated in the yet free space.
Components:
Open points:
Screenshot
History
Library History
User History
Type of Change
Please delete options that are not relevant.
Checklist