From 6005422cea103e802fb0b81ff602dc0fef25024a Mon Sep 17 00:00:00 2001 From: root Date: Sat, 4 Apr 2026 11:50:28 -0500 Subject: [PATCH] Widen all movie|tv type unions to include music|book across frontend and server --- server/api/metadata.ts | 2 +- src/components/BlocklistModal/index.tsx | 2 +- src/components/Discover/FilterSlideover/index.tsx | 2 +- src/components/IssueModal/CreateIssueModal/index.tsx | 2 +- src/components/IssueModal/index.tsx | 2 +- src/components/ManageSlideOver/index.tsx | 2 +- src/components/QuotaSelector/index.tsx | 2 +- src/components/RequestButton/index.tsx | 2 +- src/components/RequestModal/AdvancedRequester/index.tsx | 2 +- src/components/RequestModal/QuotaDisplay/index.tsx | 2 +- src/components/RequestModal/index.tsx | 2 +- src/components/Selector/index.tsx | 4 ++-- src/components/TitleCard/ErrorCard.tsx | 2 +- src/components/TitleCard/TmdbTitleCard.tsx | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/server/api/metadata.ts b/server/api/metadata.ts index cd1936cb..40e2f8d9 100644 --- a/server/api/metadata.ts +++ b/server/api/metadata.ts @@ -5,7 +5,7 @@ import { getSettings, MetadataProviderType } from '@server/lib/settings'; import logger from '@server/logger'; export const getMetadataProvider = async ( - mediaType: 'movie' | 'tv' | 'anime' + mediaType: 'movie' | 'tv' | 'anime' | 'music' | 'book' ): Promise => { try { const settings = await getSettings(); diff --git a/src/components/BlocklistModal/index.tsx b/src/components/BlocklistModal/index.tsx index 0c386c8f..1bef744d 100644 --- a/src/components/BlocklistModal/index.tsx +++ b/src/components/BlocklistModal/index.tsx @@ -12,7 +12,7 @@ import { useIntl } from 'react-intl'; interface BlocklistModalProps { tmdbId: number; - type: 'movie' | 'tv' | 'collection'; + type: 'movie' | 'tv' | 'music' | 'book' | 'collection'; show: boolean; onComplete?: () => void; onCancel?: () => void; diff --git a/src/components/Discover/FilterSlideover/index.tsx b/src/components/Discover/FilterSlideover/index.tsx index a20cb501..004df17c 100644 --- a/src/components/Discover/FilterSlideover/index.tsx +++ b/src/components/Discover/FilterSlideover/index.tsx @@ -50,7 +50,7 @@ const messages = defineMessages('components.Discover.FilterSlideover', { type FilterSlideoverProps = { show: boolean; onClose: () => void; - type: 'movie' | 'tv'; + type: 'movie' | 'tv' | 'music' | 'book'; currentFilters: FilterOptions; }; diff --git a/src/components/IssueModal/CreateIssueModal/index.tsx b/src/components/IssueModal/CreateIssueModal/index.tsx index eb8d1776..4b3c4454 100644 --- a/src/components/IssueModal/CreateIssueModal/index.tsx +++ b/src/components/IssueModal/CreateIssueModal/index.tsx @@ -48,7 +48,7 @@ const classNames = (...classes: string[]) => { }; interface CreateIssueModalProps { - mediaType: 'movie' | 'tv'; + mediaType: 'movie' | 'tv' | 'music' | 'book'; tmdbId?: number; onCancel?: () => void; } diff --git a/src/components/IssueModal/index.tsx b/src/components/IssueModal/index.tsx index bf7e923a..b4ff7571 100644 --- a/src/components/IssueModal/index.tsx +++ b/src/components/IssueModal/index.tsx @@ -4,7 +4,7 @@ import { Transition } from '@headlessui/react'; interface IssueModalProps { show?: boolean; onCancel: () => void; - mediaType: 'movie' | 'tv'; + mediaType: 'movie' | 'tv' | 'music' | 'book'; tmdbId: number; issueId?: never; } diff --git a/src/components/ManageSlideOver/index.tsx b/src/components/ManageSlideOver/index.tsx index 86c7808f..1837da0f 100644 --- a/src/components/ManageSlideOver/index.tsx +++ b/src/components/ManageSlideOver/index.tsx @@ -82,7 +82,7 @@ const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => { }; interface ManageSlideOverProps { - // mediaType: 'movie' | 'tv'; + // mediaType: 'movie' | 'tv' | 'music' | 'book'; show?: boolean; onClose: () => void; revalidate: () => void; diff --git a/src/components/QuotaSelector/index.tsx b/src/components/QuotaSelector/index.tsx index 0f0454e2..7f9d3639 100644 --- a/src/components/QuotaSelector/index.tsx +++ b/src/components/QuotaSelector/index.tsx @@ -14,7 +14,7 @@ const messages = defineMessages('components.QuotaSelector', { }); interface QuotaSelectorProps { - mediaType: 'movie' | 'tv'; + mediaType: 'movie' | 'tv' | 'music' | 'book'; defaultDays?: number; defaultLimit?: number; dayOverride?: number; diff --git a/src/components/RequestButton/index.tsx b/src/components/RequestButton/index.tsx index 55b14c6c..bf72517b 100644 --- a/src/components/RequestButton/index.tsx +++ b/src/components/RequestButton/index.tsx @@ -45,7 +45,7 @@ interface ButtonOption { } interface RequestButtonProps { - mediaType: 'movie' | 'tv'; + mediaType: 'movie' | 'tv' | 'music' | 'book'; onUpdate: () => void; tmdbId: number; media?: Media; diff --git a/src/components/RequestModal/AdvancedRequester/index.tsx b/src/components/RequestModal/AdvancedRequester/index.tsx index c9362ae8..a60573a6 100644 --- a/src/components/RequestModal/AdvancedRequester/index.tsx +++ b/src/components/RequestModal/AdvancedRequester/index.tsx @@ -50,7 +50,7 @@ export type RequestOverrides = { }; interface AdvancedRequesterProps { - type: 'movie' | 'tv'; + type: 'movie' | 'tv' | 'music' | 'book'; is4k: boolean; isAnime?: boolean; defaultOverrides?: RequestOverrides; diff --git a/src/components/RequestModal/QuotaDisplay/index.tsx b/src/components/RequestModal/QuotaDisplay/index.tsx index 99ffaab0..e3477a75 100644 --- a/src/components/RequestModal/QuotaDisplay/index.tsx +++ b/src/components/RequestModal/QuotaDisplay/index.tsx @@ -30,7 +30,7 @@ const messages = defineMessages('components.RequestModal.QuotaDisplay', { interface QuotaDisplayProps { quota?: QuotaStatus; - mediaType: 'movie' | 'tv'; + mediaType: 'movie' | 'tv' | 'music' | 'book'; userOverride?: number | null; remaining?: number; overLimit?: number; diff --git a/src/components/RequestModal/index.tsx b/src/components/RequestModal/index.tsx index 19874179..76c2135d 100644 --- a/src/components/RequestModal/index.tsx +++ b/src/components/RequestModal/index.tsx @@ -8,7 +8,7 @@ import type { NonFunctionProperties } from '@server/interfaces/api/common'; interface RequestModalProps { show: boolean; - type: 'movie' | 'tv' | 'collection'; + type: 'movie' | 'tv' | 'music' | 'book' | 'collection'; tmdbId: number; is4k?: boolean; editRequest?: NonFunctionProperties; diff --git a/src/components/Selector/index.tsx b/src/components/Selector/index.tsx index 2c459466..a683b242 100644 --- a/src/components/Selector/index.tsx +++ b/src/components/Selector/index.tsx @@ -144,7 +144,7 @@ export const CompanySelector = ({ }; type GenreSelectorProps = (BaseSelectorMultiProps | BaseSelectorSingleProps) & { - type: 'movie' | 'tv'; + type: 'movie' | 'tv' | 'music' | 'book'; }; export const GenreSelector = ({ @@ -369,7 +369,7 @@ export const KeywordSelector = ({ }; type WatchProviderSelectorProps = { - type: 'movie' | 'tv'; + type: 'movie' | 'tv' | 'music' | 'book'; region?: string; activeProviders?: number[]; onChange: (region: string, value: number[]) => void; diff --git a/src/components/TitleCard/ErrorCard.tsx b/src/components/TitleCard/ErrorCard.tsx index 93356c81..7eac7d5c 100644 --- a/src/components/TitleCard/ErrorCard.tsx +++ b/src/components/TitleCard/ErrorCard.tsx @@ -10,7 +10,7 @@ interface ErrorCardProps { id: number; tmdbId: number; tvdbId?: number; - type: 'movie' | 'tv'; + type: 'movie' | 'tv' | 'music' | 'book'; canExpand?: boolean; } diff --git a/src/components/TitleCard/TmdbTitleCard.tsx b/src/components/TitleCard/TmdbTitleCard.tsx index 825e52cc..60669b22 100644 --- a/src/components/TitleCard/TmdbTitleCard.tsx +++ b/src/components/TitleCard/TmdbTitleCard.tsx @@ -9,7 +9,7 @@ export interface TmdbTitleCardProps { id: number; tmdbId: number; tvdbId?: number; - type: 'movie' | 'tv'; + type: 'movie' | 'tv' | 'music' | 'book'; canExpand?: boolean; isAddedToWatchlist?: boolean; mutateParent?: () => void;