From 1085034c18dd0e58effd5e59a8aa2d50694ec5f3 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 31 Mar 2022 14:36:09 -0400 Subject: [PATCH] Remove setTitle function in app router --- src/components/appRouter.js | 4 ---- src/components/tabbedview/tabbedview.js | 5 +++-- src/controllers/home.js | 4 ++-- src/controllers/itemDetails/index.js | 5 +++-- src/controllers/list.js | 4 ++-- src/controllers/playback/video/index.js | 5 +++-- src/controllers/session/selectServer/index.js | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/components/appRouter.js b/src/components/appRouter.js index 5b0d61ab3a..4e45f343c8 100644 --- a/src/components/appRouter.js +++ b/src/components/appRouter.js @@ -715,10 +715,6 @@ class AppRouter { Dashboard.navigate('home.html?tab=1'); } - setTitle(title) { - LibraryMenu.setTitle(title); - } - getRouteUrl(item, options) { if (!item) { throw new Error('item cannot be null'); diff --git a/src/components/tabbedview/tabbedview.js b/src/components/tabbedview/tabbedview.js index fac54fd493..b5c54d41b4 100644 --- a/src/components/tabbedview/tabbedview.js +++ b/src/components/tabbedview/tabbedview.js @@ -2,7 +2,7 @@ import backdrop from '../backdrop/backdrop'; import * as mainTabsManager from '../maintabsmanager'; import layoutManager from '../layoutManager'; import '../../elements/emby-tabs/emby-tabs'; -import { appRouter } from '../appRouter'; +import LibraryMenu from '../../scripts/libraryMenu'; function onViewDestroy() { const tabControllers = this.tabControllers; @@ -105,8 +105,9 @@ class TabbedView { currentTabController.onPause(); } } + setTitle() { - appRouter.setTitle(''); + LibraryMenu.setTitle(''); } } diff --git a/src/controllers/home.js b/src/controllers/home.js index 4ebaa62add..feb29b542c 100644 --- a/src/controllers/home.js +++ b/src/controllers/home.js @@ -3,7 +3,7 @@ import globalize from '../scripts/globalize'; import '../elements/emby-tabs/emby-tabs'; import '../elements/emby-button/emby-button'; import '../elements/emby-scroller/emby-scroller'; -import { appRouter } from '../components/appRouter'; +import LibraryMenu from '../scripts/libraryMenu'; class HomeView extends TabbedView { constructor(view, params) { @@ -11,7 +11,7 @@ class HomeView extends TabbedView { } setTitle() { - appRouter.setTitle(null); + LibraryMenu.setTitle(null); } onPause() { diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index 9e90345841..8ea5ac915a 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -33,6 +33,7 @@ import Dashboard from '../../scripts/clientUtils'; import ServerConnections from '../../components/ServerConnections'; import confirm from '../../components/confirm/confirm'; import { download } from '../../scripts/fileDownloader'; +import LibraryMenu from '../../scripts/libraryMenu'; function autoFocus(container) { import('../../components/autoFocuser').then(({ default: autoFocuser }) => { @@ -571,7 +572,7 @@ function renderDetailPageBackdrop(page, item, apiClient) { function reloadFromItem(instance, page, params, item, user) { const apiClient = ServerConnections.getApiClient(item.ServerId); - appRouter.setTitle(''); + LibraryMenu.setTitle(''); // Start rendering the artwork first renderImage(page, item); @@ -2042,7 +2043,7 @@ export default function (view, params) { if (e.detail.isRestored) { if (currentItem) { - appRouter.setTitle(''); + LibraryMenu.setTitle(''); renderTrackSelections(page, self, currentItem, true); renderBackdrop(currentItem); } diff --git a/src/controllers/list.js b/src/controllers/list.js index 105817605b..fb11a48ae5 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -11,7 +11,7 @@ import AlphaPicker from '../components/alphaPicker/alphaPicker'; import '../elements/emby-itemscontainer/emby-itemscontainer'; import '../elements/emby-scroller/emby-scroller'; import ServerConnections from '../components/ServerConnections'; -import { appRouter } from '../components/appRouter'; +import LibraryMenu from '../scripts/libraryMenu'; /* eslint-disable indent */ @@ -635,7 +635,7 @@ class ItemsView { } function setTitle(item) { - appRouter.setTitle(getTitle(item) || ''); + LibraryMenu.setTitle(getTitle(item) || ''); if (item && item.CollectionType === 'playlists') { hideOrShowAll(view.querySelectorAll('.btnNewItem'), false); diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index a27e119768..7b408a566a 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -23,6 +23,7 @@ import ServerConnections from '../../../components/ServerConnections'; import shell from '../../../scripts/shell'; import SubtitleSync from '../../../components/subtitlesync/subtitlesync'; import { appRouter } from '../../../components/appRouter'; +import LibraryMenu from '../../../scripts/libraryMenu'; /* eslint-disable indent */ @@ -150,7 +151,7 @@ import { appRouter } from '../../../components/appRouter'; currentItem = item; if (!item) { updateRecordingButton(null); - appRouter.setTitle(''); + LibraryMenu.setTitle(''); nowPlayingVolumeSlider.disabled = true; nowPlayingPositionSlider.disabled = true; btnFastForward.disabled = true; @@ -206,7 +207,7 @@ import { appRouter } from '../../../components/appRouter'; itemName = parentName || ''; } - appRouter.setTitle(itemName); + LibraryMenu.setTitle(itemName); const documentTitle = parentName || (item ? item.Name : null); diff --git a/src/controllers/session/selectServer/index.js b/src/controllers/session/selectServer/index.js index 3d4cc0c576..ca96068913 100644 --- a/src/controllers/session/selectServer/index.js +++ b/src/controllers/session/selectServer/index.js @@ -196,7 +196,7 @@ import cardBuilder from '../../../components/cardbuilder/cardBuilder'; updatePageStyle(view, params); view.addEventListener('viewshow', function (e) { const isRestored = e.detail.isRestored; - appRouter.setTitle(null); + libraryMenu.setTitle(null); libraryMenu.setTransparentMenu(true); if (!isRestored) {