🤖 Fixing some issues with extraInfo in the call to getEpisodes

pull/46/head
capitanwesler 4 years ago
parent 5708086201
commit f2e13f5201

@ -19,6 +19,7 @@ module.exports = {
'class-methods-use-this': 'off',
camelcase: 'off',
'no-unused-vars': 'warn',
'no-undef': 'warn',
},
settings: {
'import/resolver': {

@ -1,4 +1,4 @@
# **Aruppi API** (v4.0.6)
# **Aruppi API** (v4.0.7)
> This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture
>

@ -1,6 +1,6 @@
{
"name": "aruppi",
"version": "4.0.6",
"version": "4.0.7",
"description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app",
"main": "./src/api/api.ts",
"scripts": {

@ -26,7 +26,7 @@ routes.get('/api/v4/', (req: Request, res: Response) => {
res.json({
message: 'Aruppi /api - 🎏',
author: 'Jéluchu',
version: '4.0.6',
version: '4.0.7',
credits: 'The bitch loves /apis that offers data to Aruppi App',
entries: [
{

@ -344,9 +344,6 @@ export const jkanimeInfo = async (id: string | undefined, mal_id: number) => {
let countEpisodes: string[] = [];
try {
/* Extra info of the anime */
extraInfo = await animeExtraInfo(mal_id);
if (redisClient.connected) {
const resultQueryRedis: any = await redisClient.get(
`jkanimeInfo_${hashStringMd5(id!)}`,
@ -363,8 +360,11 @@ export const jkanimeInfo = async (id: string | undefined, mal_id: number) => {
scrapy: true,
parse: false,
});
/* Extra info of the anime */
extraInfo = (await animeExtraInfo(mal_id)) || undefined;
} catch (err) {
return err;
console.log(err);
}
countEpisodes = $('div.anime__pagination a')
@ -377,6 +377,7 @@ export const jkanimeInfo = async (id: string | undefined, mal_id: number) => {
'-',
)[1];
if (extraInfo) {
let broadCastDate = new Date();
let dd: number, mm: string | number, yyyy: number;
@ -428,6 +429,7 @@ export const jkanimeInfo = async (id: string | undefined, mal_id: number) => {
});
}
}
}
for (let i = 1; i <= parseInt(episodesCount); i++) {
episodesList.push({
@ -468,9 +470,6 @@ export const monoschinosInfo = async (
let extraInfo: any;
try {
/* Extra info of the anime */
extraInfo = await animeExtraInfo(mal_id);
if (redisClient.connected) {
const resultQueryRedis: any = await redisClient.get(
`monoschinosInfo_${hashStringMd5(id!)}`,
@ -487,10 +486,14 @@ export const monoschinosInfo = async (
scrapy: true,
parse: false,
});
/* Extra info of the anime */
extraInfo = (await animeExtraInfo(mal_id)) || undefined;
} catch (err) {
return err;
console.log(err);
}
if (extraInfo) {
let broadCastDate = new Date();
let dd: number, mm: string | number, yyyy: number;
@ -542,6 +545,7 @@ export const monoschinosInfo = async (
});
}
}
}
$('.SerieCaps a').each((index: number, element: cheerio.Element) => {
let episode: number;
@ -593,9 +597,6 @@ export const tioanimeInfo = async (id: string | undefined, mal_id: number) => {
let extraInfo: any;
try {
/* Extra info of the anime */
extraInfo = await animeExtraInfo(mal_id);
if (redisClient.connected) {
const resultQueryRedis: any = await redisClient.get(
`tioanimeInfo_${hashStringMd5(id!)}`,
@ -612,10 +613,14 @@ export const tioanimeInfo = async (id: string | undefined, mal_id: number) => {
scrapy: true,
parse: false,
});
/* Extra info of the anime */
extraInfo = (await animeExtraInfo(mal_id)) || undefined;
} catch (err) {
return err;
console.log(err);
}
if (extraInfo) {
let broadCastDate = new Date();
let dd: number, mm: string | number, yyyy: number;
@ -667,6 +672,7 @@ export const tioanimeInfo = async (id: string | undefined, mal_id: number) => {
});
}
}
}
const scripts: cheerio.Element[] = $('script').toArray();

Loading…
Cancel
Save