Fix filtering directory

pull/10/head v3.3.3
Jéluchu 5 years ago
parent 9107698f04
commit c65a5bd3e4

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

2
package-lock.json generated

@ -1,6 +1,6 @@
{ {
"name": "aruppi", "name": "aruppi",
"version": "3.3.2", "version": "3.3.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

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

@ -75,10 +75,10 @@ const getAllAnimes = async () =>{
}; };
const getAllDirectory = async (notNSWF) =>{ const getAllDirectory = async (genres) =>{
let data let data
if (notNSWF) { if (genres === "sfw") {
data = JSON.parse(JSON.stringify(require('../assets/directory.json'))).filter(function (item) { data = JSON.parse(JSON.stringify(require('../assets/directory.json'))).filter(function (item) {
return !item.genres.includes("Ecchi") && !item.genres.includes("ecchi"); return !item.genres.includes("Ecchi") && !item.genres.includes("ecchi");
}) })

@ -59,10 +59,10 @@ router.get('/allAnimes' , (req, res) =>{
}); });
router.get('/allDirectory/:notNSWF?' , (req, res) =>{ router.get('/allDirectory/:genres?' , (req, res) =>{
let notNSWF = req.params.notNSWF; let genres = req.params.genres;
api.getAllDirectory(notNSWF) api.getAllDirectory(genres)
.then(directory =>{ .then(directory =>{
if (directory.length > 0) { if (directory.length > 0) {
res.status(200).json({ res.status(200).json({

@ -70,7 +70,7 @@ const getAllAnimes = async () =>{
}; };
const getAllDirectory = async (notNSWF) =>{ return await getDirectory(notNSWF); }; const getAllDirectory = async (genres) =>{ return await getDirectory(genres); };
const getAnitakume = async () =>{ const getAnitakume = async () =>{

@ -61,11 +61,11 @@ router.get('/allAnimes' , (req, res) =>{
}); });
router.get('/allDirectory/:notNSWF?' , (req, res) =>{ router.get('/allDirectory/:genres?' , (req, res) =>{
let notNSWF = req.params.notNSWF; let genres = req.params.genres;
api.getAllDirectory(notNSWF) api.getAllDirectory(genres)
.then(directory =>{ .then(directory =>{
if (directory.length > 0) { if (directory.length > 0) {
res.status(200).json({ res.status(200).json({

@ -487,10 +487,10 @@ const getThemes = async (themes) => {
const getAnimes = async () => await homgot(`${BASE_ANIMEFLV}api/animes/list`, { parse: true }); const getAnimes = async () => await homgot(`${BASE_ANIMEFLV}api/animes/list`, { parse: true });
const getDirectory = async (notNSWF) => { const getDirectory = async (genres) => {
let data let data
if (notNSWF) { if (genres === "sfw") {
data = JSON.parse(JSON.stringify(require('../../assets/directory.json'))).filter(function (item) { data = JSON.parse(JSON.stringify(require('../../assets/directory.json'))).filter(function (item) {
return !item.genres.includes("Ecchi") && !item.genres.includes("ecchi"); return !item.genres.includes("Ecchi") && !item.genres.includes("ecchi");
}) })

Loading…
Cancel
Save