Solving a issue with some animes with the (TV) in their names

pull/24/head
Caleídoscopio 5 years ago
parent 992d35799b
commit 4a0846b02b

@ -221,7 +221,13 @@ const getSpecials = async (data) =>{
const getMoreInfo = async (title) =>{ const getMoreInfo = async (title) =>{
try { try {
let data = directoryAnimes; let data = directoryAnimes;
let result = data.filter(anime => fuzzball.ratio(anime.title, title) > 90)[0]; const result = data.filter(x => {
if (x.title === title) {
return x;
}else {
return x.title === `${title} (TV)` ? x : undefined;
}
})[0];
if (!result.jkanime) { if (!result.jkanime) {
return { return {
@ -260,7 +266,13 @@ const getMoreInfo = async (title) =>{
const getEpisodes = async (title) =>{ const getEpisodes = async (title) =>{
try { try {
let data = directoryAnimes; let data = directoryAnimes;
const result = data.filter(x => x.title === title)[0]; const result = data.filter(x => {
if (x.title === title) {
return x;
}else {
return x.title === `${title} (TV)` ? x : undefined;
}
})[0];
if (!result.jkanime) { if (!result.jkanime) {
return await animeflvInfo(result.id).then(episodes => episodes || null); return await animeflvInfo(result.id).then(episodes => episodes || null);

Loading…
Cancel
Save