Browse Source

展示转嘟,替代 1d0ddd33b6 的临时措施

closed-social-v3
欧醚 2 years ago
parent
commit
5843958caf
2 changed files with 3 additions and 5 deletions
  1. +2
    -1
      app/controllers/api/v1/timelines/public_controller.rb
  2. +1
    -4
      app/models/status.rb

+ 2
- 1
app/controllers/api/v1/timelines/public_controller.rb View File

@ -37,7 +37,8 @@ class Api::V1::Timelines::PublicController < Api::BaseController
current_account, current_account,
local: truthy_param?(:local), local: truthy_param?(:local),
remote: truthy_param?(:remote), remote: truthy_param?(:remote),
only_media: truthy_param?(:only_media)
only_media: truthy_param?(:only_media),
with_reblogs: true
) )
end end

+ 1
- 4
app/models/status.rb View File

@ -88,10 +88,7 @@ class Status < ApplicationRecord
scope :with_accounts, ->(ids) { where(id: ids).includes(:account) } scope :with_accounts, ->(ids) { where(id: ids).includes(:account) }
#scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') } #scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
scope :without_replies, -> { where('statuses.reply = FALSE') } scope :without_replies, -> { where('statuses.reply = FALSE') }
#scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') }
scope :without_reblogs, -> { where('statuses.account_id != 830') }
#scope :without_reblogs, -> { joins('INNER JOIN statuses ori ON (statuses.reblog_of_id is NULL AND ori.id = statuses.id) OR ori.id = statuses.reblog_of_id')
# .where('ori.account_id = statuses.account_id') }
scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') }
scope :with_public_visibility, -> { where(visibility: :public) } scope :with_public_visibility, -> { where(visibility: :public) }
scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) } scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) }
scope :in_chosen_languages, ->(account) { where(language: nil).or where(language: account.chosen_languages) } scope :in_chosen_languages, ->(account) { where(language: nil).or where(language: account.chosen_languages) }

Loading…
Cancel
Save