mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-15 09:58:18 -07:00
Merge pull request #4811 from grafixeyehero/fix-music-mode
Fix music artists page mode
This commit is contained in:
commit
273af701ec
@ -9,7 +9,7 @@ import Events from '../../utils/events.ts';
|
||||
|
||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
|
||||
export default function (view, params, tabContent) {
|
||||
export default function (view, params, tabContent, options) {
|
||||
function getPageData() {
|
||||
const key = getSavedQueryKey();
|
||||
let pageData = data[key];
|
||||
@ -45,7 +45,7 @@ export default function (view, params, tabContent) {
|
||||
}
|
||||
|
||||
function getSavedQueryKey() {
|
||||
return `${params.topParentId}-${this.mode}`;
|
||||
return `${params.topParentId}-${options.mode}`;
|
||||
}
|
||||
|
||||
const onViewStyleChange = () => {
|
||||
@ -67,7 +67,7 @@ export default function (view, params, tabContent) {
|
||||
loading.show();
|
||||
isLoading = true;
|
||||
const query = getQuery();
|
||||
const promise = this.mode == 'albumartists' ?
|
||||
const promise = options.mode == 'albumartists' ?
|
||||
ApiClient.getAlbumArtists(ApiClient.getCurrentUserId(), query) :
|
||||
ApiClient.getArtists(ApiClient.getCurrentUserId(), query);
|
||||
promise.then((result) => {
|
||||
@ -169,7 +169,7 @@ export default function (view, params, tabContent) {
|
||||
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||
const filterDialog = new FilterDialog({
|
||||
query: getQuery(),
|
||||
mode: this.mode,
|
||||
mode: options.mode,
|
||||
serverId: ApiClient.serverId()
|
||||
});
|
||||
Events.on(filterDialog, 'filterchange', function () {
|
||||
|
@ -260,6 +260,14 @@ export default function (view, params) {
|
||||
mainTabsManager.setTabs(view, currentTabIndex, getTabs, getTabContainers, onBeforeTabChange, onTabChange);
|
||||
}
|
||||
|
||||
function getMode(index) {
|
||||
if (index === 2) {
|
||||
return 'albumartists';
|
||||
} else if (index === 3) {
|
||||
return 'artists';
|
||||
}
|
||||
}
|
||||
|
||||
const getTabController = (page, index, callback) => {
|
||||
let depends;
|
||||
|
||||
@ -306,13 +314,9 @@ export default function (view, params) {
|
||||
if (index === 1) {
|
||||
controller = this;
|
||||
} else {
|
||||
controller = new ControllerFactory(view, params, tabContent);
|
||||
}
|
||||
|
||||
if (index == 2) {
|
||||
controller.mode = 'albumartists';
|
||||
} else if (index == 3) {
|
||||
controller.mode = 'artists';
|
||||
controller = new ControllerFactory(view, params, tabContent, {
|
||||
mode: getMode(index)
|
||||
});
|
||||
}
|
||||
|
||||
tabControllers[index] = controller;
|
||||
|
Loading…
Reference in New Issue
Block a user