mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #6574 from thornbill/missing-server-id-x
Fix undefined server id in experimental layout
This commit is contained in:
commit
ab3765231c
6 changed files with 29 additions and 8 deletions
|
@ -5,6 +5,8 @@ import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-ite
|
||||||
import { ItemSortBy } from '@jellyfin/sdk/lib/generated-client/models/item-sort-by';
|
import { ItemSortBy } from '@jellyfin/sdk/lib/generated-client/models/item-sort-by';
|
||||||
import { SortOrder } from '@jellyfin/sdk/lib/generated-client/models/sort-order';
|
import { SortOrder } from '@jellyfin/sdk/lib/generated-client/models/sort-order';
|
||||||
import React, { type FC } from 'react';
|
import React, { type FC } from 'react';
|
||||||
|
|
||||||
|
import { useApi } from 'hooks/useApi';
|
||||||
import { useGetItems } from 'hooks/useFetchItems';
|
import { useGetItems } from 'hooks/useFetchItems';
|
||||||
import Loading from 'components/loading/LoadingComponent';
|
import Loading from 'components/loading/LoadingComponent';
|
||||||
import { appRouter } from 'components/router/appRouter';
|
import { appRouter } from 'components/router/appRouter';
|
||||||
|
@ -26,6 +28,7 @@ const GenresSectionContainer: FC<GenresSectionContainerProps> = ({
|
||||||
itemType,
|
itemType,
|
||||||
genre
|
genre
|
||||||
}) => {
|
}) => {
|
||||||
|
const { __legacyApiClient__ } = useApi();
|
||||||
const getParametersOptions = () => {
|
const getParametersOptions = () => {
|
||||||
return {
|
return {
|
||||||
sortBy: [ItemSortBy.Random],
|
sortBy: [ItemSortBy.Random],
|
||||||
|
@ -73,7 +76,8 @@ const GenresSectionContainer: FC<GenresSectionContainerProps> = ({
|
||||||
cardLayout: false,
|
cardLayout: false,
|
||||||
shape: collectionType === CollectionType.Music ? CardShape.SquareOverflow : CardShape.PortraitOverflow,
|
shape: collectionType === CollectionType.Music ? CardShape.SquareOverflow : CardShape.PortraitOverflow,
|
||||||
showParentTitle: collectionType === CollectionType.Music,
|
showParentTitle: collectionType === CollectionType.Music,
|
||||||
showYear: collectionType !== CollectionType.Music
|
showYear: collectionType !== CollectionType.Music,
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
}}
|
}}
|
||||||
/>;
|
/>;
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,6 +5,8 @@ import { ItemSortBy } from '@jellyfin/sdk/lib/generated-client/models/item-sort-
|
||||||
import React, { type FC, useCallback } from 'react';
|
import React, { type FC, useCallback } from 'react';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import { useApi } from 'hooks/useApi';
|
||||||
import { useLocalStorage } from 'hooks/useLocalStorage';
|
import { useLocalStorage } from 'hooks/useLocalStorage';
|
||||||
import { useGetItemsViewByType } from 'hooks/useFetchItems';
|
import { useGetItemsViewByType } from 'hooks/useFetchItems';
|
||||||
import { getDefaultLibraryViewSettings, getSettingsKey } from 'utils/items';
|
import { getDefaultLibraryViewSettings, getSettingsKey } from 'utils/items';
|
||||||
|
@ -69,6 +71,7 @@ const ItemsView: FC<ItemsViewProps> = ({
|
||||||
getDefaultLibraryViewSettings(viewType)
|
getDefaultLibraryViewSettings(viewType)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const { __legacyApiClient__ } = useApi();
|
||||||
const {
|
const {
|
||||||
isLoading,
|
isLoading,
|
||||||
data: itemsResult,
|
data: itemsResult,
|
||||||
|
@ -138,7 +141,8 @@ const ItemsView: FC<ItemsViewProps> = ({
|
||||||
preferLogo: preferLogo,
|
preferLogo: preferLogo,
|
||||||
overlayText: !libraryViewSettings.ShowTitle,
|
overlayText: !libraryViewSettings.ShowTitle,
|
||||||
imageType: libraryViewSettings.ImageType,
|
imageType: libraryViewSettings.ImageType,
|
||||||
queryKey: ['ItemsViewByType']
|
queryKey: ['ItemsViewByType'],
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React, { type FC } from 'react';
|
import React, { type FC } from 'react';
|
||||||
|
import { useApi } from 'hooks/useApi';
|
||||||
import { useGetProgramsSectionsWithItems, useGetTimers } from 'hooks/useFetchItems';
|
import { useGetProgramsSectionsWithItems, useGetTimers } from 'hooks/useFetchItems';
|
||||||
import { appRouter } from 'components/router/appRouter';
|
import { appRouter } from 'components/router/appRouter';
|
||||||
import globalize from 'lib/globalize';
|
import globalize from 'lib/globalize';
|
||||||
|
@ -20,6 +21,7 @@ const ProgramsSectionView: FC<ProgramsSectionViewProps> = ({
|
||||||
sectionType,
|
sectionType,
|
||||||
isUpcomingRecordingsEnabled = false
|
isUpcomingRecordingsEnabled = false
|
||||||
}) => {
|
}) => {
|
||||||
|
const { __legacyApiClient__ } = useApi();
|
||||||
const { isLoading, data: sectionsWithItems, refetch } = useGetProgramsSectionsWithItems(parentId, sectionType);
|
const { isLoading, data: sectionsWithItems, refetch } = useGetProgramsSectionsWithItems(parentId, sectionType);
|
||||||
const {
|
const {
|
||||||
isLoading: isUpcomingRecordingsLoading,
|
isLoading: isUpcomingRecordingsLoading,
|
||||||
|
@ -63,7 +65,8 @@ const ProgramsSectionView: FC<ProgramsSectionViewProps> = ({
|
||||||
items={items}
|
items={items}
|
||||||
cardOptions={{
|
cardOptions={{
|
||||||
...section.cardOptions,
|
...section.cardOptions,
|
||||||
queryKey: ['ProgramSectionWithItems']
|
queryKey: ['ProgramSectionWithItems'],
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -95,7 +98,8 @@ const ProgramsSectionView: FC<ProgramsSectionViewProps> = ({
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
allowBottomPadding: false,
|
allowBottomPadding: false,
|
||||||
overlayText: false,
|
overlayText: false,
|
||||||
showChannelLogo: true
|
showChannelLogo: true,
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import type { RecommendationDto } from '@jellyfin/sdk/lib/generated-client/models/recommendation-dto';
|
import type { RecommendationDto } from '@jellyfin/sdk/lib/generated-client/models/recommendation-dto';
|
||||||
import { RecommendationType } from '@jellyfin/sdk/lib/generated-client/models/recommendation-type';
|
import { RecommendationType } from '@jellyfin/sdk/lib/generated-client/models/recommendation-type';
|
||||||
import React, { type FC } from 'react';
|
import React, { type FC } from 'react';
|
||||||
|
|
||||||
|
import { useApi } from 'hooks/useApi';
|
||||||
import {
|
import {
|
||||||
useGetMovieRecommendations,
|
useGetMovieRecommendations,
|
||||||
useGetSuggestionSectionsWithItems
|
useGetSuggestionSectionsWithItems
|
||||||
|
@ -26,6 +28,7 @@ const SuggestionsSectionView: FC<SuggestionsSectionViewProps> = ({
|
||||||
sectionType,
|
sectionType,
|
||||||
isMovieRecommendationEnabled = false
|
isMovieRecommendationEnabled = false
|
||||||
}) => {
|
}) => {
|
||||||
|
const { __legacyApiClient__ } = useApi();
|
||||||
const { isLoading, data: sectionsWithItems } =
|
const { isLoading, data: sectionsWithItems } =
|
||||||
useGetSuggestionSectionsWithItems(parentId, sectionType);
|
useGetSuggestionSectionsWithItems(parentId, sectionType);
|
||||||
|
|
||||||
|
@ -106,7 +109,8 @@ const SuggestionsSectionView: FC<SuggestionsSectionViewProps> = ({
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
cardLayout: false,
|
cardLayout: false,
|
||||||
overlayText: false
|
overlayText: false,
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
@ -130,7 +134,8 @@ const SuggestionsSectionView: FC<SuggestionsSectionViewProps> = ({
|
||||||
overlayPlayButton: true,
|
overlayPlayButton: true,
|
||||||
showTitle: true,
|
showTitle: true,
|
||||||
centerText: true,
|
centerText: true,
|
||||||
cardLayout: false
|
cardLayout: false,
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import React, { type FC } from 'react';
|
import React, { type FC } from 'react';
|
||||||
|
|
||||||
|
import { useApi } from 'hooks/useApi';
|
||||||
import { useGetGroupsUpcomingEpisodes } from 'hooks/useFetchItems';
|
import { useGetGroupsUpcomingEpisodes } from 'hooks/useFetchItems';
|
||||||
import Loading from 'components/loading/LoadingComponent';
|
import Loading from 'components/loading/LoadingComponent';
|
||||||
import NoItemsMessage from 'components/common/NoItemsMessage';
|
import NoItemsMessage from 'components/common/NoItemsMessage';
|
||||||
|
@ -8,6 +10,7 @@ import type { LibraryViewProps } from 'types/library';
|
||||||
|
|
||||||
// eslint-disable-next-line sonarjs/function-return-type
|
// eslint-disable-next-line sonarjs/function-return-type
|
||||||
const UpcomingView: FC<LibraryViewProps> = ({ parentId }) => {
|
const UpcomingView: FC<LibraryViewProps> = ({ parentId }) => {
|
||||||
|
const { __legacyApiClient__ } = useApi();
|
||||||
const { isLoading, data: groupsUpcomingEpisodes } =
|
const { isLoading, data: groupsUpcomingEpisodes } =
|
||||||
useGetGroupsUpcomingEpisodes(parentId);
|
useGetGroupsUpcomingEpisodes(parentId);
|
||||||
|
|
||||||
|
@ -36,7 +39,8 @@ const UpcomingView: FC<LibraryViewProps> = ({ parentId }) => {
|
||||||
showDetailsMenu: true,
|
showDetailsMenu: true,
|
||||||
missingIndicator: false,
|
missingIndicator: false,
|
||||||
cardLayout: false,
|
cardLayout: false,
|
||||||
queryKey: ['GroupsUpcomingEpisodes']
|
queryKey: ['GroupsUpcomingEpisodes'],
|
||||||
|
serverId: __legacyApiClient__?.serverId()
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|
|
@ -82,7 +82,7 @@ export function getTextActionButton(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = appRouter.getRouteUrl(item);
|
const url = appRouter.getRouteUrl(item, { serverId });
|
||||||
|
|
||||||
const dataAttributes = getDataAttributes(
|
const dataAttributes = getDataAttributes(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue