Added new type of anime legal platforms

pull/25/head^2
Jéluchu 5 years ago
parent 412897ca90
commit 0ed7927283

@ -281,7 +281,7 @@ const getAnimeServers = async (id) => {
return await videoServersJK(id); return await videoServersJK(id);
} else { } else {
const data = await homgot(`${BASE_ANIMEFLV_JELU}GetAnimeServers/${id}`, { parse: true }); const data = await homgot(`${BASE_ANIMEFLV_JELU}GetAnimeServers/${id}`, { parse: true });
return await transformUrlServer(data.servers); return await transformUrlServer(data.servers);
} }
}; };
@ -426,7 +426,8 @@ const getDestAnimePlatforms = async () => {
return data.map(doc =>({ return data.map(doc =>({
id: doc.id, id: doc.id,
name: doc.name, name: doc.name,
logo: doc.logo logo: doc.logo,
link: doc.link
})); }));
}; };
@ -444,7 +445,7 @@ const getPlatforms = async (id) => {
cover: doc.cover cover: doc.cover
})); }));
} if (id === "producers" || id === "apps" || id === "publishers") { } if (id === "producers" || id === "apps" || id === "publishers" || "events") {
data = await homgot(`${BASE_ARUPPI}res/documents/animelegal/type/${id}.json`, { parse: true }); data = await homgot(`${BASE_ARUPPI}res/documents/animelegal/type/${id}.json`, { parse: true });
@ -460,7 +461,9 @@ const getPlatforms = async (id) => {
twitter: doc.twitter, twitter: doc.twitter,
instagram: doc.instagram, instagram: doc.instagram,
webInfo: doc.webInfo, webInfo: doc.webInfo,
webpage: doc.webpage webpage: doc.webpage,
latitude: doc.latitude || null,
longitude: doc.longitude || null
})); }));
} else { } else {

@ -274,7 +274,7 @@ router.get('/moreInfo/:title' , (req, res) =>{
res.status(200).json(info); res.status(200).json(info);
} else { } else {
res.status(500).json({ message: 'Aruppi lost in the shell'}); res.status(500).json({ message: 'Aruppi lost in the shell'});
} }
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -287,14 +287,14 @@ router.get('/getEpisodes/:title' , (req, res) =>{
api.getEpisodes(title) api.getEpisodes(title)
.then(episodes => { .then(episodes => {
if (episodes.length > 0) { if (episodes.length > 0) {
res.status(200).json({episodes}); res.status(200).json({episodes});
} else { } else {
res.status(500).json({ message: 'Aruppi lost in the shell'}); res.status(500).json({ message: 'Aruppi lost in the shell'});
} }
}).catch((err) =>{ }).catch((err) =>{
console.error(err); console.error(err);
}); });
@ -519,6 +519,7 @@ router.get('/randomAnime', (req, res) => {
api.getRandomAnime() api.getRandomAnime()
.then(anime => { .then(anime => {
if (anime) { if (anime) {
res.set('Cache-Control', 'no-store');
res.status(200).json(anime); res.status(200).json(anime);
}else { }else {
res.status(500).json({ message: 'Aruppi lost in the shell'}); res.status(500).json({ message: 'Aruppi lost in the shell'});

Loading…
Cancel
Save