Skip to content

Commit

Permalink
feat: Add filter "Has Actor In Watchlist" (xbapps#1657)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored Apr 2, 2024
1 parent bab4072 commit b7de0cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/api/scenes.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ func (i SceneResource) getFilters(req *restful.Request, resp *restful.Response)
outAttributes = append(outAttributes, "Has AI Generated Script")
outAttributes = append(outAttributes, "Has Human Generated Script")
outAttributes = append(outAttributes, "Has Favourite Actor")
outAttributes = append(outAttributes, "Has Actor in Watchlist")
outAttributes = append(outAttributes, "Available from Alternate Sites")
outAttributes = append(outAttributes, "Available from POVR")
outAttributes = append(outAttributes, "Available from VRPorn")
Expand Down
2 changes: 2 additions & 0 deletions pkg/models/model_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,8 @@ func queryScenes(db *gorm.DB, r RequestSceneList) (*gorm.DB, *gorm.DB) {
}
case "Has Favourite Actor":
where = "exists (select * from scene_cast join actors on actors.id=scene_cast.actor_id where actors.favourite=1 and scene_cast.scene_id=scenes.id)"
case "Has Actor in Watchlist":
where = "exists (select * from scene_cast join actors on actors.id=scene_cast.actor_id where actors.watchlist=1 and scene_cast.scene_id=scenes.id)"
case "Available from POVR":
where = "exists (select 1 from external_reference_links where external_source like 'alternate scene %' and external_id like 'povr-%' and internal_db_id = scenes.id)"
case "Available from VRPorn":
Expand Down

0 comments on commit b7de0cc

Please sign in to comment.