Remove extra media attachments and support raw array
This commit is contained in:
parent
51cac0760f
commit
57c15e0d7f
6 changed files with 4 additions and 17 deletions
|
@ -36,7 +36,7 @@ class MediaAttachment < ApplicationRecord
|
|||
include RoutingHelper
|
||||
|
||||
LOCAL_STATUS_ATTACHMENT_MAX = 4
|
||||
ACTIVITYPUB_STATUS_ATTACHMENT_MAX = 8
|
||||
ACTIVITYPUB_STATUS_ATTACHMENT_MAX = 16
|
||||
|
||||
enum type: { :image => 0, :gifv => 1, :video => 2, :unknown => 3, :audio => 4 }
|
||||
enum processing: { :queued => 0, :in_progress => 1, :complete => 2, :failed => 3 }, _prefix: true
|
||||
|
|
|
@ -291,14 +291,6 @@ class Status < ApplicationRecord
|
|||
end
|
||||
end
|
||||
|
||||
def ordered_media_attachments_original_mastodon
|
||||
ordered_media_attachments.take(4)
|
||||
end
|
||||
|
||||
def ordered_media_attachments_extra
|
||||
ordered_media_attachments.drop(4).take(4)
|
||||
end
|
||||
|
||||
def replies_count
|
||||
status_stat&.replies_count || 0
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue