mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00

* feat(search): search by id This adds the ability to search by ID (starting with TMDb ID). Since there doesn't seem to be way of searching across movies, tv and persons, I have to search through all 3 and use the first one in the order: movie -> tv -> person Searching by ID is triggered using a 'prefix' just like in the *arrs. * fix: missed some refactoring * feat(search): use locale language * feat(search): search using imdb id * feat(search): search using tvdb id * fix: alias type import * fix: missed some refactoring * fix(search): account for id being a string * feat(search): account for movies/tvs/persons with the same id * feat(search): remove non-null assertion Co-authored-by: Ryan Cohen <ryan@sct.dev>
33 lines
906 B
TypeScript
33 lines
906 B
TypeScript
import type {
|
|
TmdbMovieDetails,
|
|
TmdbMovieResult,
|
|
TmdbPersonDetails,
|
|
TmdbPersonResult,
|
|
TmdbTvDetails,
|
|
TmdbTvResult,
|
|
} from '../api/themoviedb/interfaces';
|
|
|
|
export const isMovie = (
|
|
movie: TmdbMovieResult | TmdbTvResult | TmdbPersonResult
|
|
): movie is TmdbMovieResult => {
|
|
return (movie as TmdbMovieResult).title !== undefined;
|
|
};
|
|
|
|
export const isPerson = (
|
|
person: TmdbMovieResult | TmdbTvResult | TmdbPersonResult
|
|
): person is TmdbPersonResult => {
|
|
return (person as TmdbPersonResult).known_for !== undefined;
|
|
};
|
|
|
|
export const isMovieDetails = (
|
|
movie: TmdbMovieDetails | TmdbTvDetails | TmdbPersonDetails
|
|
): movie is TmdbMovieDetails => {
|
|
return (movie as TmdbMovieDetails).title !== undefined;
|
|
};
|
|
|
|
export const isTvDetails = (
|
|
tv: TmdbMovieDetails | TmdbTvDetails | TmdbPersonDetails
|
|
): tv is TmdbTvDetails => {
|
|
return (tv as TmdbTvDetails).number_of_seasons !== undefined;
|
|
};
|