about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-08-11 20:15:03 +0200
committerGitHub <noreply@github.com>2020-08-11 20:15:03 +0200
commit59c44ce323d135223fcda0183c6fbdf64a79799a (patch)
treea9f144ae0589d6a312e015dec7a66029bcb6131c /lib
parent03712799e2cd51613c8e73cbd6379c8058fae466 (diff)
parent8ae52dc79235bc9ed6878bed857539d14e0b57da (diff)
Merge pull request #1398 from ThibG/glitch-soc/master
Merge upstream changes
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/media_cli.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb
index 2a4e3e379..7b82c3d22 100644
--- a/lib/mastodon/media_cli.rb
+++ b/lib/mastodon/media_cli.rb
@@ -89,7 +89,7 @@ module Mastodon
             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
@@ -133,7 +133,7 @@ module Mastodon
           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
@@ -258,7 +258,7 @@ module Mastodon
       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
@@ -311,7 +311,7 @@ module Mastodon
         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