mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-04-25 01:03:36 +00:00
API & Navigation Updates
Add discover API endpoint, update command palette, and fix Plex auth - Add getTmdbMovieDiscoverByName() function to api.ts for discover categories - Add discover route to command palette with IconBinoculars and description - Replace IconBinoculars with IconSearch for torrent search input in SeasonedInput - Fix Plex auth cookie to include domain attribute for cross-subdomain support
This commit is contained in:
12
src/api.ts
12
src/api.ts
@@ -135,6 +135,17 @@ const getTmdbMovieListByName = async (
|
||||
// .catch(error => { console.error(`api error getting list: ${name}, page: ${page}`); throw error }) // eslint-disable-line no-console
|
||||
};
|
||||
|
||||
const getTmdbMovieDiscoverByName = async (
|
||||
name: string,
|
||||
page = 1
|
||||
): Promise<IList> => {
|
||||
const url = new URL(`/api/v2/movie/discover/${name}`, API_HOSTNAME);
|
||||
url.searchParams.append("page", page.toString());
|
||||
|
||||
return fetch(url.href).then(resp => resp.json());
|
||||
// .catch(error => { console.error(`api error getting list: ${name}, page: ${page}`); throw error }) // eslint-disable-line no-console
|
||||
};
|
||||
|
||||
// Fetches requested items.
|
||||
const getRequests = async (page = 1) => {
|
||||
const url = new URL("/api/v2/request", API_HOSTNAME);
|
||||
@@ -565,6 +576,7 @@ export {
|
||||
getShowCredits,
|
||||
getPersonCredits,
|
||||
getTmdbMovieListByName,
|
||||
getTmdbMovieDiscoverByName,
|
||||
searchTmdb,
|
||||
getUserRequests,
|
||||
getRequests,
|
||||
|
||||
Reference in New Issue
Block a user