Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix tootctl media commands not handling snowflake ids for media_att…
Browse files Browse the repository at this point in the history
…achments (mastodon#14536)
  • Loading branch information
ClearlyClaire authored Aug 9, 2020
1 parent 1326c57 commit decc5b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mastodon/media_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def remove_orphans
path_segments = object.key.split('/')
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}"))
next
end
Expand Down Expand Up @@ -133,7 +133,7 @@ def remove_orphans
path_segments = key.split(File::SEPARATOR)
path_segments.delete('cache')

if path_segments.size != 7
unless [7, 10].include?(path_segments.size)
progress.log(pastel.yellow("Unrecognized file found: #{key}"))
next
end
Expand Down Expand Up @@ -258,7 +258,7 @@ def lookup(url)
path_segments = path.split('/')[2..-1]
path_segments.delete('cache')

if path_segments.size != 7
unless [7, 10].include?(path_segments.size)
say('Not a media URL', :red)
exit(1)
end
Expand Down Expand Up @@ -311,7 +311,7 @@ def preload_records_from_mixed_objects(objects)
segments = object.key.split('/')
segments.delete('cache')

next if segments.size != 7
next unless [7, 10].include?(segments.size)

model_name = segments.first.classify
record_id = segments[2..-2].join.to_i
Expand Down

0 comments on commit decc5b9

Please sign in to comment.