From 5c59f46cec843d0d1e635884ce5ab92aa2258b72 Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Fri, 30 Aug 2024 23:14:16 -0500 Subject: [PATCH] Fix api v2 index erroring on /V2 --- app/controllers/yiff_rest/api_v2_controller.rb | 2 +- app/jobs/e621_exports_job.rb | 2 ++ app/jobs/e621_status_update_job.rb | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/yiff_rest/api_v2_controller.rb b/app/controllers/yiff_rest/api_v2_controller.rb index 1fc1711..99401d8 100644 --- a/app/controllers/yiff_rest/api_v2_controller.rb +++ b/app/controllers/yiff_rest/api_v2_controller.rb @@ -9,7 +9,7 @@ module YiffRest before_action -> { track_usage("images") }, only: %i[index categories category image] 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 = category[3..] if category.start_with?("v2.") diff --git a/app/jobs/e621_exports_job.rb b/app/jobs/e621_exports_job.rb index dede0c5..f57cb50 100644 --- a/app/jobs/e621_exports_job.rb +++ b/app/jobs/e621_exports_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class E621ExportsJob < ApplicationJob queue_as :low_priority diff --git a/app/jobs/e621_status_update_job.rb b/app/jobs/e621_status_update_job.rb index ead9930..4fa4a5b 100644 --- a/app/jobs/e621_status_update_job.rb +++ b/app/jobs/e621_status_update_job.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class E621StatusUpdateJob < ApplicationJob queue_as :low_priority