mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-05 05:55:36 +05:00
Compare commits
4 commits
e64118a2a1
...
be0731cfba
Author | SHA1 | Date | |
---|---|---|---|
be0731cfba | |||
42d6874cb4 | |||
fa720deb4a | |||
50b3ca79b5 |
5 changed files with 35 additions and 10 deletions
|
@ -72,6 +72,14 @@ async function loadHooks() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.get("/", async (req, res) => {
|
||||||
|
res.status(200);
|
||||||
|
res.set({
|
||||||
|
"Content-Type": "text/html; charset=utf-8",
|
||||||
|
});
|
||||||
|
res.send("");
|
||||||
|
});
|
||||||
|
|
||||||
app.get("/player", async (req, res) => {
|
app.get("/player", async (req, res) => {
|
||||||
let url = req.query.url || null;
|
let url = req.query.url || null;
|
||||||
|
|
||||||
|
@ -269,6 +277,7 @@ app.post("/*path", async (req, res) => {
|
||||||
"application/json",
|
"application/json",
|
||||||
"application/x-www-form-urlencoded",
|
"application/x-www-form-urlencoded",
|
||||||
"multipart/form-data",
|
"multipart/form-data",
|
||||||
|
"x-unknown/unknown"
|
||||||
];
|
];
|
||||||
|
|
||||||
const isSupported = supportedContentTypes.includes(
|
const isSupported = supportedContentTypes.includes(
|
||||||
|
@ -287,7 +296,7 @@ app.post("/*path", async (req, res) => {
|
||||||
let apiResponse: null | Response = null;
|
let apiResponse: null | Response = null;
|
||||||
const apiHeaders: ANIXART_HEADERST = {
|
const apiHeaders: ANIXART_HEADERST = {
|
||||||
"User-Agent": ANIXART_HEADERS["User-Agent"],
|
"User-Agent": ANIXART_HEADERS["User-Agent"],
|
||||||
"Content-Type": req.headers["content-type"] || "application/json"
|
"Content-Type": req.headers["content-type"] || "application/json",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -314,7 +323,7 @@ app.post("/*path", async (req, res) => {
|
||||||
body: new URLSearchParams(req.body),
|
body: new URLSearchParams(req.body),
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "application/json":
|
default:
|
||||||
apiResponse = await fetch(url.toString(), {
|
apiResponse = await fetch(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: apiHeaders,
|
headers: apiHeaders,
|
||||||
|
|
|
@ -58,6 +58,7 @@ export const ENDPOINTS = {
|
||||||
profileFavorites: `${API_PREFIX}/search/favorites`,
|
profileFavorites: `${API_PREFIX}/search/favorites`,
|
||||||
profiles: `${API_PREFIX}/search/profiles`,
|
profiles: `${API_PREFIX}/search/profiles`,
|
||||||
releases: `${API_PREFIX}/search/releases`,
|
releases: `${API_PREFIX}/search/releases`,
|
||||||
|
collections: `${API_PREFIX}/search/collections`,
|
||||||
},
|
},
|
||||||
statistic: {
|
statistic: {
|
||||||
addHistory: `${API_PREFIX}/history/add`,
|
addHistory: `${API_PREFIX}/history/add`,
|
||||||
|
|
|
@ -28,10 +28,12 @@ export const CollectionLink = (props: any) => {
|
||||||
icon_name="material-symbols--favorite"
|
icon_name="material-symbols--favorite"
|
||||||
name_2={props.favorites_count}
|
name_2={props.favorites_count}
|
||||||
/>
|
/>
|
||||||
<Chip
|
{props.comment_count && (
|
||||||
icon_name="material-symbols--comment"
|
<Chip
|
||||||
name_2={props.comment_count}
|
icon_name="material-symbols--comment"
|
||||||
/>
|
name_2={props.comment_count}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{props.is_private && (
|
{props.is_private && (
|
||||||
<div className="flex items-center justify-center bg-yellow-400 rounded-sm">
|
<div className="flex items-center justify-center bg-yellow-400 rounded-sm">
|
||||||
<span className="w-3 px-4 py-2.5 text-white sm:px-4 sm:py-3 xl:px-6 xl:py-4 iconify mdi--lock"></span>
|
<span className="w-3 px-4 py-2.5 text-white sm:px-4 sm:py-3 xl:px-6 xl:py-4 iconify mdi--lock"></span>
|
||||||
|
|
|
@ -61,8 +61,13 @@ const whereMapping = [
|
||||||
auth: true,
|
auth: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "collections",
|
id: "collections_all",
|
||||||
label: "Коллекциях",
|
label: "Всех Коллекциях",
|
||||||
|
auth: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "collections_fav",
|
||||||
|
label: "Своих Коллекциях",
|
||||||
auth: true,
|
auth: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -179,6 +184,7 @@ export function SearchPage() {
|
||||||
url.searchParams.set("query", query);
|
url.searchParams.set("query", query);
|
||||||
url.searchParams.set("params", JSON.stringify(params));
|
url.searchParams.set("params", JSON.stringify(params));
|
||||||
router.replace(url.toString());
|
router.replace(url.toString());
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [query]);
|
}, [query]);
|
||||||
|
|
||||||
const getKey = (pageIndex: number, previousPageData: any) => {
|
const getKey = (pageIndex: number, previousPageData: any) => {
|
||||||
|
@ -214,7 +220,10 @@ export function SearchPage() {
|
||||||
case "favorites":
|
case "favorites":
|
||||||
url = `${ENDPOINTS.search.profileFavorites}/${pageIndex}`;
|
url = `${ENDPOINTS.search.profileFavorites}/${pageIndex}`;
|
||||||
break;
|
break;
|
||||||
case "collections":
|
case "collections_all":
|
||||||
|
url = `${ENDPOINTS.search.collections}/${pageIndex}`;
|
||||||
|
break;
|
||||||
|
case "collections_fav":
|
||||||
url = `${ENDPOINTS.search.profileFavoriteCollection}/${pageIndex}`;
|
url = `${ENDPOINTS.search.profileFavoriteCollection}/${pageIndex}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -385,7 +394,7 @@ export function SearchPage() {
|
||||||
content.length > 0 ?
|
content.length > 0 ?
|
||||||
params.where == "profiles" ?
|
params.where == "profiles" ?
|
||||||
<UserSection content={content} />
|
<UserSection content={content} />
|
||||||
: params.where == "collections" ?
|
: ["collections_all", "collections_fav"].includes(params.where) ?
|
||||||
<CollectionsSection content={content} />
|
<CollectionsSection content={content} />
|
||||||
: <ReleaseSection content={content} />
|
: <ReleaseSection content={content} />
|
||||||
: <div className="flex flex-col items-center justify-center min-w-full gap-4 mt-12 text-xl">
|
: <div className="flex flex-col items-center justify-center min-w-full gap-4 mt-12 text-xl">
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
# 3.8.0
|
# 3.8.0
|
||||||
|
|
||||||
|
## Добавлено
|
||||||
|
|
||||||
|
- Поиск среди всех коллекций
|
||||||
|
|
||||||
## Изменено
|
## Изменено
|
||||||
|
|
||||||
- Фильтры на странице поиска были перемещены рядом с полем ввода
|
- Фильтры на странице поиска были перемещены рядом с полем ввода
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue