mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-11 03:49:07 +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,
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
import IconMagnet from "@/icons/IconMagnet.vue";
|
||||
import IconProfileLock from "@/icons/IconProfileLock.vue";
|
||||
import IconShow from "@/icons/IconShow.vue";
|
||||
import IconBinoculars from "@/icons/IconBinoculars.vue";
|
||||
import { elasticSearchMoviesAndShows } from "@/api";
|
||||
import type { IAutocompleteResult } from "@/interfaces/IAutocompleteSearch";
|
||||
import { trackCommand, getCommandScore } from "@/utils/commandTracking";
|
||||
@@ -180,6 +181,10 @@
|
||||
}
|
||||
> = {
|
||||
home: { icon: IconMovie, description: "Browse movies and TV shows" },
|
||||
discover: {
|
||||
icon: IconBinoculars,
|
||||
description: "Discover movies by category"
|
||||
},
|
||||
activity: { icon: IconActivity, description: "View Plex server activity" },
|
||||
profile: { icon: IconProfile, description: "Manage your profile" },
|
||||
"requests-list": null,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
import { ref, computed } from "vue";
|
||||
import IconKey from "@/icons/IconKey.vue";
|
||||
import IconEmail from "@/icons/IconEmail.vue";
|
||||
import IconBinoculars from "@/icons/IconBinoculars.vue";
|
||||
import IconSearch from "@/icons/IconSearch.vue";
|
||||
import type { Ref } from "vue";
|
||||
|
||||
interface Props {
|
||||
@@ -53,7 +53,7 @@
|
||||
const inputIcon = computed(() => {
|
||||
if (props.type === "password") return IconKey;
|
||||
if (props.type === "email") return IconEmail;
|
||||
if (props.type === "torrents") return IconBinoculars;
|
||||
if (props.type === "torrents") return IconSearch;
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@@ -91,7 +91,8 @@ export function usePlexAuth() {
|
||||
function setPlexAuthCookie(authToken: string) {
|
||||
const expires = new Date();
|
||||
expires.setDate(expires.getDate() + 30);
|
||||
document.cookie = `plex_auth_token=${authToken}; path=/; expires=${expires.toUTCString()}; SameSite=Strict`;
|
||||
const domain = window.location.hostname;
|
||||
document.cookie = `plex_auth_token=${authToken}; domain=.${domain}; path=/; expires=${expires.toUTCString()}; SameSite=Strict`;
|
||||
}
|
||||
|
||||
// Get cookie
|
||||
|
||||
Reference in New Issue
Block a user