API: remove various associated fields included by default.
Remove various associated fields that were included by default on certain endpoints. API users can use the only param to include the full association if they need these fields. * /artists.json: urls. * /artist_urls.json: artist. * /comments.json: creator_name and updater_name. * /notes.json: creator_name. * /pools.json: creator_name. * /posts.json: uploader_name, children_ids, pixiv_ugoira_frame_data. * /post_appeals.json: is_resolved. * /post_versions.json: updater_name. * /uploads.json: uploader_name.
This commit is contained in:
@@ -70,8 +70,6 @@ class Upload < ApplicationRecord
|
||||
|
||||
scope :preprocessed, -> { where(status: "preprocessed") }
|
||||
|
||||
api_attributes including: [:uploader_name]
|
||||
|
||||
def initialize_attributes
|
||||
self.uploader_id = CurrentUser.id
|
||||
self.uploader_ip_addr = CurrentUser.ip_addr
|
||||
@@ -175,12 +173,6 @@ class Upload < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
module UploaderMethods
|
||||
def uploader_name
|
||||
uploader.name
|
||||
end
|
||||
end
|
||||
|
||||
module VideoMethods
|
||||
def video
|
||||
@video ||= FFMPEG::Movie.new(file.path)
|
||||
@@ -229,7 +221,6 @@ class Upload < ApplicationRecord
|
||||
|
||||
include FileMethods
|
||||
include StatusMethods
|
||||
include UploaderMethods
|
||||
include VideoMethods
|
||||
extend SearchMethods
|
||||
include SourceMethods
|
||||
|
||||
Reference in New Issue
Block a user