From e0762e322c3a5a6f7fb3a4be47cf12e553bcd8ae Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 20 Feb 2026 13:58:26 -0500 Subject: [PATCH] Move cardBuilderUtils to utils dir --- src/apps/dashboard/components/BaseCard.tsx | 2 +- src/apps/dashboard/features/devices/components/DeviceCard.tsx | 2 +- src/apps/wizard/controllers/library.js | 2 +- src/components/cardbuilder/Card/CardContent.tsx | 2 +- src/components/cardbuilder/Card/cardHelper.ts | 2 +- src/components/cardbuilder/Card/useCard.ts | 2 +- src/components/cardbuilder/cardBuilder.js | 2 +- .../{cardBuilderUtils.test.ts => utils/builder.test.ts} | 2 +- .../cardbuilder/{cardBuilderUtils.ts => utils/builder.ts} | 2 +- src/components/cardbuilder/utils/url.ts | 2 +- src/components/common/DefaultName.tsx | 2 +- src/components/dashboard/users/UserCardBox.tsx | 2 +- src/components/listview/List/ListImageContainer.tsx | 2 +- src/components/listview/listview.js | 2 +- src/components/remotecontrol/remotecontrol.js | 2 +- src/controllers/session/login/index.js | 2 +- src/controllers/session/selectServer/index.js | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) rename src/components/cardbuilder/{cardBuilderUtils.test.ts => utils/builder.test.ts} (99%) rename src/components/cardbuilder/{cardBuilderUtils.ts => utils/builder.ts} (99%) diff --git a/src/apps/dashboard/components/BaseCard.tsx b/src/apps/dashboard/components/BaseCard.tsx index 2192a8eeb2..325ecc9da3 100644 --- a/src/apps/dashboard/components/BaseCard.tsx +++ b/src/apps/dashboard/components/BaseCard.tsx @@ -6,7 +6,7 @@ import CardMedia from '@mui/material/CardMedia'; import IconButton from '@mui/material/IconButton'; import Typography from '@mui/material/Typography'; import MoreVertIcon from '@mui/icons-material/MoreVert'; -import { getDefaultBackgroundClass } from 'components/cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from 'components/cardbuilder/utils/builder'; import CardActionArea from '@mui/material/CardActionArea'; import Stack from '@mui/material/Stack'; import { Link, To } from 'react-router-dom'; diff --git a/src/apps/dashboard/features/devices/components/DeviceCard.tsx b/src/apps/dashboard/features/devices/components/DeviceCard.tsx index 872857f886..31e5d6837d 100644 --- a/src/apps/dashboard/features/devices/components/DeviceCard.tsx +++ b/src/apps/dashboard/features/devices/components/DeviceCard.tsx @@ -8,7 +8,7 @@ import Stack from '@mui/material/Stack'; import getNowPlayingName from '../../sessions/utils/getNowPlayingName'; import getSessionNowPlayingTime from '../../sessions/utils/getSessionNowPlayingTime'; import getNowPlayingImageUrl from '../../sessions/utils/getNowPlayingImageUrl'; -import { getDefaultBackgroundClass } from 'components/cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from 'components/cardbuilder/utils/builder'; import Comment from '@mui/icons-material/Comment'; import PlayArrow from '@mui/icons-material/PlayArrow'; import Pause from '@mui/icons-material/Pause'; diff --git a/src/apps/wizard/controllers/library.js b/src/apps/wizard/controllers/library.js index 03e1e558a9..64bb3e6aba 100644 --- a/src/apps/wizard/controllers/library.js +++ b/src/apps/wizard/controllers/library.js @@ -1,6 +1,6 @@ import escapeHtml from 'escape-html'; -import { getDefaultBackgroundClass } from 'components/cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from 'components/cardbuilder/utils/builder'; import confirm from 'components/confirm/confirm'; import loading from 'components/loading/loading'; import globalize from 'lib/globalize'; diff --git a/src/components/cardbuilder/Card/CardContent.tsx b/src/components/cardbuilder/Card/CardContent.tsx index d7e80dfd9d..d0581f1263 100644 --- a/src/components/cardbuilder/Card/CardContent.tsx +++ b/src/components/cardbuilder/Card/CardContent.tsx @@ -1,6 +1,6 @@ import React, { type FC } from 'react'; import classNames from 'classnames'; -import { getDefaultBackgroundClass } from '../cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../utils/builder'; import CardImageContainer from './CardImageContainer'; import { useApi } from 'hooks/useApi'; diff --git a/src/components/cardbuilder/Card/cardHelper.ts b/src/components/cardbuilder/Card/cardHelper.ts index 08adcf7adb..a1fa15614e 100644 --- a/src/components/cardbuilder/Card/cardHelper.ts +++ b/src/components/cardbuilder/Card/cardHelper.ts @@ -10,7 +10,7 @@ import itemHelper from 'components/itemHelper'; import { ItemAction } from 'constants/itemAction'; import globalize from 'lib/globalize'; import datetime from 'scripts/datetime'; -import { isUsingLiveTvNaming } from '../cardBuilderUtils'; +import { isUsingLiveTvNaming } from '../utils/builder'; import { getDataAttributes } from 'utils/items'; import { ItemKind } from 'types/base/models/item-kind'; import { ItemMediaKind } from 'types/base/models/item-media-kind'; diff --git a/src/components/cardbuilder/Card/useCard.ts b/src/components/cardbuilder/Card/useCard.ts index 5fbe7ff515..d1ec9f42f9 100644 --- a/src/components/cardbuilder/Card/useCard.ts +++ b/src/components/cardbuilder/Card/useCard.ts @@ -12,7 +12,7 @@ import { getDataAttributes } from 'utils/items'; import { resolveAction, resolveMixedShapeByAspectRatio -} from '../cardBuilderUtils'; +} from '../utils/builder'; import { CardShape } from '../utils/shape'; import { getCardImageUrl } from '../utils/url'; diff --git a/src/components/cardbuilder/cardBuilder.js b/src/components/cardbuilder/cardBuilder.js index 8e03edab65..e66e71f555 100644 --- a/src/components/cardbuilder/cardBuilder.js +++ b/src/components/cardbuilder/cardBuilder.js @@ -40,7 +40,7 @@ import { resolveCardCssClasses, resolveCardImageContainerCssClasses, resolveMixedShapeByAspectRatio -} from './cardBuilderUtils'; +} from './utils/builder'; import { getBackdropShape, getPortraitShape, getSquareShape } from './utils/shape'; import { getCardImageUrl } from './utils/url'; diff --git a/src/components/cardbuilder/cardBuilderUtils.test.ts b/src/components/cardbuilder/utils/builder.test.ts similarity index 99% rename from src/components/cardbuilder/cardBuilderUtils.test.ts rename to src/components/cardbuilder/utils/builder.test.ts index 8b159c2ccb..8087413181 100644 --- a/src/components/cardbuilder/cardBuilderUtils.test.ts +++ b/src/components/cardbuilder/utils/builder.test.ts @@ -10,7 +10,7 @@ import { resolveCardCssClasses, resolveCardImageContainerCssClasses, resolveMixedShapeByAspectRatio -} from './cardBuilderUtils'; +} from './builder'; import { ItemAction } from 'constants/itemAction'; describe('getDesiredAspect', () => { diff --git a/src/components/cardbuilder/cardBuilderUtils.ts b/src/components/cardbuilder/utils/builder.ts similarity index 99% rename from src/components/cardbuilder/cardBuilderUtils.ts rename to src/components/cardbuilder/utils/builder.ts index 527fa3c782..06747d7636 100644 --- a/src/components/cardbuilder/cardBuilderUtils.ts +++ b/src/components/cardbuilder/utils/builder.ts @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { ItemAction } from 'constants/itemAction'; import { randomInt } from 'utils/number'; -import { CardShape } from './utils/shape'; +import { CardShape } from './shape'; const ASPECT_RATIOS = { portrait: (2 / 3), diff --git a/src/components/cardbuilder/utils/url.ts b/src/components/cardbuilder/utils/url.ts index 1b20f6f30e..6ccee82bd0 100644 --- a/src/components/cardbuilder/utils/url.ts +++ b/src/components/cardbuilder/utils/url.ts @@ -5,7 +5,7 @@ import { getImageApi } from '@jellyfin/sdk/lib/utils/api/image-api'; import { ItemDto } from 'types/base/models/item-dto'; import { CardOptions } from 'types/cardOptions'; -import { getDesiredAspect } from '../cardBuilderUtils'; +import { getDesiredAspect } from './builder'; import { CardShape } from './shape'; interface CardImageUrlParams { diff --git a/src/components/common/DefaultName.tsx b/src/components/common/DefaultName.tsx index 44a7829531..20e79ca8b3 100644 --- a/src/components/common/DefaultName.tsx +++ b/src/components/common/DefaultName.tsx @@ -1,7 +1,7 @@ import React, { type FC } from 'react'; import Box from '@mui/material/Box'; import itemHelper from 'components/itemHelper'; -import { isUsingLiveTvNaming } from '../cardbuilder/cardBuilderUtils'; +import { isUsingLiveTvNaming } from '../cardbuilder/utils/builder'; import type { ItemDto } from 'types/base/models/item-dto'; interface DefaultNameProps { diff --git a/src/components/dashboard/users/UserCardBox.tsx b/src/components/dashboard/users/UserCardBox.tsx index 22814d4435..d8849b940e 100644 --- a/src/components/dashboard/users/UserCardBox.tsx +++ b/src/components/dashboard/users/UserCardBox.tsx @@ -5,7 +5,7 @@ import { getLocaleWithSuffix } from '../../../utils/dateFnsLocale'; import globalize from '../../../lib/globalize'; import IconButtonElement from '../../../elements/IconButtonElement'; import LinkButton from '../../../elements/emby-button/LinkButton'; -import { getDefaultBackgroundClass } from '../../cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../../cardbuilder/utils/builder'; type IProps = { user?: UserDto; diff --git a/src/components/listview/List/ListImageContainer.tsx b/src/components/listview/List/ListImageContainer.tsx index 55c633e5bf..2e37665a0d 100644 --- a/src/components/listview/List/ListImageContainer.tsx +++ b/src/components/listview/List/ListImageContainer.tsx @@ -11,7 +11,7 @@ import type { ListOptions } from 'types/listOptions'; import useIndicator from '../../indicators/useIndicator'; import layoutManager from '../../layoutManager'; -import { getDefaultBackgroundClass } from '../../cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../../cardbuilder/utils/builder'; import { canResume, getChannelImageUrl, diff --git a/src/components/listview/listview.js b/src/components/listview/listview.js index e06041183c..a5465a9e03 100644 --- a/src/components/listview/listview.js +++ b/src/components/listview/listview.js @@ -10,7 +10,7 @@ import markdownIt from 'markdown-it'; import { ItemAction } from 'constants/itemAction'; -import { getDefaultBackgroundClass } from '../cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../cardbuilder/utils/builder'; import itemHelper from '../itemHelper'; import mediaInfo from '../mediainfo/mediainfo'; import indicators from '../indicators/indicators'; diff --git a/src/components/remotecontrol/remotecontrol.js b/src/components/remotecontrol/remotecontrol.js index 57ab21c0a2..5470f0e97a 100644 --- a/src/components/remotecontrol/remotecontrol.js +++ b/src/components/remotecontrol/remotecontrol.js @@ -19,7 +19,7 @@ import * as userSettings from '../../scripts/settings/userSettings'; import itemContextMenu from '../itemContextMenu'; import toast from '../toast/toast'; import { appRouter } from '../router/appRouter'; -import { getDefaultBackgroundClass } from '../cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../cardbuilder/utils/builder'; import '../cardbuilder/card.scss'; import '../../elements/emby-button/emby-button'; diff --git a/src/controllers/session/login/index.js b/src/controllers/session/login/index.js index aa9f7029fd..fd38855284 100644 --- a/src/controllers/session/login/index.js +++ b/src/controllers/session/login/index.js @@ -18,7 +18,7 @@ import Dashboard from '../../../utils/dashboard'; import toast from '../../../components/toast/toast'; import dialogHelper from '../../../components/dialogHelper/dialogHelper'; import baseAlert from '../../../components/alert'; -import { getDefaultBackgroundClass } from '../../../components/cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../../../components/cardbuilder/utils/builder'; import './login.scss'; diff --git a/src/controllers/session/selectServer/index.js b/src/controllers/session/selectServer/index.js index 1da0932f79..30d0e90ddd 100644 --- a/src/controllers/session/selectServer/index.js +++ b/src/controllers/session/selectServer/index.js @@ -18,7 +18,7 @@ import '../../../components/cardbuilder/card.scss'; import '../../../elements/emby-button/emby-button'; import Dashboard from '../../../utils/dashboard'; import alert from '../../../components/alert'; -import { getDefaultBackgroundClass } from '../../../components/cardbuilder/cardBuilderUtils'; +import { getDefaultBackgroundClass } from '../../../components/cardbuilder/utils/builder'; import { ConnectionState, ServerConnections } from 'lib/jellyfin-apiclient'; const enableFocusTransform = !browser.slow && !browser.edge;