Skip to content
This repository was archived by the owner on Jul 14, 2024. It is now read-only.

Commit 451e4df

Browse files
committed
Update v4.2.2
1 parent 0a30e05 commit 451e4df

File tree

17 files changed

+56
-56
lines changed

17 files changed

+56
-56
lines changed

lib/anify/info.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { redis } from "../redis";
33

44
export async function fetchInfo(id, key) {
55
try {
6-
const { data } = await axios.get(
7-
`https://api.anify.tv/info/${id}?apikey=${key}`
8-
);
6+
const { data } = await axios.get(`https://api.anify.tv/info/${id}`);
97
return data;
108
} catch (error) {
119
console.error("Error fetching data:", error);

lib/anify/page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { redis } from "../redis";
22

33
// Function to fetch new data
4-
async function fetchData(id, chapterNumber, providerId, chapterId, key) {
4+
async function fetchData(id, chapterNumber, providerId, chapterId) {
55
try {
66
const res = await fetch(
7-
`https://api.anify.tv/pages/${id}/${chapterNumber}/${providerId}/${chapterId}&apikey=${key}`
7+
`https://api.anify.tv/pages/${id}/${chapterNumber}/${providerId}/${chapterId}`
88
);
99
const data = await res.json();
1010
return data;

lib/anilist/aniAdvanceSearch.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ export async function aniAdvanceSearch({
2727
const response = await fetch("https://api.anify.tv/search-advanced", {
2828
method: "POST",
2929
body: JSON.stringify({
30-
type: "manga",
31-
genres: categorizedGenres,
30+
sort: "averageRating",
31+
sortDirection: "DESC",
32+
...(categorizedGenres && { ...categorizedGenres }),
3233
...(search && { query: search }),
3334
...(page && { page: page }),
3435
...(perPage && { perPage: perPage }),
35-
...(format && { format: format }),
36-
...(seasonYear && { year: seasonYear }),
37-
...(type && { type: type }),
36+
...(format && { format: [format] }),
37+
...(seasonYear && { year: Number(seasonYear) }),
38+
...(type && { type: format === "NOVEL" ? "novel" : type }),
3839
}),
3940
});
4041

lib/consumet/manga/getChapters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let API_URL;
2-
API_URL = process.env.API_URI;
2+
API_URL = process.env.API_URI || null || null;
33
// remove / from the end of the url if it exists
4-
if (API_URL.endsWith("/")) {
4+
if (API_URL && API_URL.endsWith("/")) {
55
API_URL = API_URL.slice(0, -1);
66
}
77

lib/consumet/manga/getPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
let API_URL;
2-
API_URL = process.env.API_URI;
2+
API_URL = process.env.API_URI || null;
33
// remove / from the end of the url if it exists
4-
if (API_URL.endsWith("/")) {
4+
if (API_URL && API_URL.endsWith("/")) {
55
API_URL = API_URL.slice(0, -1);
66
}
77

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "moopa",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"private": true,
55
"founder": "Factiven",
66
"scripts": {

pages/admin/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export async function getServerSideProps(context) {
2929
const admin = sessions?.user?.name === process.env.ADMIN_USERNAME;
3030

3131
let api;
32-
api = process.env.API_URI;
33-
if (api.endsWith("/")) {
32+
api = process.env.API_URI || null;
33+
if (api && api.endsWith("/")) {
3434
api = api.slice(0, -1);
3535
}
3636

pages/api/v2/episode/[id].js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import appendMetaToEpisodes from "@/utils/appendMetaToEpisodes";
44

55
let CONSUMET_URI;
66

7-
CONSUMET_URI = process.env.API_URI;
8-
if (CONSUMET_URI.endsWith("/")) {
7+
CONSUMET_URI = process.env.API_URI || null;
8+
if (CONSUMET_URI && CONSUMET_URI.endsWith("/")) {
99
CONSUMET_URI = CONSUMET_URI.slice(0, -1);
1010
}
1111

@@ -96,13 +96,7 @@ async function fetchConsumet(id) {
9696

9797
async function fetchAnify(id) {
9898
try {
99-
if (!process.env.API_KEY) {
100-
return [];
101-
}
102-
103-
const { data } = await axios.get(
104-
`https://api.anify.tv/episodes/${id}?apikey=${API_KEY}`
105-
);
99+
const { data } = await axios.get(`https://api.anify.tv/episodes/${id}`);
106100

107101
if (!data) {
108102
return [];
@@ -138,7 +132,7 @@ async function fetchCoverImage(id, available = false) {
138132
}
139133

140134
const { data } = await axios.get(
141-
`https://api.anify.tv/content-metadata/${id}?apikey=${API_KEY}`
135+
`https://api.anify.tv/content-metadata/${id}`
142136
);
143137

144138
if (!data) {

pages/api/v2/etc/recent/[page].js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { rateLimiterRedis, redis } from "@/lib/redis";
22

33
let API_URL;
4-
API_URL = process.env.API_URI;
5-
if (API_URL.endsWith("/")) {
4+
API_URL = process.env.API_URI || null;
5+
if (API_URL && API_URL.endsWith("/")) {
66
API_URL = API_URL.slice(0, -1);
77
}
88

0 commit comments

Comments
 (0)