Skip to content

Commit

Permalink
feat: add “Is Passthrough” filter attribute (xbapps#1333)
Browse files Browse the repository at this point in the history
Co-authored-by: crwxaj <crwxaj>
  • Loading branch information
crwxaj authored Jul 12, 2023
1 parent 2479b0f commit f5ce9a6
Show file tree
Hide file tree
Showing 2 changed files with 7 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 @@ -318,6 +318,7 @@ func (i SceneResource) getFilters(req *restful.Request, resp *restful.Response)
outAttributes = append(outAttributes, "Has Subtitles File")
outAttributes = append(outAttributes, "Is Favourite")
outAttributes = append(outAttributes, "Is Scripted")
outAttributes = append(outAttributes, "Is Passthrough")
outAttributes = append(outAttributes, "In Watchlist")
outAttributes = append(outAttributes, "Has Rating")
outAttributes = append(outAttributes, "Has Cuepoints")
Expand Down
6 changes: 6 additions & 0 deletions pkg/models/model_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,12 @@ func QueryScenes(r RequestSceneList, enablePreload bool) ResponseSceneList {
} else {
where = "scenes.favourite = 0"
}
case "Is Passthrough":
if truefalse {
where = "chroma_key != ''"
} else {
where = "chroma_key = ''"
}
case "Stashdb Linked":
if truefalse {
where = "(select count(*) from external_reference_links " + erlAlias + " where " + erlAlias + ".internal_db_id = scenes.id and " + erlAlias + ".`external_source` = 'stashdb scene') > 0"
Expand Down

0 comments on commit f5ce9a6

Please sign in to comment.