forked from fedi/mastodon
Fix tootctl media
commands not handling snowflake ids for media_attachments (#14536)
This commit is contained in:
parent
1326c57506
commit
decc5b9a78
|
@ -89,7 +89,7 @@ module Mastodon
|
||||||
path_segments = object.key.split('/')
|
path_segments = object.key.split('/')
|
||||||
path_segments.delete('cache')
|
path_segments.delete('cache')
|
||||||
|
|
||||||
if path_segments.size != 7
|
unless [7, 10].include?(path_segments.size)
|
||||||
progress.log(pastel.yellow("Unrecognized file found: #{object.key}"))
|
progress.log(pastel.yellow("Unrecognized file found: #{object.key}"))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
@ -133,7 +133,7 @@ module Mastodon
|
||||||
path_segments = key.split(File::SEPARATOR)
|
path_segments = key.split(File::SEPARATOR)
|
||||||
path_segments.delete('cache')
|
path_segments.delete('cache')
|
||||||
|
|
||||||
if path_segments.size != 7
|
unless [7, 10].include?(path_segments.size)
|
||||||
progress.log(pastel.yellow("Unrecognized file found: #{key}"))
|
progress.log(pastel.yellow("Unrecognized file found: #{key}"))
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
@ -258,7 +258,7 @@ module Mastodon
|
||||||
path_segments = path.split('/')[2..-1]
|
path_segments = path.split('/')[2..-1]
|
||||||
path_segments.delete('cache')
|
path_segments.delete('cache')
|
||||||
|
|
||||||
if path_segments.size != 7
|
unless [7, 10].include?(path_segments.size)
|
||||||
say('Not a media URL', :red)
|
say('Not a media URL', :red)
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
@ -311,7 +311,7 @@ module Mastodon
|
||||||
segments = object.key.split('/')
|
segments = object.key.split('/')
|
||||||
segments.delete('cache')
|
segments.delete('cache')
|
||||||
|
|
||||||
next if segments.size != 7
|
next unless [7, 10].include?(segments.size)
|
||||||
|
|
||||||
model_name = segments.first.classify
|
model_name = segments.first.classify
|
||||||
record_id = segments[2..-2].join.to_i
|
record_id = segments[2..-2].join.to_i
|
||||||
|
|
Loading…
Reference in a new issue