Notice: We are now selling NEW Gelbooru Merch~! Domestic shipping is free on all orders! Do you have an artist tag on Gelbooru? Let us know so we can properly credit you!

Ticket Information - ID: #1015

ID:Category:SeverityReproducibilityDate SubmittedUpdated By:
0001015Feature RequestnormalN/A05/06/20 10:03AMbakape
Assigned to:geltas
View StatusPublic
Target Version:N/A
Summary:.sample in JSON API is now an int
Description:`.sample` in posts returned by used to be a bool and now it's an int. Are you reverting or it's an int for good?
Additional Info:sample:
"source": "http:\/\/\/member_illust.php?mode=medium&illust_id=81003494",
"directory": "ae\/f9",
"hash": "aef9bf97ac79e5ab921e77713e986db8",
"height": 2566,
"id": 5264098,
"image": "aef9bf97ac79e5ab921e77713e986db8.jpg",
"change": 1588050029,
"owner": "danbooru",
"parent_id": null,
"rating": "e",
"sample": 1,
"sample_height": 1099,
"sample_width": 850,
"score": 3,
"tags": "1boy 1girl absurdres ahegao areolae back bald blush breasts cellphone cleavage commentary_request dark_skin dark_skinned_male grin happy_sex highres huge_breasts jewelry large_breasts mahou_shoujo_madoka_magica namida_boshi nipples nude panties phone puffy_nipples purple_hair red_eyes ring sakura_kyouko sex smartphone smile straddling sweat trembling underwear upright_straddle wedding_band",
"width": 1984,
"file_url": "https:\/\/\/images\/ae\/f9\/aef9bf97ac79e5ab921e77713e986db8.jpg",
"created_at": "Mon Apr 27 16:00:36 -0500 2020"
lozertuser replied at 2020-05-06 12:01:00
It should always return 0 or 1. So technically it's an int, but also a bool. We haven't touched the json api in a long time, so it's been like this for some time.

bakape replied at 2020-05-06 13:41:31
It was a bool for at least from Dec 2, 2018 to Dec 20, 2019. I have unit test that would fail on an int and logs show them passing in that period.

But if you say it was always supposed to be an int, that's fine.

lozertuser replied at 2020-05-06 19:22:57
Interesting... I haven't touched the API in some time, except to add a new field, but it's possible I changed that, however unlikely.

bakape replied at 2020-05-07 01:04:10
This sounds like a change in a library. If you updated your libs some time in 2020 or do not have library version locking that would probably be it.