mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix: musicartists page mode
This commit is contained in:
parent
c1ef338df1
commit
4fa03c6a46
2 changed files with 15 additions and 11 deletions
|
@ -9,7 +9,7 @@ import Events from '../../utils/events.ts';
|
||||||
|
|
||||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
|
|
||||||
export default function (view, params, tabContent) {
|
export default function (view, params, tabContent, options) {
|
||||||
function getPageData() {
|
function getPageData() {
|
||||||
const key = getSavedQueryKey();
|
const key = getSavedQueryKey();
|
||||||
let pageData = data[key];
|
let pageData = data[key];
|
||||||
|
@ -45,7 +45,7 @@ export default function (view, params, tabContent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSavedQueryKey() {
|
function getSavedQueryKey() {
|
||||||
return `${params.topParentId}-${this.mode}`;
|
return `${params.topParentId}-${options.mode}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const onViewStyleChange = () => {
|
const onViewStyleChange = () => {
|
||||||
|
@ -67,7 +67,7 @@ export default function (view, params, tabContent) {
|
||||||
loading.show();
|
loading.show();
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
const query = getQuery();
|
const query = getQuery();
|
||||||
const promise = this.mode == 'albumartists' ?
|
const promise = options.mode == 'albumartists' ?
|
||||||
ApiClient.getAlbumArtists(ApiClient.getCurrentUserId(), query) :
|
ApiClient.getAlbumArtists(ApiClient.getCurrentUserId(), query) :
|
||||||
ApiClient.getArtists(ApiClient.getCurrentUserId(), query);
|
ApiClient.getArtists(ApiClient.getCurrentUserId(), query);
|
||||||
promise.then((result) => {
|
promise.then((result) => {
|
||||||
|
@ -169,7 +169,7 @@ export default function (view, params, tabContent) {
|
||||||
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
import('../../components/filterdialog/filterdialog').then(({ default: FilterDialog }) => {
|
||||||
const filterDialog = new FilterDialog({
|
const filterDialog = new FilterDialog({
|
||||||
query: getQuery(),
|
query: getQuery(),
|
||||||
mode: this.mode,
|
mode: options.mode,
|
||||||
serverId: ApiClient.serverId()
|
serverId: ApiClient.serverId()
|
||||||
});
|
});
|
||||||
Events.on(filterDialog, 'filterchange', function () {
|
Events.on(filterDialog, 'filterchange', function () {
|
||||||
|
|
|
@ -260,6 +260,14 @@ export default function (view, params) {
|
||||||
mainTabsManager.setTabs(view, currentTabIndex, getTabs, getTabContainers, onBeforeTabChange, onTabChange);
|
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) => {
|
const getTabController = (page, index, callback) => {
|
||||||
let depends;
|
let depends;
|
||||||
|
|
||||||
|
@ -306,13 +314,9 @@ export default function (view, params) {
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
controller = this;
|
controller = this;
|
||||||
} else {
|
} else {
|
||||||
controller = new ControllerFactory(view, params, tabContent);
|
controller = new ControllerFactory(view, params, tabContent, {
|
||||||
}
|
mode: getMode(index)
|
||||||
|
});
|
||||||
if (index == 2) {
|
|
||||||
controller.mode = 'albumartists';
|
|
||||||
} else if (index == 3) {
|
|
||||||
controller.mode = 'artists';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabControllers[index] = controller;
|
tabControllers[index] = controller;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue