ugoira: store frame delays in MediaMetadata model.

Store Ugoira frame delays in the MediaMetadata model as a fake EXIF
field instead of in the PixivUgoiraFrameData model. This way we can get
rid of the PixivUgoiraFrameData model completely. This is a step towards
fixing #5264.
This commit is contained in:
evazion
2022-10-09 22:08:37 -05:00
parent 73cc0f65c2
commit 01d10a54f8
5 changed files with 35 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ class Post < ApplicationRecord
belongs_to :uploader, :class_name => "User", :counter_cache => "post_upload_count"
belongs_to :parent, class_name: "Post", optional: true
has_one :media_asset, -> { active }, foreign_key: :md5, primary_key: :md5
has_one :media_metadata, through: :media_asset
has_one :artist_commentary, :dependent => :destroy
has_one :pixiv_ugoira_frame_data, class_name: "PixivUgoiraFrameData", foreign_key: :md5, primary_key: :md5
has_one :vote_by_current_user, -> { active.where(user_id: CurrentUser.id) }, class_name: "PostVote" # XXX using current user here is wrong