TmdbDiscoverItem type + browser api types

This commit is contained in:
2026-04-25 20:04:13 +03:00
parent 74dc9bac00
commit c746ce1b7c
3 changed files with 68 additions and 2 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import { getTmdbImageUrl } from '../api/tmdb'
import type { BaseItemDto } from '../api/types'
import type { TmdbDiscoverItem } from '../api/tmdb'
/**
* Convert a TMDB result row (movie / tv / multi) into a synthetic
@@ -10,7 +11,7 @@ import type { BaseItemDto } from '../api/types'
* clicking opens the existing detail page instead of the synthetic one.
*/
export function mapTmdbToJf(
items: any[],
items: TmdbDiscoverItem[],
libraryMap?: Map<string, { id: string; name: string; type: string }>,
): BaseItemDto[] {
return items.map(m => {
@@ -37,7 +38,7 @@ export function mapTmdbToJf(
_tmdbBackdrop: m.backdrop_path ? getTmdbImageUrl(m.backdrop_path, 'w780') : undefined,
_inLibrary: !!local,
_tmdbId: String(m.id),
} as any as BaseItemDto
} as unknown as BaseItemDto
})
}