Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Bill Thornton <[email protected]>
  • Loading branch information
grafixeyehero and thornbill committed Aug 20, 2024
1 parent 5d2b614 commit ec10842
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 25 deletions.
4 changes: 3 additions & 1 deletion src/components/filterdialog/filterIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export function getFilterStatus(query) {
);
}

export function setFilterStatus(page, hasFilters) {
export function setFilterStatus(page, query) {
const hasFilters = getFilterStatus(query);

const btnFilterWrapper = page.querySelector('.btnFilter-wrapper');

if (btnFilterWrapper) {
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/livetv/livetvchannels.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import libraryBrowser from '../../scripts/libraryBrowser';
import loading from '../../components/loading/loading';
import * as userSettings from '../../scripts/settings/userSettings';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -118,8 +118,7 @@ export default function (view, params, tabContent) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(context, hasFilters);
setFilterStatus(context, query);

const apiClient = ApiClient;
query.UserId = apiClient.getCurrentUserId();
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/movies/movies.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import cardBuilder from '../../components/cardbuilder/cardBuilder';
import globalize from '../../lib/globalize';
import Events from '../../utils/events.ts';
import { playbackManager } from '../../components/playback/playbackmanager';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -40,8 +40,7 @@ export default function (view, params, tabContent, options) {
}

const afterRefresh = (result) => {
const hasFilters = getFilterStatus(query);
setFilterStatus(tabContent, hasFilters);
setFilterStatus(tabContent, query);

function onNextPageClick() {
if (isLoading) {
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/movies/movietrailers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import cardBuilder from '../../components/cardbuilder/cardBuilder';
import * as userSettings from '../../scripts/settings/userSettings';
import globalize from '../../lib/globalize';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -53,8 +53,7 @@ export default function (view, params, tabContent) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(tabContent, hasFilters);
setFilterStatus(tabContent, query);

ApiClient.getItems(ApiClient.getCurrentUserId(), query).then((result) => {
function onNextPageClick() {
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/music/musicalbums.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import cardBuilder from '../../components/cardbuilder/cardBuilder';
import * as userSettings from '../../scripts/settings/userSettings';
import globalize from '../../lib/globalize';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -84,8 +84,7 @@ export default function (view, params, tabContent) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(tabContent, hasFilters);
setFilterStatus(tabContent, query);

ApiClient.getItems(ApiClient.getCurrentUserId(), query).then((result) => {
function onNextPageClick() {
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/music/musicartists.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import listView from '../../components/listview/listview';
import cardBuilder from '../../components/cardbuilder/cardBuilder';
import * as userSettings from '../../scripts/settings/userSettings';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -68,8 +68,7 @@ export default function (view, params, tabContent, options) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(tabContent, hasFilters);
setFilterStatus(tabContent, query);

const promise = options.mode == 'albumartists' ?
ApiClient.getAlbumArtists(ApiClient.getCurrentUserId(), query) :
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/music/songs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as userSettings from '../../scripts/settings/userSettings';
import globalize from '../../lib/globalize';
import Dashboard from '../../utils/dashboard';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -54,8 +54,7 @@ export default function (view, params, tabContent) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(tabContent, hasFilters);
setFilterStatus(tabContent, query);

ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
function onNextPageClick() {
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/shows/episodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as userSettings from '../../scripts/settings/userSettings';
import globalize from '../../lib/globalize';
import Dashboard from '../../utils/dashboard';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -70,8 +70,7 @@ export default function (view, params, tabContent) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(page, hasFilters);
setFilterStatus(page, query);

ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
function onNextPageClick() {
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/shows/tvshows.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AlphaPicker from '../../components/alphaPicker/alphaPicker';
import * as userSettings from '../../scripts/settings/userSettings';
import globalize from '../../lib/globalize';
import Events from '../../utils/events.ts';
import { getFilterStatus, setFilterStatus } from 'components/filterdialog/filterIndicator';
import { setFilterStatus } from 'components/filterdialog/filterIndicator';

import '../../elements/emby-itemscontainer/emby-itemscontainer';

Expand Down Expand Up @@ -69,8 +69,7 @@ export default function (view, params, tabContent) {
loading.show();
isLoading = true;
const query = getQuery();
const hasFilters = getFilterStatus(query);
setFilterStatus(page, hasFilters);
setFilterStatus(page, query);

ApiClient.getItems(ApiClient.getCurrentUserId(), query).then((result) => {
function onNextPageClick() {
Expand Down

0 comments on commit ec10842

Please sign in to comment.