AtoraSuunva / booru

Searches boorus for images using some js magic
https://www.npmjs.com/package/booru
MIT License
80 stars 19 forks source link

Score does not counted #86

Closed Hatsune-Mikun closed 2 years ago

Hatsune-Mikun commented 2 years ago

I seen this problem in 2.5.3 ver and also in 2.5.6 ver of library Code example:

 let res = await BooruSearch(defaultSite.toLowerCase(), tags);
console.log(res.score);

So, if we check documentation, we can see that res.score must be score of post in Number type Score even not only 0 everytime, he's also sometimes became to the null(in 2.5.3 ver, at least all time been 0) console.log screenshot Check this problem please

AtoraSuunva commented 2 years ago

Which booru is this on? I think it might be one of the boorus returning null scores on deleted posts

Hatsune-Mikun commented 2 years ago

For example, this one have 1 score, but library return 0 https://safebooru.org/index.php?page=post&s=view&json=1&id=3781312

But which post return null i cannot intruduce, need to make some tests again for figure out this

AtoraSuunva commented 2 years ago

Looks like some posts on safebooru just straight up return "score": null image (from https://safebooru.org/index.php?page=dapi&s=post&q=index&json=1&tags=1boy+3girls+bad_hands+breasts&limit=1&pid=1)

Your particular example post also has "score": null in the API

I have no idea if the website is wrong, or if the API is wrong, but I think the only way for me to handle this is to just show the score as 0 (because it's impossible to determine what they mean by "null")

Hatsune-Mikun commented 2 years ago

Understood I can understand that problem cause also like you making library for public using and parsing Anyway, shall we gonna write to booru devs about that? If is that possible to do

Sorry for delay 。゚・(>﹏<)・゚。

AtoraSuunva commented 2 years ago

It looks like safebooru is running Gelbooru Beta 0.2.0, which is out of date (Gelbooru says they're on Gelbooru Beta 0.2.5)

I'd have to test and see if Gelbooru has it fixed (or ask them, somehow) to see if this is something safebooru can fix by updating

Hatsune-Mikun commented 2 years ago

Please, let me know when you gonna fix it(i know, it's proble of API, so i mean, when they are gonna fix it and you'll update package) and then close this ticket Good luck, my сolleague ✊

Hatsune-Mikun commented 2 years ago

As i can see, score is work now, so i close this ticket Idk is it your fix/update or Gelbooru API, but anyway thx for replaying!