fix(aniplay): Migrates to Aniwatch only
Removes Consumet and consolidates episode fetching to use Aniwatch as the sole provider. This simplifies the codebase and ensures a consistent data source for episodes and URLs. Also updates `wrangler` and sets `ENABLE_ANIFY` to false.
This commit is contained in:
@@ -97,12 +97,12 @@ async function fetchEpisodes(
|
||||
.then(
|
||||
(res) =>
|
||||
res.json() as Promise<{
|
||||
success: boolean;
|
||||
status: number;
|
||||
data: AniwatchEpisodesResponse;
|
||||
}>,
|
||||
)
|
||||
.then(({ success, data }) => {
|
||||
if (!success || data.totalEpisodes === 0) {
|
||||
.then(({ status, data }) => {
|
||||
if (status >= 300 || data.totalEpisodes === 0) {
|
||||
console.error(
|
||||
`Error trying to load episodes from aniwatch; aniListId: ${aniListId}, totalEpisodes: ${data.totalEpisodes}`,
|
||||
);
|
||||
@@ -164,12 +164,12 @@ function getAniwatchId(
|
||||
}
|
||||
|
||||
const json = (await res.value.json()) as {
|
||||
success: boolean;
|
||||
status: number;
|
||||
data: AniwatchSearchResponse;
|
||||
};
|
||||
const currentValue = await current;
|
||||
return {
|
||||
success: currentValue.success || json.success,
|
||||
success: currentValue.success || json.status === 200,
|
||||
data: {
|
||||
...currentValue.data,
|
||||
animes: [
|
||||
|
||||
Reference in New Issue
Block a user