diff --git a/app/controllers/oceanic_ws/docs_controller.rb b/app/controllers/oceanic_ws/docs_controller.rb index c3681ed..26ed9e2 100644 --- a/app/controllers/oceanic_ws/docs_controller.rb +++ b/app/controllers/oceanic_ws/docs_controller.rb @@ -17,7 +17,7 @@ module OceanicWs end def latest - redirect_to("/#{latest_version}#{request.fullpath[("/latest".length)..]}") + redirect_to("/#{latest_version}#{request.fullpath[('/latest'.length)..]}") end private diff --git a/app/controllers/yiff_rest/api_v2_controller.rb b/app/controllers/yiff_rest/api_v2_controller.rb index ec0eb04..9c23bc1 100644 --- a/app/controllers/yiff_rest/api_v2_controller.rb +++ b/app/controllers/yiff_rest/api_v2_controller.rb @@ -170,12 +170,13 @@ module YiffRest color = 0x008000 if bulk_categories.present? bulk = <<~BULK + Total: **#{bulk_categories.values.sum}** **Categories:** #{bulk_categories.permit!.to_h.map { |c, l| "- **#{c}**: #{l}" }.join("\n")} BULK color = 0xDC143C if bulk_categories.keys.any? { |k| category_info.find { |c| c.db == k }.sfw } - elsif !(category_info.find { |c| c.db == category }.sfw) + elsif !category_info.find { |c| c.db == category }.sfw color = 0xDC143C end Websites.config.yiffyapi_usage_webhook.execute(embeds: [ diff --git a/app/models/api_image.rb b/app/models/api_image.rb index 47f0a92..96de06a 100644 --- a/app/models/api_image.rb +++ b/app/models/api_image.rb @@ -22,7 +22,6 @@ class APIImage < ApplicationRecord after_destroy :delete_files after_destroy :send_deleted, unless: :no_webhook_messages - def delete_files Websites.config.yiffy2_storage.delete(path) invalidate_cache