mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added library grouping settings.
This commit is contained in:
parent
dc1da009b3
commit
d0f7690950
9 changed files with 80 additions and 30 deletions
|
@ -102,13 +102,7 @@
|
|||
|
||||
function loadlibraryButtons(elem, userId, index) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "SortName",
|
||||
Fields: "PrimaryImageAspectRatio"
|
||||
};
|
||||
|
||||
var promise1 = ApiClient.getItems(userId, options);
|
||||
var promise1 = ApiClient.getUserViews(userId);
|
||||
|
||||
var promise2 = ApiClient.getLiveTvInfo();
|
||||
|
||||
|
@ -210,13 +204,7 @@
|
|||
|
||||
function loadLibraryTiles(elem, userId) {
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "SortName",
|
||||
Fields: "PrimaryImageAspectRatio"
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
ApiClient.getUserViews(userId).done(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -338,11 +326,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
var homePageDismissValue = '2';
|
||||
|
||||
function dismissWelcome(page, userId) {
|
||||
|
||||
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
||||
|
||||
result.CustomPrefs.homePageWelcomeDismissed = '1';
|
||||
result.CustomPrefs.homePageWelcomeDismissed = homePageDismissValue;
|
||||
ApiClient.updateDisplayPreferences('home', result, userId, 'webclient').done(function() {
|
||||
|
||||
$('.welcomeMessage', page).hide();
|
||||
|
@ -369,7 +359,7 @@
|
|||
|
||||
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
||||
|
||||
if (result.CustomPrefs.homePageWelcomeDismissed) {
|
||||
if (result.CustomPrefs.homePageWelcomeDismissed == homePageDismissValue) {
|
||||
$('.welcomeMessage', page).hide();
|
||||
} else {
|
||||
$('.welcomeMessage', page).show();
|
||||
|
|
|
@ -97,11 +97,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItems(userId, {
|
||||
|
||||
SortBy: "SortName"
|
||||
|
||||
}).done(function (result) {
|
||||
ApiClient.getUserViews(userId).done(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@
|
|||
userId: Dashboard.getCurrentUserId(),
|
||||
categoryLimit: screenWidth >= 1200 ? 6 : 3,
|
||||
itemLimit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
ParentId: parentId
|
||||
Fields: "PrimaryImageAspectRatio"
|
||||
});
|
||||
|
||||
$.getJSON(url).done(function (recommendations) {
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
|
||||
}).on('pagebeforeshow', "#musicVideosPage", function () {
|
||||
|
||||
//query.ParentId = LibraryMenu.getTopParentId();
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var limit = LibraryBrowser.getDefaultPageSize();
|
||||
|
||||
|
|
|
@ -7,7 +7,35 @@
|
|||
|
||||
$('#chkGroupMoviesIntoCollections', page).checked(user.Configuration.GroupMoviesIntoBoxSets || false).checkboxradio("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
ApiClient.getItems(user.Id, {}).done(function (result) {
|
||||
|
||||
var folderHtml = '';
|
||||
|
||||
folderHtml += '<div data-role="controlgroup">';
|
||||
folderHtml += result.Items.map(function (i) {
|
||||
|
||||
var currentHtml = '';
|
||||
|
||||
var id = 'chkGroupFolder' + i.Id;
|
||||
|
||||
currentHtml += '<label for="' + id + '">' + i.Name + '</label>';
|
||||
|
||||
var isChecked = user.Configuration.ExcludeFoldersFromGrouping.indexOf(i.Id) == -1;
|
||||
var checkedHtml = isChecked ? ' checked="checked"' : '';
|
||||
|
||||
currentHtml += '<input class="chkGroupFolder" data-folderid="' + i.Id + '" type="checkbox" data-mini="true" id="' + id + '"' + checkedHtml + ' />';
|
||||
|
||||
return currentHtml;
|
||||
|
||||
}).join('');
|
||||
|
||||
folderHtml += '</div>';
|
||||
|
||||
$('.folderGroupList', page).html(folderHtml).trigger('create');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function saveUser(page, user) {
|
||||
|
@ -16,6 +44,11 @@
|
|||
user.Configuration.DisplayUnairedEpisodes = $('#chkDisplayUnairedEpisodes', page).checked();
|
||||
user.Configuration.GroupMoviesIntoBoxSets = $('#chkGroupMoviesIntoCollections', page).checked();
|
||||
|
||||
user.Configuration.ExcludeFoldersFromGrouping = $(".chkGroupFolder:not(:checked)", page).get().map(function (i) {
|
||||
|
||||
return i.getAttribute('data-folderid');
|
||||
});
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
Dashboard.alert(Globalize.translate('SettingsSaved'));
|
||||
});
|
||||
|
@ -30,9 +63,9 @@
|
|||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getUser(userId).done(function (result) {
|
||||
|
||||
|
||||
saveUser(page, result);
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
|
@ -57,7 +90,7 @@
|
|||
loadForm(page, user);
|
||||
|
||||
});
|
||||
|
||||
|
||||
}).on('pageshow', ".userPreferencesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue