Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured image hiding #24

Merged
merged 3 commits into from Jan 26, 2020
Merged

Featured image hiding #24

merged 3 commits into from Jan 26, 2020

Conversation

SomewhatDamaged
Copy link
Contributor

  • I understand my contributions may be rejected for any reason
  • I understand my contributions are for the benefit of Derpibooru and/or the Philomena software
  • I understand my contributions are licensed under the GNU AGPLv3
  • I understand all of the above

This makes sure the Featured Image on the front page obeys user hiding.

It correctly allows non-logged-in users to see the featured image without hindrance.
It obeys hidden=1 special option

This makes sure the Featured Image on the front page obeys user hiding.
Copy link
Collaborator

@liamwhite liamwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good initial approach, but use a SQL NOT EXISTS(subquery) clause instead of conditions on a left join.

Took the `hidden=1` check out of the `WHERE` clause.
@SomewhatDamaged
Copy link
Contributor Author

Ecto doesn't support NOT EXISTS(subquery) syntax. A LEFT JOIN followed by a WHERE is the only way to perform a LEFT ANTI SEMI JOIN, or so I believe.

@liamwhite liamwhite merged commit c972f00 into master Jan 26, 2020
@liamwhite liamwhite deleted the SomewhatDamaged-patch-1 branch January 26, 2020 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants