Fix api v2 index erroring on /V2

This commit is contained in:
Donovan Daniels 2024-08-30 23:14:16 -05:00
parent de85fe72a4
commit 5c59f46cec
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
3 changed files with 5 additions and 1 deletions

View File

@ -9,7 +9,7 @@ module YiffRest
before_action -> { track_usage("images") }, only: %i[index categories category image] before_action -> { track_usage("images") }, only: %i[index categories category image]
def index def index
return render_error(YiffyAPIErrorCodes::IMAGES_IMAGE_RESPONSE_DISABLED, error: "Image response has been disabled. Please use the json response.") if params[:category].ends_with?("/image") return render_error(YiffyAPIErrorCodes::IMAGES_IMAGE_RESPONSE_DISABLED, error: "Image response has been disabled. Please use the json response.") if params[:category]&.ends_with?("/image")
category = params[:category]&.downcase&.gsub("/", ".") || "" category = params[:category]&.downcase&.gsub("/", ".") || ""
category = category[3..] if category.start_with?("v2.") category = category[3..] if category.start_with?("v2.")

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class E621ExportsJob < ApplicationJob class E621ExportsJob < ApplicationJob
queue_as :low_priority queue_as :low_priority

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class E621StatusUpdateJob < ApplicationJob class E621StatusUpdateJob < ApplicationJob
queue_as :low_priority queue_as :low_priority