diff --git a/graphql/schema/types/filters.graphql b/graphql/schema/types/filters.graphql index d1b16976905..cb4cb312789 100644 --- a/graphql/schema/types/filters.graphql +++ b/graphql/schema/types/filters.graphql @@ -300,6 +300,8 @@ input SceneFilterType { created_at: TimestampCriterionInput "Filter by last update time" updated_at: TimestampCriterionInput + "Filter by file size" + file_size: IntCriterionInput "Filter by related galleries that meet this criteria" galleries_filter: GalleryFilterType diff --git a/pkg/models/scene.go b/pkg/models/scene.go index 814c4a41d62..d4ff218c57a 100644 --- a/pkg/models/scene.go +++ b/pkg/models/scene.go @@ -47,6 +47,8 @@ type SceneFilterType struct { VideoCodec *StringCriterionInput `json:"video_codec"` // Filter by audio codec AudioCodec *StringCriterionInput `json:"audio_codec"` + // Filter by File Size + FileSize *IntCriterionInput `json:"file_size"` // Filter by duration (in seconds) Duration *IntCriterionInput `json:"duration"` // Filter to only include scenes which have markers. `true` or `false` diff --git a/pkg/sqlite/scene_filter.go b/pkg/sqlite/scene_filter.go index 3f2233395fa..4a53a0e95af 100644 --- a/pkg/sqlite/scene_filter.go +++ b/pkg/sqlite/scene_filter.go @@ -96,6 +96,7 @@ func (qb *sceneFilterHandler) criterionHandler() criterionHandler { qb.oCountCriterionHandler(sceneFilter.OCounter), boolCriterionHandler(sceneFilter.Organized, "scenes.organized", nil), + intCriterionHandler(sceneFilter.FileSize, "video_files.FileSize", qb.addVideoFilesTable), floatIntCriterionHandler(sceneFilter.Duration, "video_files.duration", qb.addVideoFilesTable), resolutionCriterionHandler(sceneFilter.Resolution, "video_files.height", "video_files.width", qb.addVideoFilesTable), orientationCriterionHandler(sceneFilter.Orientation, "video_files.height", "video_files.width", qb.addVideoFilesTable),