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
7281ce67
Commit
7281ce67
authored
9 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Fix medium db mapper
parent
fc812c4e
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
+20
-20
20 additions, 20 deletions
src/videoag_common/objects/medium.py
with
20 additions
and
20 deletions
src/videoag_common/objects/medium.py
+
20
−
20
View file @
7281ce67
...
...
@@ -74,9 +74,10 @@ class SourceMedium(DeletableApiObject, Base):
data_notes
=
"
Only calculated once this is sorted
"
)
)
metadata
:
Mapped
[
JsonTypes
]
=
api_mapped
(
# metadata is reserved
file_metadata
:
Mapped
[
JsonTypes
]
=
api_mapped
(
mapped_column
(
sql
.
JSON
,
nullable
=
True
),
Api
Data
Field
(
Api
Json
Field
(
include_in_data
=
True
,
# See source file sorter for contents
data_notes
=
"
Only calculated once this is sorted. There are no guarantees regarding the content
"
...
...
@@ -195,8 +196,8 @@ class TargetMedium(DeletableApiObject, Base):
return
options
class
File
Target
Medium
(
TargetMedium
):
file_path
:
Mapped
[
str
]
=
mapped_column
(
String
(
collation
=
STRING_COLLATION
),
nullable
=
True
,
index
=
True
)
# TODO move?
class
FileMedium
(
ApiObject
):
file_path
:
Mapped
[
str
]
=
mapped_column
(
String
(
collation
=
STRING_COLLATION
),
nullable
=
True
,
use_existing_column
=
True
,
index
=
True
)
# TODO move?
@api_include_in_data
(
type_id
=
"
string
"
,
...
...
@@ -212,81 +213,80 @@ class FileTargetMedium(TargetMedium):
return
f
"
{
self
.
process_target_id
}
.
{
self
.
id
}
"
class
SingleAudioContainingMedium
(
TargetMedium
):
class
SingleAudioContainingMedium
(
ApiObject
):
audio_sample_rate
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
,
help
=
"
In Hz
"
data_notes
=
"
In Hz
"
)
)
audio_channel_count
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
class
SingleVideoContainingMedium
(
TargetMedium
):
class
SingleVideoContainingMedium
(
ApiObject
):
video_vertical_resolution
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
video_horizontal_resolution
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
video_frame_rate_numerator
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
video_frame_rate_denominator
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
class
PlainVideoTargetMedium
(
File
TargetMedium
,
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
__mapper_args__
=
{
"
polymorphic_identity
"
:
TargetMediumType
.
PLAIN_VIDEO
}
duration_sec
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
# TODO check vars not null (except audio)
class
PlainAudioTargetMedium
(
File
TargetMedium
,
SingleAudioContainingMedium
):
class
PlainAudioTargetMedium
(
TargetMedium
,
FileMedium
,
SingleAudioContainingMedium
):
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__mapper_args__
=
{
"
polymorphic_identity
"
:
TargetMediumType
.
PLAIN_AUDIO
}
duration_sec
:
Mapped
[
int
]
=
api_mapped
(
mapped_column
(
nullable
=
True
),
mapped_column
(
nullable
=
True
,
use_existing_column
=
True
),
ApiIntegerField
(
include_in_data
=
True
)
)
class
ThumbnailTargetMedium
(
File
Target
Medium
):
class
ThumbnailTargetMedium
(
FileMedium
):
__tablename__
=
None
# Prevent our own base from adding a table name. This should be a single-table inheritance
__mapper_args__
=
{
"
polymorphic_identity
"
:
TargetMediumType
.
THUMBNAIL
...
...
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