sinkaroid / jandapress

RESTful and experimental API for nhentai and other doujinshi
https://janda.merahputih.moe
MIT License
50 stars 17 forks source link

randomAsmHentai bug #7

Closed zzAIMoo closed 1 year ago

zzAIMoo commented 1 year ago

Describe the bug When making a request to the /random endpoint of asmhentai it returns every time (atleast all the times i tried it, maybe it works sometimes) an error

To Reproduce Make a request to the /random endpoint of asmhentai

Expected behavior Hentai json return

What happens I get this error: Error: TypeError: Cannot read properties of undefined (reading 'replace') at randomAsmhentai (/home/ubuntu/jandapress/build/src/controller/asmhentai/asmhentaiRandom.js:24:14) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Desktop (please complete the following information):

Additional context The error seems to be cause by the line upload_date: date[1].replace("Added: ", ""), to fast-patch it i put a ternary condition like this: upload_date: date[1] ? date[1].replace("Added: ", "") since i don't really know the structure of the code

da-vinci-bot[bot] commented 1 year ago

Hey! @zzAIMoo You'll get a response soon! UwU

Click here to make your day UmU ![abc](https://gitlab.com/d0g/servant/-/raw/master/pout/sample_1140ec4ebd587b400983e81d5837328d.jpg "UmU")
sinkaroid commented 1 year ago

Actually you right, there is an date section on asmhentai and some are not, that was fixed