-
Notifications
You must be signed in to change notification settings - Fork 14
Add /holes/_sfw endpoint to filter NSFW tagged posts #200
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: KYLN24 <[email protected]>
Co-authored-by: KYLN24 <[email protected]>
Co-authored-by: KYLN24 <[email protected]>
Co-authored-by: KYLN24 <[email protected]>
Co-authored-by: KYLN24 <[email protected]>
Co-authored-by: KYLN24 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new endpoint /api/holes/_sfw that returns holes without NSFW tags, enabling users to filter out not-safe-for-work content. The implementation follows established patterns in the codebase, particularly mirroring the ListGoodHoles endpoint structure.
Key Changes
- New GET endpoint at
/holes/_sfwwith query parameter support for pagination and ordering - SQL query uses LEFT JOIN with subquery to efficiently filter out holes with NSFW tags
- Test coverage validates that NSFW-tagged holes are properly excluded
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apis/hole/routes.go | Registers the new /holes/_sfw route endpoint |
| apis/hole/apis.go | Implements ListSfwHoles handler with LEFT JOIN query to exclude NSFW-tagged holes |
| tests/hole_test.go | Adds test case that creates NSFW and safe holes, verifies NSFW filtering works correctly |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds endpoint to retrieve safe-for-work posts by excluding holes with NSFW tags.
Changes
GET /api/holes/_sfwreturns holes without NSFW tagshole_tagswith subquery for NSFW tag IDs, filtering on NULL matches*auto-setnsfw=true)Implementation
Pattern mirrors
ListGoodHolesendpoint. LEFT JOIN approach scales better than NOT IN subquery for large datasets.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.