Don't forget to lycansubscribe

fixed duplicate post errors

Changed files
+12 -1
app
+12 -1
app/post_downloader.rb
··· 30 30 31 31 @report&.update(queue: { length: queue.length }) 32 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 + 33 44 begin 34 - response = @sky.get_request('app.bsky.feed.getPosts', { uris: items.map(&:post_uri) }) 45 + response = @sky.get_request('app.bsky.feed.getPosts', { uris: items.map(&:post_uri).uniq }) 35 46 36 47 response['posts'].each do |data| 37 48 begin