Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend_common_py
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
videoag
backend_common_py
Commits
b0ebbfa6
Commit
b0ebbfa6
authored
8 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Add image target medium
parent
b4d6c81c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/videoag_common/objects/medium.py
+32
-7
32 additions, 7 deletions
src/videoag_common/objects/medium.py
with
32 additions
and
7 deletions
src/videoag_common/objects/medium.py
+
32
−
7
View file @
b0ebbfa6
...
@@ -156,6 +156,7 @@ class TargetMediumType(Enum):
...
@@ -156,6 +156,7 @@ class TargetMediumType(Enum):
PLAIN_VIDEO
=
"
plain_video
"
PLAIN_VIDEO
=
"
plain_video
"
PLAIN_AUDIO
=
"
plain_audio
"
PLAIN_AUDIO
=
"
plain_audio
"
THUMBNAIL
=
"
thumbnail
"
THUMBNAIL
=
"
thumbnail
"
IMAGE
=
"
image
"
_TARGET_MEDIUM_TYPE_ENUM
=
create_enum_type
(
TargetMediumType
)
_TARGET_MEDIUM_TYPE_ENUM
=
create_enum_type
(
TargetMediumType
)
...
@@ -194,12 +195,12 @@ class TargetMedium(DeletableApiObject, Base):
...
@@ -194,12 +195,12 @@ class TargetMedium(DeletableApiObject, Base):
name
=
"
check_audio_channel_count_not_null
"
name
=
"
check_audio_channel_count_not_null
"
),
),
CheckConstraint
(
CheckConstraint
(
f
"
type NOT IN (
'
plain_video
'
) OR NOT is_produced OR
video_
vertical_resolution IS NOT NULL
"
,
f
"
type NOT IN (
'
plain_video
'
,
'
thumbnail
'
) OR NOT is_produced OR vertical_resolution IS NOT NULL
"
,
name
=
"
check_
video_
vertical_resolution_not_null
"
name
=
"
check_vertical_resolution_not_null
"
),
),
CheckConstraint
(
CheckConstraint
(
f
"
type NOT IN (
'
plain_video
'
) OR NOT is_produced OR
video_
horizontal_resolution IS NOT NULL
"
,
f
"
type NOT IN (
'
plain_video
'
,
'
thumbnail
'
) OR NOT is_produced OR horizontal_resolution IS NOT NULL
"
,
name
=
"
check_
video_
horizontal_resolution_not_null
"
name
=
"
check_horizontal_resolution_not_null
"
),
),
CheckConstraint
(
CheckConstraint
(
f
"
type NOT IN (
'
plain_video
'
) OR NOT is_produced OR video_frame_rate_numerator IS NOT NULL
"
,
f
"
type NOT IN (
'
plain_video
'
) OR NOT is_produced OR video_frame_rate_numerator IS NOT NULL
"
,
...
@@ -371,13 +372,13 @@ class SingleAudioContainingMedium(ApiObject):
...
@@ -371,13 +372,13 @@ class SingleAudioContainingMedium(ApiObject):
class
SingleVideoContainingMedium
(
ApiObject
):
class
SingleVideoContainingMedium
(
ApiObject
):
video_
vertical_resolution
:
Mapped
[
int
]
=
api_mapped
(
vertical_resolution
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
ApiIntegerField
(
include_in_data
=
True
include_in_data
=
True
)
)
)
)
video_
horizontal_resolution
:
Mapped
[
int
]
=
api_mapped
(
horizontal_resolution
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
ApiIntegerField
(
include_in_data
=
True
include_in_data
=
True
...
@@ -397,6 +398,22 @@ class SingleVideoContainingMedium(ApiObject):
...
@@ -397,6 +398,22 @@ class SingleVideoContainingMedium(ApiObject):
)
)
class
SingleImageContainingMedium
(
ApiObject
):
vertical_resolution
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
horizontal_resolution
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
class
PlainVideoTargetMedium
(
TargetMedium
,
FileMedium
,
SingleVideoContainingMedium
,
SingleAudioContainingMedium
):
class
PlainVideoTargetMedium
(
TargetMedium
,
FileMedium
,
SingleVideoContainingMedium
,
SingleAudioContainingMedium
):
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__mapper_args__
=
{
__mapper_args__
=
{
...
@@ -425,13 +442,21 @@ class PlainAudioTargetMedium(TargetMedium, FileMedium, SingleAudioContainingMedi
...
@@ -425,13 +442,21 @@ class PlainAudioTargetMedium(TargetMedium, FileMedium, SingleAudioContainingMedi
)
)
class
ThumbnailTargetMedium
(
TargetMedium
,
FileMedium
):
# Thumbnail is a different type so that the Frontend knows what to display as the thumbnail
class
ThumbnailTargetMedium
(
TargetMedium
,
FileMedium
,
SingleImageContainingMedium
):
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__mapper_args__
=
{
__mapper_args__
=
{
"
polymorphic_identity
"
:
TargetMediumType
.
THUMBNAIL
"
polymorphic_identity
"
:
TargetMediumType
.
THUMBNAIL
}
}
class
ImageTargetMedium
(
TargetMedium
,
FileMedium
,
SingleImageContainingMedium
):
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__mapper_args__
=
{
"
polymorphic_identity
"
:
TargetMediumType
.
IMAGE
}
class
PublishMedium
(
VisibilityApiObject
,
DeletableApiObject
,
Base
):
class
PublishMedium
(
VisibilityApiObject
,
DeletableApiObject
,
Base
):
__api_data__
=
ApiObjectClass
(
__api_data__
=
ApiObjectClass
(
parent_relationship_config_ids
=
[
"
lecture
"
]
parent_relationship_config_ids
=
[
"
lecture
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment