mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Update PrimaryMediaInfo option naming
This commit is contained in:
parent
b3bda59ee9
commit
a3eff3c0ae
5 changed files with 116 additions and 117 deletions
|
@ -79,11 +79,11 @@ const ListContent: FC<ListContentProps> = ({
|
||||||
<PrimaryMediaInfo
|
<PrimaryMediaInfo
|
||||||
className='secondary listItemMediaInfo'
|
className='secondary listItemMediaInfo'
|
||||||
item={item}
|
item={item}
|
||||||
isRuntimeEnabled={true}
|
showRuntimeInfo
|
||||||
isStarRatingEnabled={true}
|
showStarRatingInfo
|
||||||
isCaptionIndicatorEnabled={true}
|
showCaptionIndicatorInfo
|
||||||
isEpisodeTitleEnabled={true}
|
showEpisodeTitleInfo
|
||||||
isOfficialRatingEnabled={true}
|
showOfficialRatingInfo
|
||||||
getMissingIndicator={indicator.getMissingIndicator}
|
getMissingIndicator={indicator.getMissingIndicator}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -62,9 +62,9 @@ const ListItemBody: FC<ListItemBodyProps> = ({
|
||||||
<PrimaryMediaInfo
|
<PrimaryMediaInfo
|
||||||
className='secondary listItemMediaInfo listItemBodyText'
|
className='secondary listItemMediaInfo listItemBodyText'
|
||||||
item={item}
|
item={item}
|
||||||
isEpisodeTitleEnabled={true}
|
showEpisodeTitleInfo
|
||||||
isOriginalAirDateEnabled={true}
|
showOriginalAirDateInfo
|
||||||
isCaptionIndicatorEnabled={true}
|
showCaptionIndicatorInfo
|
||||||
getMissingIndicator={getMissingIndicator}
|
getMissingIndicator={getMissingIndicator}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -12,54 +12,46 @@ import EndsAt from './EndsAt';
|
||||||
import { ItemMediaKind } from 'types/base/models/item-media-kind';
|
import { ItemMediaKind } from 'types/base/models/item-media-kind';
|
||||||
import type { ItemDto } from 'types/base/models/item-dto';
|
import type { ItemDto } from 'types/base/models/item-dto';
|
||||||
import type { MiscInfo } from 'types/mediaInfoItem';
|
import type { MiscInfo } from 'types/mediaInfoItem';
|
||||||
|
import type { PrimaryInfoOpts } from './type';
|
||||||
|
|
||||||
interface PrimaryMediaInfoProps {
|
interface PrimaryMediaInfoProps extends PrimaryInfoOpts {
|
||||||
className?: string;
|
className?: string;
|
||||||
item: ItemDto;
|
item: ItemDto;
|
||||||
isYearEnabled?: boolean;
|
showStarRatingInfo?: boolean;
|
||||||
isContainerEnabled?: boolean;
|
showCaptionIndicatorInfo?: boolean;
|
||||||
isEpisodeTitleEnabled?: boolean;
|
showCriticRatingInfo?: boolean;
|
||||||
isCriticRatingEnabled?: boolean;
|
showEndsAtInfo?: boolean;
|
||||||
isEndsAtEnabled?: boolean;
|
showMissingIndicatorInfo?: boolean;
|
||||||
isOriginalAirDateEnabled?: boolean;
|
getMissingIndicator?: () => React.JSX.Element | null
|
||||||
isRuntimeEnabled?: boolean;
|
|
||||||
isProgramIndicatorEnabled?: boolean;
|
|
||||||
isEpisodeTitleIndexNumberEnabled?: boolean;
|
|
||||||
isOfficialRatingEnabled?: boolean;
|
|
||||||
isStarRatingEnabled?: boolean;
|
|
||||||
isCaptionIndicatorEnabled?: boolean;
|
|
||||||
isMissingIndicatorEnabled?: boolean;
|
|
||||||
getMissingIndicator: () => React.JSX.Element | null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const PrimaryMediaInfo: FC<PrimaryMediaInfoProps> = ({
|
const PrimaryMediaInfo: FC<PrimaryMediaInfoProps> = ({
|
||||||
className,
|
className,
|
||||||
item,
|
item,
|
||||||
isYearEnabled = false,
|
showYearInfo,
|
||||||
isContainerEnabled = false,
|
showAudioContainerInfo,
|
||||||
isEpisodeTitleEnabled = false,
|
showEpisodeTitleInfo,
|
||||||
isCriticRatingEnabled = false,
|
showOriginalAirDateInfo,
|
||||||
isEndsAtEnabled = false,
|
showRuntimeInfo,
|
||||||
isOriginalAirDateEnabled = false,
|
showProgramIndicatorInfo,
|
||||||
isRuntimeEnabled = false,
|
includeEpisodeTitleIndexNumber,
|
||||||
isProgramIndicatorEnabled = false,
|
showOfficialRatingInfo,
|
||||||
isEpisodeTitleIndexNumberEnabled = false,
|
showStarRatingInfo = false,
|
||||||
isOfficialRatingEnabled = false,
|
showCaptionIndicatorInfo = false,
|
||||||
isStarRatingEnabled = false,
|
showCriticRatingInfo = false,
|
||||||
isCaptionIndicatorEnabled = false,
|
showEndsAtInfo = false,
|
||||||
isMissingIndicatorEnabled = false,
|
|
||||||
getMissingIndicator
|
getMissingIndicator
|
||||||
}) => {
|
}) => {
|
||||||
const miscInfo = usePrimaryMediaInfo({
|
const miscInfo = usePrimaryMediaInfo({
|
||||||
item,
|
item,
|
||||||
isYearEnabled,
|
showYearInfo,
|
||||||
isContainerEnabled,
|
showAudioContainerInfo,
|
||||||
isEpisodeTitleEnabled,
|
showEpisodeTitleInfo,
|
||||||
isOriginalAirDateEnabled,
|
showOriginalAirDateInfo,
|
||||||
isRuntimeEnabled,
|
showRuntimeInfo,
|
||||||
isProgramIndicatorEnabled,
|
showProgramIndicatorInfo,
|
||||||
isEpisodeTitleIndexNumberEnabled,
|
includeEpisodeTitleIndexNumber,
|
||||||
isOfficialRatingEnabled
|
showOfficialRatingInfo
|
||||||
});
|
});
|
||||||
const {
|
const {
|
||||||
StartDate,
|
StartDate,
|
||||||
|
@ -80,24 +72,22 @@ const PrimaryMediaInfo: FC<PrimaryMediaInfoProps> = ({
|
||||||
<Box className={cssClass}>
|
<Box className={cssClass}>
|
||||||
{miscInfo.map((info, index) => renderMediaInfo(info, index))}
|
{miscInfo.map((info, index) => renderMediaInfo(info, index))}
|
||||||
|
|
||||||
{isStarRatingEnabled && CommunityRating && (
|
{showStarRatingInfo && CommunityRating && (
|
||||||
<StarIcons communityRating={CommunityRating} />
|
<StarIcons communityRating={CommunityRating} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{HasSubtitles && isCaptionIndicatorEnabled && <CaptionMediaInfo />}
|
{showCaptionIndicatorInfo && HasSubtitles && <CaptionMediaInfo />}
|
||||||
|
|
||||||
{CriticRating && isCriticRatingEnabled && (
|
{showCriticRatingInfo && CriticRating && (
|
||||||
<CriticRatingMediaInfo criticRating={CriticRating} />
|
<CriticRatingMediaInfo criticRating={CriticRating} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isEndsAtEnabled
|
{showEndsAtInfo
|
||||||
&& MediaType === ItemMediaKind.Video
|
&& MediaType === ItemMediaKind.Video
|
||||||
&& RunTimeTicks
|
&& RunTimeTicks
|
||||||
&& !StartDate && <EndsAt runTimeTicks={RunTimeTicks} />}
|
&& !StartDate && <EndsAt runTimeTicks={RunTimeTicks} />}
|
||||||
|
|
||||||
{isMissingIndicatorEnabled && (
|
{getMissingIndicator?.()}
|
||||||
getMissingIndicator()
|
|
||||||
)}
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
10
src/components/mediainfo/type.ts
Normal file
10
src/components/mediainfo/type.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
export interface PrimaryInfoOpts {
|
||||||
|
showYearInfo?: boolean;
|
||||||
|
showAudioContainerInfo?: boolean;
|
||||||
|
showEpisodeTitleInfo?: boolean;
|
||||||
|
includeEpisodeTitleIndexNumber?: boolean;
|
||||||
|
showOriginalAirDateInfo?: boolean;
|
||||||
|
showRuntimeInfo?: boolean;
|
||||||
|
showProgramIndicatorInfo?: boolean;
|
||||||
|
showOfficialRatingInfo?: boolean;
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ import { ItemStatus } from 'types/base/models/item-status';
|
||||||
import type { NullableNumber, NullableString } from 'types/base/common/shared/types';
|
import type { NullableNumber, NullableString } from 'types/base/common/shared/types';
|
||||||
import type { ItemDto } from 'types/base/models/item-dto';
|
import type { ItemDto } from 'types/base/models/item-dto';
|
||||||
import type { MiscInfo } from 'types/mediaInfoItem';
|
import type { MiscInfo } from 'types/mediaInfoItem';
|
||||||
|
import { PrimaryInfoOpts } from './type';
|
||||||
|
|
||||||
function shouldShowFolderRuntime(
|
function shouldShowFolderRuntime(
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
|
@ -28,7 +29,7 @@ function addTrackCountOrItemCount(
|
||||||
itemSongCount: NullableNumber,
|
itemSongCount: NullableNumber,
|
||||||
itemChildCount: NullableNumber,
|
itemChildCount: NullableNumber,
|
||||||
itemRunTimeTicks: NullableNumber,
|
itemRunTimeTicks: NullableNumber,
|
||||||
itemType: NullableString,
|
itemType: ItemKind,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (showFolderRuntime) {
|
if (showFolderRuntime) {
|
||||||
|
@ -51,14 +52,14 @@ function addTrackCountOrItemCount(
|
||||||
function addOriginalAirDateInfo(
|
function addOriginalAirDateInfo(
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
itemMediaType: ItemMediaKind,
|
itemMediaType: ItemMediaKind,
|
||||||
isOriginalAirDateEnabled: boolean,
|
showOriginalAirDateInfo: boolean,
|
||||||
itemPremiereDate: NullableString,
|
itemPremiereDate: NullableString,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (
|
if (
|
||||||
itemPremiereDate
|
itemPremiereDate
|
||||||
&& (itemType === ItemKind.Episode || itemMediaType === ItemMediaKind.Photo)
|
&& (itemType === ItemKind.Episode || itemMediaType === ItemMediaKind.Photo)
|
||||||
&& isOriginalAirDateEnabled
|
&& showOriginalAirDateInfo
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
//don't modify date to locale if episode. Only Dates (not times) are stored, or editable in the edit metadata dialog
|
//don't modify date to locale if episode. Only Dates (not times) are stored, or editable in the edit metadata dialog
|
||||||
|
@ -104,7 +105,7 @@ function addProgramIndicatorInfo(
|
||||||
): void {
|
): void {
|
||||||
if (
|
if (
|
||||||
program?.IsLive
|
program?.IsLive
|
||||||
&& userSettings.get('guide-indicator-live', false) === 'true'
|
&& userSettings.get('guide-indicator-live') === 'true'
|
||||||
) {
|
) {
|
||||||
addMiscInfo({
|
addMiscInfo({
|
||||||
text: globalize.translate('Live'),
|
text: globalize.translate('Live'),
|
||||||
|
@ -112,7 +113,7 @@ function addProgramIndicatorInfo(
|
||||||
});
|
});
|
||||||
} else if (
|
} else if (
|
||||||
program?.IsPremiere
|
program?.IsPremiere
|
||||||
&& userSettings.get('guide-indicator-premiere', false) === 'true'
|
&& userSettings.get('guide-indicator-premiere') === 'true'
|
||||||
) {
|
) {
|
||||||
addMiscInfo({
|
addMiscInfo({
|
||||||
text: globalize.translate('Premiere'),
|
text: globalize.translate('Premiere'),
|
||||||
|
@ -121,7 +122,7 @@ function addProgramIndicatorInfo(
|
||||||
} else if (
|
} else if (
|
||||||
program?.IsSeries
|
program?.IsSeries
|
||||||
&& !program?.IsRepeat
|
&& !program?.IsRepeat
|
||||||
&& userSettings.get('guide-indicator-new', false) === 'true'
|
&& userSettings.get('guide-indicator-new') === 'true'
|
||||||
) {
|
) {
|
||||||
addMiscInfo({
|
addMiscInfo({
|
||||||
text: globalize.translate('New'),
|
text: globalize.translate('New'),
|
||||||
|
@ -130,7 +131,7 @@ function addProgramIndicatorInfo(
|
||||||
} else if (
|
} else if (
|
||||||
program?.IsSeries
|
program?.IsSeries
|
||||||
&& program?.IsRepeat
|
&& program?.IsRepeat
|
||||||
&& userSettings.get('guide-indicator-repeat', false) === 'true'
|
&& userSettings.get('guide-indicator-repeat') === 'true'
|
||||||
) {
|
) {
|
||||||
addMiscInfo({
|
addMiscInfo({
|
||||||
text: globalize.translate('Repeat'),
|
text: globalize.translate('Repeat'),
|
||||||
|
@ -141,11 +142,11 @@ function addProgramIndicatorInfo(
|
||||||
|
|
||||||
function addProgramIndicators(
|
function addProgramIndicators(
|
||||||
item: ItemDto,
|
item: ItemDto,
|
||||||
isYearEnabled: boolean,
|
showYearInfo: boolean,
|
||||||
isEpisodeTitleEnabled: boolean,
|
showEpisodeTitleInfo: boolean,
|
||||||
isOriginalAirDateEnabled: boolean,
|
showOriginalAirDateInfo: boolean,
|
||||||
isProgramIndicatorEnabled: boolean,
|
showProgramIndicatorInfo: boolean,
|
||||||
isEpisodeTitleIndexNumberEnabled: boolean,
|
includeEpisodeTitleIndexNumber: boolean,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (item.Type === ItemKind.Program || item.Type === ItemKind.Timer) {
|
if (item.Type === ItemKind.Program || item.Type === ItemKind.Timer) {
|
||||||
|
@ -154,16 +155,16 @@ function addProgramIndicators(
|
||||||
program = item.ProgramInfo;
|
program = item.ProgramInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isProgramIndicatorEnabled !== false) {
|
if (showProgramIndicatorInfo !== false) {
|
||||||
addProgramIndicatorInfo(program, addMiscInfo);
|
addProgramIndicatorInfo(program, addMiscInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
addProgramTextInfo(
|
addProgramTextInfo(
|
||||||
program,
|
program,
|
||||||
isEpisodeTitleEnabled,
|
showEpisodeTitleInfo,
|
||||||
isEpisodeTitleIndexNumberEnabled,
|
includeEpisodeTitleIndexNumber,
|
||||||
isOriginalAirDateEnabled,
|
showOriginalAirDateInfo,
|
||||||
isYearEnabled,
|
showYearInfo,
|
||||||
addMiscInfo
|
addMiscInfo
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -171,16 +172,18 @@ function addProgramIndicators(
|
||||||
|
|
||||||
function addProgramTextInfo(
|
function addProgramTextInfo(
|
||||||
program: ItemDto,
|
program: ItemDto,
|
||||||
isEpisodeTitleEnabled: boolean,
|
showEpisodeTitleInfo: boolean,
|
||||||
isEpisodeTitleIndexNumberEnabled: boolean,
|
includeEpisodeTitleIndexNumber: boolean,
|
||||||
isOriginalAirDateEnabled: boolean,
|
showOriginalAirDateInfo: boolean,
|
||||||
isYearEnabled: boolean,
|
showYearInfo: boolean,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if ((program?.IsSeries || program?.EpisodeTitle)
|
if (
|
||||||
&& isEpisodeTitleEnabled !== false) {
|
(program?.IsSeries || program?.EpisodeTitle)
|
||||||
|
&& showEpisodeTitleInfo !== false
|
||||||
|
) {
|
||||||
const text = itemHelper.getDisplayName(program, {
|
const text = itemHelper.getDisplayName(program, {
|
||||||
includeIndexNumber: isEpisodeTitleIndexNumberEnabled
|
includeIndexNumber: includeEpisodeTitleIndexNumber
|
||||||
});
|
});
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
|
@ -188,11 +191,11 @@ function addProgramTextInfo(
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
program?.ProductionYear
|
program?.ProductionYear
|
||||||
&& ((program?.IsMovie && isOriginalAirDateEnabled !== false)
|
&& ((program?.IsMovie && showOriginalAirDateInfo !== false)
|
||||||
|| isYearEnabled !== false)
|
|| showYearInfo !== false)
|
||||||
) {
|
) {
|
||||||
addMiscInfo({ text: program.ProductionYear });
|
addMiscInfo({ text: program.ProductionYear });
|
||||||
} else if (program?.PremiereDate && isOriginalAirDateEnabled !== false) {
|
} else if (program?.PremiereDate && showOriginalAirDateInfo !== false) {
|
||||||
try {
|
try {
|
||||||
const date = datetime.parseISO8601Date(program.PremiereDate);
|
const date = datetime.parseISO8601Date(program.PremiereDate);
|
||||||
const text = globalize.translate(
|
const text = globalize.translate(
|
||||||
|
@ -233,12 +236,12 @@ function addStartDateInfo(
|
||||||
function addSeriesProductionYearInfo(
|
function addSeriesProductionYearInfo(
|
||||||
itemProductionYear: NullableNumber,
|
itemProductionYear: NullableNumber,
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
isYearEnabled: boolean,
|
showYearInfo: boolean,
|
||||||
itemStatus: ItemStatus,
|
itemStatus: ItemStatus,
|
||||||
itemEndDate: NullableString,
|
itemEndDate: NullableString,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (itemProductionYear && isYearEnabled && itemType === ItemKind.Series) {
|
if (itemProductionYear && showYearInfo && itemType === ItemKind.Series) {
|
||||||
if (itemStatus === ItemStatus.Continuing) {
|
if (itemStatus === ItemStatus.Continuing) {
|
||||||
addMiscInfo({
|
addMiscInfo({
|
||||||
text: globalize.translate(
|
text: globalize.translate(
|
||||||
|
@ -281,7 +284,7 @@ function addproductionYearWithEndDate(
|
||||||
}
|
}
|
||||||
|
|
||||||
function addYearInfo(
|
function addYearInfo(
|
||||||
isYearEnabled: boolean,
|
showYearInfo: boolean,
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
itemMediaType: ItemMediaKind,
|
itemMediaType: ItemMediaKind,
|
||||||
itemProductionYear: NullableNumber,
|
itemProductionYear: NullableNumber,
|
||||||
|
@ -289,7 +292,7 @@ function addYearInfo(
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (
|
if (
|
||||||
isYearEnabled
|
showYearInfo
|
||||||
&& itemType !== ItemKind.Series
|
&& itemType !== ItemKind.Series
|
||||||
&& itemType !== ItemKind.Episode
|
&& itemType !== ItemKind.Episode
|
||||||
&& itemType !== ItemKind.Person
|
&& itemType !== ItemKind.Person
|
||||||
|
@ -326,7 +329,7 @@ function addRunTimeInfo(
|
||||||
itemRunTimeTicks: NullableNumber,
|
itemRunTimeTicks: NullableNumber,
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
showFolderRuntime: boolean,
|
showFolderRuntime: boolean,
|
||||||
isRuntimeEnabled: boolean,
|
showRuntimeInfo: boolean,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (
|
if (
|
||||||
|
@ -336,7 +339,7 @@ function addRunTimeInfo(
|
||||||
&& itemType !== ItemKind.Timer
|
&& itemType !== ItemKind.Timer
|
||||||
&& itemType !== ItemKind.Book
|
&& itemType !== ItemKind.Book
|
||||||
&& !showFolderRuntime
|
&& !showFolderRuntime
|
||||||
&& isRuntimeEnabled
|
&& showRuntimeInfo
|
||||||
) {
|
) {
|
||||||
if (itemType === ItemKind.Audio) {
|
if (itemType === ItemKind.Audio) {
|
||||||
addMiscInfo({ text: datetime.getDisplayRunningTime(itemRunTimeTicks) });
|
addMiscInfo({ text: datetime.getDisplayRunningTime(itemRunTimeTicks) });
|
||||||
|
@ -349,29 +352,33 @@ function addRunTimeInfo(
|
||||||
function addOfficialRatingInfo(
|
function addOfficialRatingInfo(
|
||||||
itemOfficialRating: NullableString,
|
itemOfficialRating: NullableString,
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
isOfficialRatingEnabled: boolean,
|
showOfficialRatingInfo: boolean,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (
|
if (
|
||||||
itemOfficialRating
|
itemOfficialRating
|
||||||
&& isOfficialRatingEnabled
|
&& showOfficialRatingInfo
|
||||||
&& itemType !== ItemKind.Season
|
&& itemType !== ItemKind.Season
|
||||||
&& itemType !== ItemKind.Episode
|
&& itemType !== ItemKind.Episode
|
||||||
) {
|
) {
|
||||||
addMiscInfo({
|
addMiscInfo({
|
||||||
text: itemOfficialRating,
|
text: itemOfficialRating,
|
||||||
cssClass: 'mediaInfoOfficialRating'
|
cssClass: 'mediaInfoText mediaInfoOfficialRating'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addAudioContainer(
|
function addAudioContainer(
|
||||||
itemContainer: NullableString,
|
itemContainer: NullableString,
|
||||||
isContainerEnabled: boolean,
|
showAudioContainerInfo: boolean,
|
||||||
itemType: ItemKind,
|
itemType: ItemKind,
|
||||||
addMiscInfo: (val: MiscInfo) => void
|
addMiscInfo: (val: MiscInfo) => void
|
||||||
): void {
|
): void {
|
||||||
if (itemContainer && isContainerEnabled && itemType === ItemKind.Audio) {
|
if (
|
||||||
|
itemContainer
|
||||||
|
&& showAudioContainerInfo
|
||||||
|
&& itemType === ItemKind.Audio
|
||||||
|
) {
|
||||||
addMiscInfo({ text: itemContainer });
|
addMiscInfo({ text: itemContainer });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -389,28 +396,20 @@ function addPhotoSize(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UsePrimaryMediaInfoProps {
|
interface UsePrimaryMediaInfoProps extends PrimaryInfoOpts {
|
||||||
item: ItemDto;
|
item: ItemDto;
|
||||||
isYearEnabled: boolean;
|
|
||||||
isContainerEnabled: boolean;
|
|
||||||
isEpisodeTitleEnabled: boolean;
|
|
||||||
isOriginalAirDateEnabled: boolean;
|
|
||||||
isRuntimeEnabled: boolean;
|
|
||||||
isProgramIndicatorEnabled: boolean;
|
|
||||||
isEpisodeTitleIndexNumberEnabled: boolean;
|
|
||||||
isOfficialRatingEnabled: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function usePrimaryMediaInfo({
|
function usePrimaryMediaInfo({
|
||||||
item,
|
item,
|
||||||
isYearEnabled = false,
|
showYearInfo = false,
|
||||||
isContainerEnabled = false,
|
showAudioContainerInfo = false,
|
||||||
isEpisodeTitleEnabled = false,
|
showEpisodeTitleInfo = false,
|
||||||
isOriginalAirDateEnabled = false,
|
showOriginalAirDateInfo = false,
|
||||||
isRuntimeEnabled = false,
|
showRuntimeInfo = false,
|
||||||
isProgramIndicatorEnabled = false,
|
showProgramIndicatorInfo = false,
|
||||||
isEpisodeTitleIndexNumberEnabled = false,
|
includeEpisodeTitleIndexNumber = false,
|
||||||
isOfficialRatingEnabled = false
|
showOfficialRatingInfo = false
|
||||||
}: UsePrimaryMediaInfoProps) {
|
}: UsePrimaryMediaInfoProps) {
|
||||||
const {
|
const {
|
||||||
EndDate,
|
EndDate,
|
||||||
|
@ -455,7 +454,7 @@ function usePrimaryMediaInfo({
|
||||||
addOriginalAirDateInfo(
|
addOriginalAirDateInfo(
|
||||||
Type,
|
Type,
|
||||||
MediaType,
|
MediaType,
|
||||||
isOriginalAirDateEnabled,
|
showOriginalAirDateInfo,
|
||||||
PremiereDate,
|
PremiereDate,
|
||||||
addMiscInfo
|
addMiscInfo
|
||||||
);
|
);
|
||||||
|
@ -474,7 +473,7 @@ function usePrimaryMediaInfo({
|
||||||
addSeriesProductionYearInfo(
|
addSeriesProductionYearInfo(
|
||||||
ProductionYear,
|
ProductionYear,
|
||||||
Type,
|
Type,
|
||||||
isYearEnabled,
|
showYearInfo,
|
||||||
Status,
|
Status,
|
||||||
EndDate,
|
EndDate,
|
||||||
addMiscInfo
|
addMiscInfo
|
||||||
|
@ -482,16 +481,16 @@ function usePrimaryMediaInfo({
|
||||||
|
|
||||||
addProgramIndicators(
|
addProgramIndicators(
|
||||||
item,
|
item,
|
||||||
isProgramIndicatorEnabled,
|
showProgramIndicatorInfo,
|
||||||
isEpisodeTitleEnabled,
|
showEpisodeTitleInfo,
|
||||||
isEpisodeTitleIndexNumberEnabled,
|
includeEpisodeTitleIndexNumber,
|
||||||
isOriginalAirDateEnabled,
|
showOriginalAirDateInfo,
|
||||||
isYearEnabled,
|
showYearInfo,
|
||||||
addMiscInfo
|
addMiscInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
addYearInfo(
|
addYearInfo(
|
||||||
isYearEnabled,
|
showYearInfo,
|
||||||
Type,
|
Type,
|
||||||
MediaType,
|
MediaType,
|
||||||
ProductionYear,
|
ProductionYear,
|
||||||
|
@ -503,14 +502,14 @@ function usePrimaryMediaInfo({
|
||||||
RunTimeTicks,
|
RunTimeTicks,
|
||||||
Type,
|
Type,
|
||||||
showFolderRuntime,
|
showFolderRuntime,
|
||||||
isRuntimeEnabled,
|
showRuntimeInfo,
|
||||||
addMiscInfo
|
addMiscInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
addOfficialRatingInfo(
|
addOfficialRatingInfo(
|
||||||
OfficialRating,
|
OfficialRating,
|
||||||
Type,
|
Type,
|
||||||
isOfficialRatingEnabled,
|
showOfficialRatingInfo,
|
||||||
addMiscInfo
|
addMiscInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -518,7 +517,7 @@ function usePrimaryMediaInfo({
|
||||||
|
|
||||||
addPhotoSize(MediaType, Width, Height, addMiscInfo);
|
addPhotoSize(MediaType, Width, Height, addMiscInfo);
|
||||||
|
|
||||||
addAudioContainer(Container, isContainerEnabled, Type, addMiscInfo);
|
addAudioContainer(Container, showAudioContainerInfo, Type, addMiscInfo);
|
||||||
|
|
||||||
return miscInfo;
|
return miscInfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue