mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added music folders view
This commit is contained in:
parent
6afa97f6b8
commit
8d07bdcc53
6 changed files with 143 additions and 4 deletions
6
dashboard-ui/cordova/chromecast.js
vendored
6
dashboard-ui/cordova/chromecast.js
vendored
|
@ -662,6 +662,12 @@
|
||||||
|
|
||||||
self.endSession = function () {
|
self.endSession = function () {
|
||||||
|
|
||||||
|
var session = currentWebAppSession;
|
||||||
|
|
||||||
|
if (session) {
|
||||||
|
session.close();
|
||||||
|
}
|
||||||
|
|
||||||
if (currentDevice) {
|
if (currentDevice) {
|
||||||
currentDevice.disconnect();
|
currentDevice.disconnect();
|
||||||
}
|
}
|
||||||
|
|
9
dashboard-ui/cordova/iap.js
vendored
9
dashboard-ui/cordova/iap.js
vendored
|
@ -67,6 +67,13 @@
|
||||||
function validateProduct(product, callback) {
|
function validateProduct(product, callback) {
|
||||||
|
|
||||||
var productId = product.id;
|
var productId = product.id;
|
||||||
|
|
||||||
|
// We should never get in here with the unlock, but in case we do
|
||||||
|
if ((productId || '').toLowerCase().indexOf('appunlock') != -1) {
|
||||||
|
callback(true, product);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var cacheKey = productId + (product.transaction.id || '');
|
var cacheKey = productId + (product.transaction.id || '');
|
||||||
|
|
||||||
var cachedResult = validationCache[cacheKey];
|
var cachedResult = validationCache[cacheKey];
|
||||||
|
@ -268,7 +275,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function isUnlockedOverride(feature) {
|
function isUnlockedOverride(feature) {
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
deferred.resolveWith(null, [false]);
|
deferred.resolveWith(null, [false]);
|
||||||
return deferred.promise();
|
return deferred.promise();
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<paper-tab>${TabArtists}</paper-tab>
|
<paper-tab>${TabArtists}</paper-tab>
|
||||||
<paper-tab>${TabSongs}</paper-tab>
|
<paper-tab>${TabSongs}</paper-tab>
|
||||||
<paper-tab>${TabGenres}</paper-tab>
|
<paper-tab>${TabGenres}</paper-tab>
|
||||||
|
<paper-tab>${TabFolders}</paper-tab>
|
||||||
</paper-tabs>
|
</paper-tabs>
|
||||||
<div class="legacyTabs scopedLibraryViewNav">
|
<div class="legacyTabs scopedLibraryViewNav">
|
||||||
<a href="music.html">${TabSuggestions}</a>
|
<a href="music.html">${TabSuggestions}</a>
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
<a href="music.html?tab=3">${TabArtists}</a>
|
<a href="music.html?tab=3">${TabArtists}</a>
|
||||||
<a href="music.html?tab=4">${TabSongs}</a>
|
<a href="music.html?tab=4">${TabSongs}</a>
|
||||||
<a href="music.html?tab=5">${TabGenres}</a>
|
<a href="music.html?tab=5">${TabGenres}</a>
|
||||||
|
<a href="music.html?tab=6">${TabFolders}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -111,6 +113,15 @@
|
||||||
<div id="items" class="itemsContainer paddedItemsContainer"></div>
|
<div id="items" class="itemsContainer paddedItemsContainer"></div>
|
||||||
</div>
|
</div>
|
||||||
</neon-animatable>
|
</neon-animatable>
|
||||||
|
<neon-animatable>
|
||||||
|
<div class="pageTabContent" data-index="6">
|
||||||
|
<div class="viewSettings">
|
||||||
|
<div class="listTopPaging">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="items" class="itemsContainer paddedItemsContainer"></div>
|
||||||
|
</div>
|
||||||
|
</neon-animatable>
|
||||||
</neon-animated-pages>
|
</neon-animated-pages>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
} else if ($.browser.ipad || $.browser.iphone || $.browser.android) {
|
} else if ($.browser.ipad || $.browser.iphone || $.browser.android) {
|
||||||
cacheDuration = 10000;
|
cacheDuration = 10000;
|
||||||
} else {
|
} else {
|
||||||
cacheDuration = 60000;
|
cacheDuration = 30000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((now - last) < cacheDuration) {
|
if ((now - last) < cacheDuration) {
|
||||||
|
@ -221,7 +221,7 @@
|
||||||
return !LibraryBrowser.enableFullPaperTabs();
|
return !LibraryBrowser.enableFullPaperTabs();
|
||||||
},
|
},
|
||||||
|
|
||||||
configurePaperLibraryTabs: function (ownerpage, tabs, pages, baseUrl) {
|
configurePaperLibraryTabs: function (ownerpage, tabs, pages) {
|
||||||
|
|
||||||
// Causing iron-select to not fire in IE and safari
|
// Causing iron-select to not fire in IE and safari
|
||||||
if ($.browser.chrome) {
|
if ($.browser.chrome) {
|
||||||
|
|
110
dashboard-ui/scripts/musicfolders.js
Normal file
110
dashboard-ui/scripts/musicfolders.js
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
(function ($, document) {
|
||||||
|
|
||||||
|
var data = {};
|
||||||
|
function getPageData() {
|
||||||
|
var key = getSavedQueryKey();
|
||||||
|
var pageData = data[key];
|
||||||
|
|
||||||
|
if (!pageData) {
|
||||||
|
pageData = data[key] = {
|
||||||
|
query: {
|
||||||
|
SortBy: "SortName",
|
||||||
|
SortOrder: "Ascending",
|
||||||
|
Fields: "PrimaryImageAspectRatio,SortName,SyncInfo",
|
||||||
|
StartIndex: 0,
|
||||||
|
ImageTypeLimit: 1,
|
||||||
|
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
|
||||||
|
Limit: LibraryBrowser.getDefaultPageSize()
|
||||||
|
},
|
||||||
|
view: LibraryBrowser.getSavedView(key) || LibraryBrowser.getDefaultItemsView('Poster', 'Poster')
|
||||||
|
};
|
||||||
|
|
||||||
|
pageData.query.ParentId = LibraryMenu.getTopParentId();
|
||||||
|
LibraryBrowser.loadSavedQueryValues(key, pageData.query);
|
||||||
|
}
|
||||||
|
return pageData;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getQuery() {
|
||||||
|
|
||||||
|
return getPageData().query;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSavedQueryKey() {
|
||||||
|
|
||||||
|
return LibraryBrowser.getSavedQueryKey('folders');
|
||||||
|
}
|
||||||
|
|
||||||
|
function reloadItems(page, viewPanel) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var query = getQuery();
|
||||||
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||||
|
|
||||||
|
// Scroll back up so they can see the results from the beginning
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
var view = getPageData().view;
|
||||||
|
var pagingHtml = LibraryBrowser.getQueryPagingHtml({
|
||||||
|
startIndex: query.StartIndex,
|
||||||
|
limit: query.Limit,
|
||||||
|
totalRecordCount: result.TotalRecordCount,
|
||||||
|
viewButton: false,
|
||||||
|
showLimit: false,
|
||||||
|
sortButton: false,
|
||||||
|
addLayoutButton: false,
|
||||||
|
currentLayout: view,
|
||||||
|
updatePageSizeSetting: false,
|
||||||
|
viewIcon: 'filter-list',
|
||||||
|
layouts: 'List,Poster,PosterCard,Timeline'
|
||||||
|
});
|
||||||
|
|
||||||
|
page.querySelector('.listTopPaging').innerHTML = pagingHtml;
|
||||||
|
|
||||||
|
if (view == "Poster") {
|
||||||
|
html = LibraryBrowser.getPosterViewHtml({
|
||||||
|
items: result.Items,
|
||||||
|
shape: "square",
|
||||||
|
context: 'music',
|
||||||
|
showTitle: true,
|
||||||
|
showParentTitle: true,
|
||||||
|
lazy: true,
|
||||||
|
centerText: true,
|
||||||
|
overlayPlayButton: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var elem = page.querySelector('#items');
|
||||||
|
elem.innerHTML = html + pagingHtml;
|
||||||
|
ImageLoader.lazyChildren(elem);
|
||||||
|
|
||||||
|
$('.btnNextPage', page).on('click', function () {
|
||||||
|
query.StartIndex += query.Limit;
|
||||||
|
reloadItems(page, viewPanel);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnPreviousPage', page).on('click', function () {
|
||||||
|
query.StartIndex -= query.Limit;
|
||||||
|
reloadItems(page, viewPanel);
|
||||||
|
});
|
||||||
|
|
||||||
|
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
|
||||||
|
LibraryBrowser.setLastRefreshed(page);
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
window.MusicPage.initFoldersTab = function (page, tabContent) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
window.MusicPage.renderFoldersTab = function (page, tabContent) {
|
||||||
|
|
||||||
|
if (LibraryBrowser.needsRefresh(tabContent)) {
|
||||||
|
reloadItems(tabContent);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery, document);
|
|
@ -209,7 +209,7 @@
|
||||||
loadRecentlyPlayed(tabContent, parentId);
|
loadRecentlyPlayed(tabContent, parentId);
|
||||||
loadFrequentlyPlayed(tabContent, parentId);
|
loadFrequentlyPlayed(tabContent, parentId);
|
||||||
|
|
||||||
require(['scripts/favorites'], function() {
|
require(['scripts/favorites'], function () {
|
||||||
|
|
||||||
FavoriteItems.render(tabContent, Dashboard.getCurrentUserId(), parentId, ['favoriteArtists', 'favoriteAlbums', 'favoriteSongs']);
|
FavoriteItems.render(tabContent, Dashboard.getCurrentUserId(), parentId, ['favoriteArtists', 'favoriteAlbums', 'favoriteSongs']);
|
||||||
|
|
||||||
|
@ -259,6 +259,11 @@
|
||||||
depends.push('scripts/musicgenres');
|
depends.push('scripts/musicgenres');
|
||||||
renderMethod = 'renderGenresTab';
|
renderMethod = 'renderGenresTab';
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
depends.push('scripts/musicfolders');
|
||||||
|
renderMethod = 'renderFoldersTab';
|
||||||
|
initMethod = 'initFoldersTab';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue