returnrender_error(YiffyAPIErrorCodes::IMAGES_IMAGE_RESPONSE_DISABLED,error:"Image response has been disabled. Please use the json response.")ifparams[:category].ends_with?("/image")
returnrender_error(YiffyAPIErrorCodes::BULK_IMAGES_NUMBER_GT_MAX,error:"Total amount of images requested is greater than #{@apikey.bulk_limit} (#{total}).")iftotal>@apikey.bulk_limit
images=APIImage.bulk(req,size_limit)
returnrender_error(YiffyAPIErrorCodes::IMAGES_NO_RESULTS,error:"No results were found. Try changing your search parameters.")ifimages.empty?
# notes << { id: 1, content: "This api host (api.furry.bot) is being removed on June 9th, 2021. Please migrate to https://yiff.rest." } if headers["Host"] == "api.furry.bot"
notes<<{id:2,content:"We've moved to using subdomains for api versioning! e.g. https://v2.yiff.rest. They have the same functionality, just without the version in the path. The /V2 route will not be removed, but v3 and forward will only use the subdomain."}ifrequest.path.start_with?("/V2")
notes<<{id:3,content:"Hey, we see you aren't using an api key. They're free! To get one, visit https://yiff.rest/apikeys."}ifheaders["Authorization"].blank?
# notes << { id: 4, content: "WARNING! This list is STATIC, it can be inaccurate! We recommended parsing the dot notation in https://v2.yiff.rest/categories instead of this!" }
# notes << { id: 5, content: "Since images are getting bigger, we're adding a size limit parameter. Add ?sizeLimit=<size> to limit the size of images we provide you." } if params[:sizeLimit].blank?
notes<<{id:6,content:"You can now hide these notes by setting the notes parameter to disabled. (ex: ?notes=disabled)"}
notes<<{id:7,content:"We now have proper documentation: https://docs.yiff.rest"}
notes<<{id:8,content:"We have a new service available, a thumbnailer for e621. You can see its documentation at https://docs.yiff.rest/thumbnails."}