From 3d1c50b3ceb100e53266cada957a9fa0c5e5a76b Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Mon, 21 Oct 2024 18:09:37 -0500 Subject: [PATCH] Delete files before changes --- app/models/api_image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/api_image.rb b/app/models/api_image.rb index 95f99f2..5e44c54 100644 --- a/app/models/api_image.rb +++ b/app/models/api_image.rb @@ -223,8 +223,8 @@ class APIImage < ApplicationRecord raise(Error, "Attempted to convert to unknown external: #{url}") end ExternalAPIImage.create!(api_image: self, external_id: external_id, site: type) - update_columns(artists: [], sources: [], width: 0, height: 0, mime_type: "external", file_ext: "external", file_size: 0) delete_files! + update_columns(artists: [], sources: [], width: 0, height: 0, mime_type: "external", file_ext: "external", file_size: 0) send_converted end end