about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-08-09 23:25:49 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-08-09 23:25:49 +0200
commit8ec4be4233d2bfd9142860b25df639fc23655f0f (patch)
treee0b7f33c4ae22827a7a56aa9cac5fabdd77ee57f /lib
parenta61645ed30b854a1b4935026801eb5b287954095 (diff)
parent4ac78e2a066508a54de82f1d910ef2fd36c3d106 (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `Gemfile.lock`:
  Not a real conflict, upstream-updated dependency (redis) textually too
  close to glitch-soc-only dependecy.
  Updated redis gem like upstream did.
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/snowflake.rb7
-rw-r--r--lib/paperclip/transcoder.rb2
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/mastodon/snowflake.rb b/lib/mastodon/snowflake.rb
index 9e5bc7383..8e2d82a97 100644
--- a/lib/mastodon/snowflake.rb
+++ b/lib/mastodon/snowflake.rb
@@ -138,10 +138,11 @@ module Mastodon::Snowflake
       end
     end
 
-    def id_at(timestamp)
-      id  = timestamp.to_i * 1000 + rand(1000)
+    def id_at(timestamp, with_random: true)
+      id  = timestamp.to_i * 1000
+      id += rand(1000) if with_random
       id  = id << 16
-      id += rand(2**16)
+      id += rand(2**16) if with_random
       id
     end
 
diff --git a/lib/paperclip/transcoder.rb b/lib/paperclip/transcoder.rb
index e99704086..ec1305038 100644
--- a/lib/paperclip/transcoder.rb
+++ b/lib/paperclip/transcoder.rb
@@ -19,7 +19,7 @@ module Paperclip
       metadata = VideoMetadataExtractor.new(@file.path)
 
       unless metadata.valid?
-        log("Unsupported file #{@file.path}")
+        Paperclip.log("Unsupported file #{@file.path}")
         return File.open(@file.path)
       end