このコミットが含まれているのは:
2026-06-07 02:01:16 +09:00
コミット be2df723fe
8個のファイルの変更222行の追加47行の削除
+6 -1
ファイルの表示
@@ -1,5 +1,10 @@
class TheatrePostSelector
Candidate = Struct.new(:post, :weight, :penalty, :tags, keyword_init: true)
ELIGIBLE_POST_URL_CONDITION =
["url LIKE '%nicovideo.jp%'",
"url LIKE '%youtube.com/watch%'",
"url LIKE '%youtu.be/%'"]
.join(' OR ')
def initialize theatre:
@theatre = theatre
@@ -52,7 +57,7 @@ class TheatrePostSelector
end
def eligible_posts
posts = Post.where("url LIKE '%nicovideo.jp%'")
posts = Post.where(ELIGIBLE_POST_URL_CONDITION)
posts = posts.where.not(id: theatre.current_post_id) if theatre.current_post_id
posts
end