diff --git a/packages/common/src/constants.ts b/packages/common/src/constants.ts index 877ee6059..6ad7b7a29 100644 --- a/packages/common/src/constants.ts +++ b/packages/common/src/constants.ts @@ -86,7 +86,7 @@ export const EPG_TYPE = { viewNexa: 'viewnexa', } as const; -export const APP_CONTENT_TYPE = { +export const APP_CONFIG_ITEM_TYPE = { playlist: 'playlist', continue_watching: 'continue_watching', favorites: 'favorites', diff --git a/packages/common/src/utils/urlFormatting.ts b/packages/common/src/utils/urlFormatting.ts index fe0938640..cc968c82f 100644 --- a/packages/common/src/utils/urlFormatting.ts +++ b/packages/common/src/utils/urlFormatting.ts @@ -3,7 +3,7 @@ import type { AppMenuType } from '@jwp/ott-common/types/config'; import type { PlaylistItem } from '../../types/playlist'; import { PATH_MEDIA, PATH_PLAYLIST, PATH_CONTENT_LIST } from '../paths'; import { logWarn } from '../logger'; -import { APP_CONTENT_TYPE } from '../constants'; +import { APP_CONFIG_ITEM_TYPE } from '../constants'; import { getLegacySeriesPlaylistIdFromEpisodeTags, getSeriesPlaylistIdFromCustomParams } from './media'; @@ -134,11 +134,11 @@ export const contentListURL = (id: string, title?: string) => { export const determinePath = ({ type, contentId }: { type: AppMenuType | undefined; contentId: string }) => { switch (type) { - case APP_CONTENT_TYPE.content_list: + case APP_CONFIG_ITEM_TYPE.content_list: return contentListURL(contentId); - case APP_CONTENT_TYPE.media: + case APP_CONFIG_ITEM_TYPE.media: return singleMediaURL(contentId); - case APP_CONTENT_TYPE.playlist: + case APP_CONFIG_ITEM_TYPE.playlist: return playlistURL(contentId); default: return ''; diff --git a/packages/common/types/config.ts b/packages/common/types/config.ts index 299e76be9..2d8c980ee 100644 --- a/packages/common/types/config.ts +++ b/packages/common/types/config.ts @@ -1,4 +1,4 @@ -import type { APP_CONTENT_TYPE } from '../src/constants'; +import type { APP_CONFIG_ITEM_TYPE } from '../src/constants'; import type { AdScheduleUrls, AdDeliveryMethod } from './ad-schedule'; @@ -43,7 +43,7 @@ export type Drm = { defaultPolicyId: string; }; -export type AppContentType = keyof typeof APP_CONTENT_TYPE; +export type AppContentType = keyof typeof APP_CONFIG_ITEM_TYPE; export type AppMenuType = Extract; export type AppShelfType = Extract; diff --git a/packages/hooks-react/src/usePlaylist.ts b/packages/hooks-react/src/usePlaylist.ts index b063bdfa9..5e8ed77b5 100644 --- a/packages/hooks-react/src/usePlaylist.ts +++ b/packages/hooks-react/src/usePlaylist.ts @@ -7,7 +7,7 @@ import { isScheduledOrLiveMedia } from '@jwp/ott-common/src/utils/liveEvent'; import { isTruthyCustomParamValue } from '@jwp/ott-common/src/utils/common'; import type { ApiError } from '@jwp/ott-common/src/utils/api'; import type { AppMenuType } from '@jwp/ott-common/types/config'; -import { APP_CONTENT_TYPE } from '@jwp/ott-common/src/constants'; +import { APP_CONFIG_ITEM_TYPE } from '@jwp/ott-common/src/constants'; import { useConfigStore } from '@jwp/ott-common/src/stores/ConfigStore'; const placeholderData = generatePlaylistPlaceholder(30); @@ -35,7 +35,7 @@ export const getPlaylistQueryOptions = ({ enabled: !!contentId && enabled, queryKey: ['playlist', type, contentId, params], queryFn: async () => { - if (type === APP_CONTENT_TYPE.playlist) { + if (type === APP_CONFIG_ITEM_TYPE.playlist) { const playlist = await apiService.getPlaylistById(contentId, params); // This pre-caches all playlist items and makes navigating a lot faster. @@ -44,7 +44,7 @@ export const getPlaylistQueryOptions = ({ }); return playlist; - } else if (type === APP_CONTENT_TYPE.content_list) { + } else if (type === APP_CONFIG_ITEM_TYPE.content_list) { const contentList = await apiService.getContentList({ siteId, id: contentId }); return contentList; @@ -67,7 +67,7 @@ export default function usePlaylist( params: GetPlaylistParams = {}, enabled: boolean = true, usePlaceholderData: boolean = true, - type: AppMenuType = APP_CONTENT_TYPE.playlist, + type: AppMenuType = APP_CONFIG_ITEM_TYPE.playlist, ) { const queryClient = useQueryClient(); const siteId = useConfigStore((state) => state.config.siteId); diff --git a/packages/ui-react/src/pages/ScreenRouting/PlaylistScreenRouter.tsx b/packages/ui-react/src/pages/ScreenRouting/PlaylistScreenRouter.tsx index 0fff59538..1663b49a3 100644 --- a/packages/ui-react/src/pages/ScreenRouting/PlaylistScreenRouter.tsx +++ b/packages/ui-react/src/pages/ScreenRouting/PlaylistScreenRouter.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useParams } from 'react-router'; import { useTranslation } from 'react-i18next'; import type { Playlist } from '@jwp/ott-common/types/playlist'; -import { APP_CONTENT_TYPE, PLAYLIST_CONTENT_TYPE } from '@jwp/ott-common/src/constants'; +import { APP_CONFIG_ITEM_TYPE, PLAYLIST_CONTENT_TYPE } from '@jwp/ott-common/src/constants'; import { ScreenMap } from '@jwp/ott-common/src/utils/ScreenMap'; import usePlaylist from '@jwp/ott-hooks-react/src/usePlaylist'; import type { AppMenuType } from '@jwp/ott-common/types/config'; @@ -43,7 +43,7 @@ const PlaylistScreenRouter = ({ type }: { type: AppMenuType }) => { return ; } - const Screen = type === APP_CONTENT_TYPE.content_list ? contentScreenMap.getScreen(data) : playlistScreenMap.getScreen(data); + const Screen = type === APP_CONFIG_ITEM_TYPE.content_list ? contentScreenMap.getScreen(data) : playlistScreenMap.getScreen(data); return ; }; diff --git a/platforms/web/src/containers/AppRoutes/AppRoutes.tsx b/platforms/web/src/containers/AppRoutes/AppRoutes.tsx index 5729974fd..74a964a3d 100644 --- a/platforms/web/src/containers/AppRoutes/AppRoutes.tsx +++ b/platforms/web/src/containers/AppRoutes/AppRoutes.tsx @@ -12,7 +12,7 @@ import MediaScreenRouter from '@jwp/ott-ui-react/src/pages/ScreenRouting/MediaSc import PlaylistScreenRouter from '@jwp/ott-ui-react/src/pages/ScreenRouting/PlaylistScreenRouter'; import Layout from '@jwp/ott-ui-react/src/containers/Layout/Layout'; import { PATH_ABOUT, PATH_CONTENT_LIST, PATH_LEGACY_SERIES, PATH_MEDIA, PATH_PLAYLIST, PATH_SEARCH, PATH_USER } from '@jwp/ott-common/src/paths'; -import { APP_CONTENT_TYPE } from '@jwp/ott-common/src/constants'; +import { APP_CONFIG_ITEM_TYPE } from '@jwp/ott-common/src/constants'; import RoutesContainer from '#src/containers/RoutesContainer/RoutesContainer'; @@ -24,8 +24,8 @@ export default function AppRoutes() { }> } errorElement={}> } /> - } /> - } /> + } /> + } /> } /> } /> } />