feat: move some stuff around

This commit is contained in:
2023-08-01 18:35:35 +02:00
parent c5cf629482
commit e51667bbac
9 changed files with 97 additions and 63 deletions

View File

@ -14,6 +14,17 @@ export const menus: Record<string, Menu> = {
},
visible: () => false,
},
{
title: "Clear Cache",
cb: async (state) => {
state.activeState.value = "loading";
await fetch("/api/cache", {
method: "DELETE",
});
state.activeState.value = "normal";
state.visible.value = false;
},
},
{
title: "Add Movie infos",
meta: "",
@ -23,10 +34,6 @@ export const menus: Record<string, Menu> = {
const query = movie.name;
// if (movie.meta.author) {
// query += movie.meta.author;
// }
const response = await fetch(
`/api/tmdb/query?q=${encodeURIComponent(query)}`,
);
@ -41,7 +48,7 @@ export const menus: Record<string, Menu> = {
title: `${m.title} released ${m.release_date}`,
cb: async () => {
state.activeState.value = "loading";
await fetch(`/api/movies/${movie.name}/`, {
await fetch(`/api/movies/enhance/${movie.name}/`, {
method: "POST",
body: JSON.stringify({ tmdbId: m.id }),
});