scene framerate filter (#4161)

This commit is contained in:
dogwithakeyboard 2023-10-16 06:28:28 +01:00 committed by GitHub
parent 8eb069054e
commit 7605eec6da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 1 deletions

View File

@ -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"

View File

@ -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

View File

@ -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))

View File

@ -72,6 +72,7 @@ const criterionOptions = [
RatingCriterionOption,
createMandatoryNumberCriterionOption("o_counter"),
ResolutionCriterionOption,
createMandatoryNumberCriterionOption("framerate"),
createStringCriterionOption("video_codec"),
createStringCriterionOption("audio_codec"),
createDurationCriterionOption("duration"),

View File

@ -120,6 +120,7 @@ export type CriterionType =
| "o_counter"
| "resolution"
| "average_resolution"
| "framerate"
| "video_codec"
| "audio_codec"
| "duration"