Skip to content

Commit

Permalink
refactor(gogoanime,zoro): make code for optional custom domain functi…
Browse files Browse the repository at this point in the history
…onality much cleaner
  • Loading branch information
hase0278 committed May 6, 2024
1 parent 44baeb5 commit afd3081
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/routes/anime/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { redis } from '../../main';
import { Redis } from 'ioredis';

const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {
let gogoanime = new ANIME.Gogoanime();
if(process.env.GOGOANIME_URL){
gogoanime = new ANIME.Gogoanime(process.env.GOGOANIME_URL);
}
const gogoanime = new ANIME.Gogoanime(process.env.GOGOANIME_URL);
const redisCacheTime = 60 * 60;
const redisPrefix = 'gogoanime:';

Expand Down
5 changes: 1 addition & 4 deletions src/routes/anime/zoro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { ANIME } from '@consumet/extensions';
import { StreamingServers } from '@consumet/extensions/dist/models';

const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {
let zoro = new ANIME.Zoro();
if(process.env.ZORO_URL){
zoro = new ANIME.Zoro(process.env.ZORO_URL);
}
const zoro = new ANIME.Zoro(process.env.ZORO_URL);

fastify.get('/', (_, rp) => {
rp.status(200).send({
Expand Down

0 comments on commit afd3081

Please sign in to comment.