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
|
@ -204,7 +204,6 @@
|
||||||
|
|
||||||
.musicViewMenu {
|
.musicViewMenu {
|
||||||
background-image: url(images/items/folders/music.png);
|
background-image: url(images/items/folders/music.png);
|
||||||
background-position: 14px 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.homeViewMenu {
|
.homeViewMenu {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
|
|
||||||
<div class="ui-bar-b readOnlyContent welcomeMessage" style="display: none; padding: 2em; border-radius: 10px; margin: 1em auto; font-weight: normal;">
|
<div class="ui-bar-b readOnlyContent welcomeMessage" style="display: none; padding: 2em; border-radius: 10px; margin: 2em auto; font-weight: normal;">
|
||||||
<h1 style="margin-top: 0;">${HeaderWelcomeToMediaBrowserWebClient}</h1>
|
<h1 style="margin-top: 0;">${HeaderWelcomeToMediaBrowserWebClient}</h1>
|
||||||
<p>${MessageLearnHowToCustomize}</p>
|
<p>${MessageLearnHowToCustomize}</p>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -14,6 +14,22 @@
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<form class="displayPreferencesForm" style="margin: 0 auto;">
|
<form class="displayPreferencesForm" style="margin: 0 auto;">
|
||||||
|
|
||||||
|
<div class="detailSectionHeader" style="margin: 0 .5em;">
|
||||||
|
${HeaderLibraryViews}
|
||||||
|
</div>
|
||||||
|
<div style="margin: 0 1em;">
|
||||||
|
<p>${LabelSelectFolderGroups}</p>
|
||||||
|
<div class="folderGroupList"></div>
|
||||||
|
<div class="fieldDescription">${LabelSelectFolderGroupsHelp}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<div class="detailSectionHeader" style="margin: 0 .5em;">
|
||||||
|
${HeaderOtherDisplaySettings}
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul data-role="listview" class="ulForm">
|
<ul data-role="listview" class="ulForm">
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" id="chkDisplayMissingEpisodes" data-mini="true" />
|
<input type="checkbox" id="chkDisplayMissingEpisodes" data-mini="true" />
|
||||||
|
|
|
@ -102,13 +102,7 @@
|
||||||
|
|
||||||
function loadlibraryButtons(elem, userId, index) {
|
function loadlibraryButtons(elem, userId, index) {
|
||||||
|
|
||||||
var options = {
|
var promise1 = ApiClient.getUserViews(userId);
|
||||||
|
|
||||||
SortBy: "SortName",
|
|
||||||
Fields: "PrimaryImageAspectRatio"
|
|
||||||
};
|
|
||||||
|
|
||||||
var promise1 = ApiClient.getItems(userId, options);
|
|
||||||
|
|
||||||
var promise2 = ApiClient.getLiveTvInfo();
|
var promise2 = ApiClient.getLiveTvInfo();
|
||||||
|
|
||||||
|
@ -210,13 +204,7 @@
|
||||||
|
|
||||||
function loadLibraryTiles(elem, userId) {
|
function loadLibraryTiles(elem, userId) {
|
||||||
|
|
||||||
var options = {
|
ApiClient.getUserViews(userId).done(function (result) {
|
||||||
|
|
||||||
SortBy: "SortName",
|
|
||||||
Fields: "PrimaryImageAspectRatio"
|
|
||||||
};
|
|
||||||
|
|
||||||
ApiClient.getItems(userId, options).done(function (result) {
|
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
|
@ -338,11 +326,13 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var homePageDismissValue = '2';
|
||||||
|
|
||||||
function dismissWelcome(page, userId) {
|
function dismissWelcome(page, userId) {
|
||||||
|
|
||||||
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
||||||
|
|
||||||
result.CustomPrefs.homePageWelcomeDismissed = '1';
|
result.CustomPrefs.homePageWelcomeDismissed = homePageDismissValue;
|
||||||
ApiClient.updateDisplayPreferences('home', result, userId, 'webclient').done(function() {
|
ApiClient.updateDisplayPreferences('home', result, userId, 'webclient').done(function() {
|
||||||
|
|
||||||
$('.welcomeMessage', page).hide();
|
$('.welcomeMessage', page).hide();
|
||||||
|
@ -369,7 +359,7 @@
|
||||||
|
|
||||||
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
ApiClient.getDisplayPreferences('home', userId, 'webclient').done(function (result) {
|
||||||
|
|
||||||
if (result.CustomPrefs.homePageWelcomeDismissed) {
|
if (result.CustomPrefs.homePageWelcomeDismissed == homePageDismissValue) {
|
||||||
$('.welcomeMessage', page).hide();
|
$('.welcomeMessage', page).hide();
|
||||||
} else {
|
} else {
|
||||||
$('.welcomeMessage', page).show();
|
$('.welcomeMessage', page).show();
|
||||||
|
|
|
@ -97,11 +97,7 @@
|
||||||
|
|
||||||
var userId = Dashboard.getCurrentUserId();
|
var userId = Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
ApiClient.getItems(userId, {
|
ApiClient.getUserViews(userId).done(function (result) {
|
||||||
|
|
||||||
SortBy: "SortName"
|
|
||||||
|
|
||||||
}).done(function (result) {
|
|
||||||
|
|
||||||
var items = result.Items;
|
var items = result.Items;
|
||||||
|
|
||||||
|
|
|
@ -80,8 +80,7 @@
|
||||||
userId: Dashboard.getCurrentUserId(),
|
userId: Dashboard.getCurrentUserId(),
|
||||||
categoryLimit: screenWidth >= 1200 ? 6 : 3,
|
categoryLimit: screenWidth >= 1200 ? 6 : 3,
|
||||||
itemLimit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
|
itemLimit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
|
||||||
Fields: "PrimaryImageAspectRatio",
|
Fields: "PrimaryImageAspectRatio"
|
||||||
ParentId: parentId
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$.getJSON(url).done(function (recommendations) {
|
$.getJSON(url).done(function (recommendations) {
|
||||||
|
|
|
@ -215,7 +215,7 @@
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#musicVideosPage", function () {
|
}).on('pagebeforeshow', "#musicVideosPage", function () {
|
||||||
|
|
||||||
//query.ParentId = LibraryMenu.getTopParentId();
|
query.ParentId = LibraryMenu.getTopParentId();
|
||||||
|
|
||||||
var limit = LibraryBrowser.getDefaultPageSize();
|
var limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,35 @@
|
||||||
|
|
||||||
$('#chkGroupMoviesIntoCollections', page).checked(user.Configuration.GroupMoviesIntoBoxSets || false).checkboxradio("refresh");
|
$('#chkGroupMoviesIntoCollections', page).checked(user.Configuration.GroupMoviesIntoBoxSets || false).checkboxradio("refresh");
|
||||||
|
|
||||||
|
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();
|
Dashboard.hideLoadingMsg();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveUser(page, user) {
|
function saveUser(page, user) {
|
||||||
|
@ -16,6 +44,11 @@
|
||||||
user.Configuration.DisplayUnairedEpisodes = $('#chkDisplayUnairedEpisodes', page).checked();
|
user.Configuration.DisplayUnairedEpisodes = $('#chkDisplayUnairedEpisodes', page).checked();
|
||||||
user.Configuration.GroupMoviesIntoBoxSets = $('#chkGroupMoviesIntoCollections', 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 () {
|
ApiClient.updateUser(user).done(function () {
|
||||||
Dashboard.alert(Globalize.translate('SettingsSaved'));
|
Dashboard.alert(Globalize.translate('SettingsSaved'));
|
||||||
});
|
});
|
||||||
|
|
|
@ -2552,6 +2552,23 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.getUserViews = function (userId, options) {
|
||||||
|
|
||||||
|
if (!userId) {
|
||||||
|
throw new Error("null userId");
|
||||||
|
}
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
|
||||||
|
var url = self.getUrl("Users/" + userId + "/Views", options);
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
dataType: "json"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets artists from an item
|
Gets artists from an item
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue