Change tootctl media remove-orphans
to work for all classes (#13316)
Change `tootctl media lookup` to not use an interactive prompt
This commit is contained in:
@ -24,6 +24,19 @@ module Paperclip
|
||||
flush_deletes
|
||||
end
|
||||
end
|
||||
|
||||
def variant?(other_filename)
|
||||
return true if original_filename == other_filename
|
||||
return false if original_filename.nil?
|
||||
|
||||
formats = styles.values.map(&:format).compact
|
||||
|
||||
return false if formats.empty?
|
||||
|
||||
other_extension = File.extname(other_filename)
|
||||
|
||||
formats.include?(other_extension.delete('.')) && File.basename(other_filename, other_extension) == File.basename(original_filename, File.extname(original_filename))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user