+12
-1
app/post_downloader.rb
+12
-1
app/post_downloader.rb
···
30
31
@report&.update(queue: { length: queue.length })
32
33
+
existing_posts = Post.where(rkey: items.map { |x| AT_URI(x.post_uri).rkey }).to_a
34
+
35
+
items.dup.each do |item|
36
+
if post = existing_posts.detect { |post| post.at_uri == item.post_uri }
37
+
update_item(item, post)
38
+
items.delete(item)
39
+
end
40
+
end
41
+
42
+
next if items.empty?
43
+
44
begin
45
+
response = @sky.get_request('app.bsky.feed.getPosts', { uris: items.map(&:post_uri).uniq })
46
47
response['posts'].each do |data|
48
begin