Update front to not use deprecated apis

This commit is contained in:
Zoe Roux 2024-02-19 16:50:51 +01:00
parent d1158cab05
commit 8269d80620
5 changed files with 5 additions and 5 deletions

View File

@ -122,6 +122,6 @@ export const MediaInfoPopup = ({
}; };
MediaInfoPopup.query = (mediaType: string, mediaSlug: string): QueryIdentifier<WatchInfo> => ({ MediaInfoPopup.query = (mediaType: string, mediaSlug: string): QueryIdentifier<WatchInfo> => ({
path: ["video", mediaType, mediaSlug, "info"], path: [mediaType, mediaSlug, "info"],
parser: WatchInfoP, parser: WatchInfoP,
}); });

View File

@ -41,7 +41,7 @@ export const useDownloader = () => {
// TODO: This methods does not work with auth. // TODO: This methods does not work with auth.
const a = document.createElement("a"); const a = document.createElement("a");
a.style.display = "none"; a.style.display = "none";
a.href = `${kyooApiUrl}/video/${type}/${slug}/direct`; a.href = `${kyooApiUrl}/${type}/${slug}/direct`;
a.download = `${slug}.${info.extension}`; a.download = `${slug}.${info.extension}`;
document.body.appendChild(a); document.body.appendChild(a);
a.click(); a.click();

View File

@ -185,7 +185,7 @@ const download = (
const task = RNBackgroundDownloader.download({ const task = RNBackgroundDownloader.download({
id: id, id: id,
// TODO: support variant qualities // TODO: support variant qualities
url: `${account.apiUrl}/video/${type}/${slug}/direct`, url: `${account.apiUrl}/${type}/${slug}/direct`,
destination: path, destination: path,
headers: { headers: {
Authorization: account.token.access_token, Authorization: account.token.access_token,

View File

@ -94,7 +94,7 @@ export const useScrubber = (url: string) => {
}; };
useScrubber.query = (url: string): QueryIdentifier<string> => ({ useScrubber.query = (url: string): QueryIdentifier<string> => ({
path: ["video", url, "thumbnails.vtt"], path: [url, "thumbnails.vtt"],
parser: null!, parser: null!,
options: { options: {
plainText: true, plainText: true,

View File

@ -193,7 +193,7 @@ Player.query = (type: "episode" | "movie", slug: string): QueryIdentifier<Item>
}; };
Player.infoQuery = (type: "episode" | "movie", slug: string): QueryIdentifier<WatchInfo> => ({ Player.infoQuery = (type: "episode" | "movie", slug: string): QueryIdentifier<WatchInfo> => ({
path: ["video", type, slug, "info"], path: [type, slug, "info"],
parser: WatchInfoP, parser: WatchInfoP,
}); });