Skip to content

Commit

Permalink
scene framerate filter (#4161)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogwithakeyboard authored Oct 16, 2023
1 parent 8eb0690 commit 7605eec
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions graphql/schema/types/filters.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ input SceneFilterType {
duplicated: PHashDuplicationCriterionInput
"Filter by resolution"
resolution: ResolutionCriterionInput
"Filter by frame rate"
framerate: IntCriterionInput
"Filter by video codec"
video_codec: StringCriterionInput
"Filter by audio codec"
Expand Down
2 changes: 2 additions & 0 deletions pkg/models/scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type SceneFilterType struct {
Duplicated *PHashDuplicationCriterionInput `json:"duplicated"`
// Filter by resolution
Resolution *ResolutionCriterionInput `json:"resolution"`
// Filter by framerate
Framerate *IntCriterionInput `json:"framerate"`
// Filter by video codec
VideoCodec *StringCriterionInput `json:"video_codec"`
// Filter by audio codec
Expand Down
2 changes: 1 addition & 1 deletion pkg/sqlite/scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ func (qb *SceneStore) makeFilter(ctx context.Context, sceneFilter *models.SceneF

query.handleCriterion(ctx, floatIntCriterionHandler(sceneFilter.Duration, "video_files.duration", qb.addVideoFilesTable))
query.handleCriterion(ctx, resolutionCriterionHandler(sceneFilter.Resolution, "video_files.height", "video_files.width", qb.addVideoFilesTable))

query.handleCriterion(ctx, floatIntCriterionHandler(sceneFilter.Framerate, "ROUND(video_files.frame_rate)", qb.addVideoFilesTable))
query.handleCriterion(ctx, codecCriterionHandler(sceneFilter.VideoCodec, "video_files.video_codec", qb.addVideoFilesTable))
query.handleCriterion(ctx, codecCriterionHandler(sceneFilter.AudioCodec, "video_files.audio_codec", qb.addVideoFilesTable))

Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/models/list-filter/scenes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const criterionOptions = [
RatingCriterionOption,
createMandatoryNumberCriterionOption("o_counter"),
ResolutionCriterionOption,
createMandatoryNumberCriterionOption("framerate"),
createStringCriterionOption("video_codec"),
createStringCriterionOption("audio_codec"),
createDurationCriterionOption("duration"),
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/models/list-filter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export type CriterionType =
| "o_counter"
| "resolution"
| "average_resolution"
| "framerate"
| "video_codec"
| "audio_codec"
| "duration"
Expand Down

0 comments on commit 7605eec

Please sign in to comment.