Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
338af711
Commit
338af711
authored
4 years ago
by
Gandalf
Browse files
Options
Downloads
Patches
Plain Diff
[JES] Fix tags. Was mistakenly using category instead of hive_post_tags table
parent
0bcdc050
No related branches found
No related tags found
5 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!16
Dk issue 3 concurrent block query rebase
,
!15
Dk issue 3 concurrent block query
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/server/bridge_api/methods.py
+5
-5
5 additions, 5 deletions
hive/server/bridge_api/methods.py
with
5 additions
and
5 deletions
hive/server/bridge_api/methods.py
+
5
−
5
View file @
338af711
...
...
@@ -239,26 +239,26 @@ async def get_ranked_posts(context, sort, start_author='', start_permlink='',
else
:
if
start_author
and
start_permlink
:
if
sort
==
'
trending
'
:
sql
=
sql
%
"""
AND hive_posts_cache.
category
= :tag
sql
=
sql
%
"""
AND hive_posts_cache.
post_id IN (SELECT post_id FROM hive_post_tags WHERE tag
= :tag
)
AND hive_posts_cache.sc_trend <= (SELECT sc_trend FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
AND hive_posts_cache.post_id != (SELECT post_id FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
"""
elif
sort
==
'
hot
'
:
sql
=
sql
%
"""
AND hive_posts_cache.
category
= :tag
sql
=
sql
%
"""
AND hive_posts_cache.
post_id IN (SELECT post_id FROM hive_post_tags WHERE tag
= :tag
)
AND hive_posts_cache.sc_hot <= (SELECT sc_hot FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
AND hive_posts_cache.post_id != (SELECT post_id FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
"""
elif
sort
==
'
created
'
:
sql
=
sql
%
"""
AND hive_posts_cache.
category
= :tag
sql
=
sql
%
"""
AND hive_posts_cache.
post_id IN (SELECT post_id FROM hive_post_tags WHERE tag
= :tag
)
AND hive_posts_cache.post_id < (SELECT post_id FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
"""
elif
sort
==
'
promoted
'
:
sql
=
sql
%
"""
AND hive_posts_cache.
category
= :tag
sql
=
sql
%
"""
AND hive_posts_cache.
post_id IN (SELECT post_id FROM hive_post_tags WHERE tag
= :tag
)
AND hive_posts_cache.promoted <= (SELECT promoted FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
AND hive_posts_cache.post_id != (SELECT post_id FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
"""
else
:
sql
=
sql
%
"""
AND hive_posts_cache.
category
= :tag
sql
=
sql
%
"""
AND hive_posts_cache.
post_id IN (SELECT post_id FROm hive_post_tags WHERE tag
= :tag
)
AND hive_posts_cache.payout <= (SELECT payout FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
AND hive_posts_cache.post_id != (SELECT post_id FROM hive_posts_cache WHERE permlink = :permlink AND author = :author)
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment