Conflicts: - `README.md`: Our README.md files are completely different. Discarded upstream changes. - `app/javascript/core/admin.js`: Updating rails-ujs, no real conflict, but a comment to close to changed code. Various glitch-soc-only files have been updated to match those changes, though. - `package.json`: No real conflict, just an additional dependency in glitch-soc that was too close to something updated upstream. Took upstream's changes.local
commit
9abb227250
119 changed files with 977 additions and 334 deletions
@ -0,0 +1,12 @@ |
||||
# frozen_string_literal: true |
||||
|
||||
class Api::V2::MediaController < Api::V1::MediaController |
||||
def create |
||||
@media_attachment = current_account.media_attachments.create!({ delay_processing: true }.merge(media_attachment_params)) |
||||
render json: @media_attachment, serializer: REST::MediaAttachmentSerializer, status: 202 |
||||
rescue Paperclip::Errors::NotIdentifiedByImageMagickError |
||||
render json: file_type_error, status: 422 |
||||
rescue Paperclip::Error |
||||
render json: processing_error, status: 500 |
||||
end |
||||
end |
@ -0,0 +1,10 @@ |
||||
.announcements-list__item |
||||
= link_to edit_admin_warning_preset_path(warning_preset), class: 'announcements-list__item__title' do |
||||
= warning_preset.title.presence || truncate(warning_preset.text) |
||||
|
||||
.announcements-list__item__action-bar |
||||
.announcements-list__item__meta |
||||
= truncate(warning_preset.text) |
||||
|
||||
%div |
||||
= table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(warning_preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, warning_preset) |
@ -0,0 +1,34 @@ |
||||
# frozen_string_literal: true |
||||
|
||||
class PostProcessMediaWorker |
||||
include Sidekiq::Worker |
||||
|
||||
sidekiq_options retry: 1, dead: false |
||||
|
||||
sidekiq_retries_exhausted do |msg| |
||||
media_attachment_id = msg['args'].first |
||||
|
||||
ActiveRecord::Base.connection_pool.with_connection do |
||||
begin |
||||
media_attachment = MediaAttachment.find(media_attachment_id) |
||||
media_attachment.processing = :failed |
||||
media_attachment.save |
||||
rescue ActiveRecord::RecordNotFound |
||||
true |
||||
end |
||||
end |
||||
|
||||
Sidekiq.logger.error("Processing media attachment #{media_attachment_id} failed with #{msg['error_message']}") |
||||
end |
||||
|
||||
def perform(media_attachment_id) |
||||
media_attachment = MediaAttachment.find(media_attachment_id) |
||||
media_attachment.processing = :in_progress |
||||
media_attachment.save |
||||
media_attachment.file.reprocess_original! |
||||
media_attachment.processing = :complete |
||||
media_attachment.save |
||||
rescue ActiveRecord::RecordNotFound |
||||
true |
||||
end |
||||
end |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue