[Cleanup] Remove pixiv_id

This commit is contained in:
Earlopain 2022-03-16 17:11:10 +01:00
parent ee8fb64861
commit aa8e1037bf
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
4 changed files with 2 additions and 28 deletions

View File

@ -28,6 +28,7 @@ module PostIndex
indexes :comment_count, type: 'integer'
indexes :file_size, type: 'integer'
# TODO: Remove
indexes :pixiv_id, type: 'integer'
indexes :parent, type: 'integer'
indexes :pools, type: 'integer'

View File

@ -368,16 +368,6 @@ class ElasticPostQueryBuilder
must.push({term: {has_children: true}})
end
if q[:pixiv_id]
if q[:pixiv_id] == "any"
must.push({exists: {field: :pixiv_id}})
elsif q[:pixiv_id] == "none"
must_not.push({exists: {field: :pixiv_id}})
else
must.push({term: {pixiv_id: q[:pixiv_id].to_i}})
end
end
if q[:rating] =~ /\Aq/
must.push({term: {rating: "q"}})
elsif q[:rating] =~ /\As/

View File

@ -283,16 +283,6 @@ class PostQueryBuilder
relation = relation.where("posts.has_children = TRUE")
end
if q[:pixiv_id]
if q[:pixiv_id] == "any"
relation = relation.where("posts.pixiv_id IS NOT NULL")
elsif q[:pixiv_id] == "none"
relation = relation.where("posts.pixiv_id IS NULL")
else
relation = add_range_relation(q[:pixiv_id], "posts.pixiv_id", relation)
end
end
if q[:rating] =~ /^q/
relation = relation.where("posts.rating = 'q'")
elsif q[:rating] =~ /^s/

View File

@ -18,7 +18,7 @@ class Tag < ApplicationRecord
-pool pool ordpool -fav fav -favoritedby favoritedby md5 -rating rating note -note
-locked locked width height mpixels ratio score favcount filesize source
-source id -id date age order limit -status status tagcount parent -parent
child pixiv_id pixiv search upvote downvote voted filetype -filetype flagger type -type
child search upvote downvote voted filetype -filetype flagger type -type
-flagger disapproval -disapproval set -set randseed -voted
-upvote -downvote description -description change -user_id user_id delreason -delreason
deletedby -deletedby votedup voteddown -votedup -voteddown duration
@ -925,13 +925,6 @@ class Tag < ApplicationRecord
q[:deleter_neg] = User.name_or_id_to_id(g2)
q[:status] ||= 'any'
when "pixiv_id", "pixiv"
if g2.downcase == "any" || g2.downcase == "none"
q[:pixiv_id] = g2.downcase
else
q[:pixiv_id] = parse_helper(g2)
end
when "upvote", "votedup"
if CurrentUser.is_moderator?
q[:upvote] = User.name_or_id_to_id(g2)