bitrate filter (#4713)

This commit is contained in:
NodudeWasTaken 2024-03-21 02:36:08 +01:00 committed by GitHub
parent 62b8ffb2b6
commit a369613d42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 0 deletions

View File

@ -231,6 +231,8 @@ input SceneFilterType {
orientation: OrientationCriterionInput
"Filter by frame rate"
framerate: IntCriterionInput
"Filter by bit rate"
bitrate: IntCriterionInput
"Filter by video codec"
video_codec: StringCriterionInput
"Filter by audio codec"

View File

@ -43,6 +43,8 @@ type SceneFilterType struct {
Orientation *OrientationCriterionInput `json:"orientation"`
// Filter by framerate
Framerate *IntCriterionInput `json:"framerate"`
// Filter by bitrate
Bitrate *IntCriterionInput `json:"bitrate"`
// Filter by video codec
VideoCodec *StringCriterionInput `json:"video_codec"`
// Filter by audio codec

View File

@ -957,6 +957,7 @@ func (qb *SceneStore) makeFilter(ctx context.Context, sceneFilter *models.SceneF
query.handleCriterion(ctx, resolutionCriterionHandler(sceneFilter.Resolution, "video_files.height", "video_files.width", qb.addVideoFilesTable))
query.handleCriterion(ctx, orientationCriterionHandler(sceneFilter.Orientation, "video_files.height", "video_files.width", qb.addVideoFilesTable))
query.handleCriterion(ctx, floatIntCriterionHandler(sceneFilter.Framerate, "ROUND(video_files.frame_rate)", qb.addVideoFilesTable))
query.handleCriterion(ctx, intCriterionHandler(sceneFilter.Bitrate, "video_files.bit_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

@ -82,6 +82,7 @@ const criterionOptions = [
ResolutionCriterionOption,
OrientationCriterionOption,
createMandatoryNumberCriterionOption("framerate"),
createMandatoryNumberCriterionOption("bitrate"),
createStringCriterionOption("video_codec"),
createStringCriterionOption("audio_codec"),
createDurationCriterionOption("duration"),

View File

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