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:
@@ -15,6 +15,8 @@ class ActivityPub::TagManager
|
||||
def url_for(target)
|
||||
return target.url if target.respond_to?(:local?) && !target.local?
|
||||
|
||||
return unless target.respond_to?(:object_type)
|
||||
|
||||
case target.object_type
|
||||
when :person
|
||||
target.instance_actor? ? about_more_url(instance_actor: true) : short_account_url(target)
|
||||
|
@@ -184,19 +184,6 @@ class MediaAttachment < ApplicationRecord
|
||||
audio? || video?
|
||||
end
|
||||
|
||||
def variant?(other_file_name)
|
||||
return true if file_file_name == other_file_name
|
||||
return false if file_file_name.nil?
|
||||
|
||||
formats = file.styles.values.map(&:format).compact
|
||||
|
||||
return false if formats.empty?
|
||||
|
||||
extension = File.extname(other_file_name)
|
||||
|
||||
formats.include?(extension.delete('.')) && File.basename(other_file_name, extension) == File.basename(file_file_name, File.extname(file_file_name))
|
||||
end
|
||||
|
||||
def to_param
|
||||
shortcode
|
||||
end
|
||||
|
Reference in New Issue
Block a user