identify-media
Version:
Analyse file path and content to make search criteria for media APIs
20 lines • 619 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const search = (param, apikey) => {
const { language, query, type } = param;
return {
method: 'GET',
params: {
api_key: apikey,
language,
query,
year: type === 'movie' ? param.year : undefined,
first_air_date_year: type === 'tv' ? param.year : undefined,
},
baseURL: 'https://api.themoviedb.org',
url: `/3/search/${type || 'multi'}`,
responseType: 'json',
};
};
exports.default = search;
//# sourceMappingURL=search.js.map