TmdbDiscoverItem type + browser api types
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user