diff --git a/pkg/api/scenes.go b/pkg/api/scenes.go index 6c8fdc860..4e50ac724 100644 --- a/pkg/api/scenes.go +++ b/pkg/api/scenes.go @@ -391,6 +391,7 @@ func (i SceneResource) getFilters(req *restful.Request, resp *restful.Response) outAttributes = append(outAttributes, "Available from POVR") outAttributes = append(outAttributes, "Available from VRPorn") outAttributes = append(outAttributes, "Available from SLR") + outAttributes = append(outAttributes, "Multiple Scenes Available at an Alternate Site") type Results struct { Result string } diff --git a/pkg/models/model_scene.go b/pkg/models/model_scene.go index 279eb62f7..76970bf7a 100644 --- a/pkg/models/model_scene.go +++ b/pkg/models/model_scene.go @@ -915,6 +915,8 @@ func queryScenes(db *gorm.DB, r RequestSceneList) (*gorm.DB, *gorm.DB) { where = "exists (select 1 from external_reference_links where external_source like 'alternate scene %' and external_id like 'slr-%' and internal_db_id = scenes.id)" case "Available from Alternate Sites": where = "exists (select 1 from external_reference_links where external_source like 'alternate scene %' and internal_db_id = scenes.id)" + case "Multiple Scenes Available at an Alternate Site": + where = "exists (select 1 from external_reference_links where external_source like 'alternate scene %' and internal_db_id = scenes.id group by external_source having count(*)>1)" } if negate {