Models
Models
SQLModels for DB and validation
AssetType
Bases: Enum
Asset type enum Type of SonyCi asset: audio, video, or document / other.
This is not the same as the MediaType of the asset (Audio or Video).
Note: Assets with "status: Uploading" have no type
Source code in chowda/models.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
Batch
Bases: SQLModel
Source code in chowda/models.py
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
unstarted_guids()
Returns the set of GUIDs that are not currently running
Source code in chowda/models.py
470 471 472 473 474 | |
MMIF
Bases: SQLModel
MMIF model
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int | None
|
Primary key |
created_at |
datetime | None
|
Creation timestamp |
media_file_id |
str | None
|
GUID |
media_file |
MediaFile | None
|
MediaFile |
metaflow_run_id |
str | None
|
MetaflowRun ID |
metaflow_run |
MetaflowRun | None
|
MetaflowRun |
batch_output |
Batch | None
|
Batch that generated this MMIF |
batch_inputs |
list[Batch]
|
Batch that uses this as an input |
mmif_location |
str | None
|
S3 URL of the mmif |
Source code in chowda/models.py
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
MediaFile
Bases: SQLModel
Media file model
Attributes:
| Name | Type | Description |
|---|---|---|
guid |
str | None
|
MediaFile GUID |
assets |
list[SonyCiAsset]
|
List of SonyCiAssets |
collections |
list[Collection]
|
List of Collections |
batches |
list[Batch]
|
List of Batches |
metaflow_runs |
list[MetaflowRun]
|
List of MetaflowRuns |
mmifs |
list[MMIF]
|
List of MMIFs |
Source code in chowda/models.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
MediaType
Bases: Enum
Media type enum Type of Media: video or audio. This is not the same as the format of the media file.
FIXME:
Enum class attributes are the values that are stored in the database. The value of the class attribute is the value returned by SonyCi (for validation) But starlette-admin + SQLAlchemy send the value to the db, not the name. Therefore, we need to Capatalize the name to make it match the db value.
Source code in chowda/models.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
SonyCiArchiveStatus
Bases: Enum
SonyCi archive status
Accepted values: - Not archived - Archive in progress - Archived - Restore in progress - Restored
Source code in chowda/models.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
SonyCiAsset
Bases: SonyCiAssetBase
SonyCiAsset model
Source code in chowda/models.py
409 410 411 412 413 414 415 416 417 | |
SonyCiAssetBase
Bases: SQLModel
Shared columns for SonyCi assets and trashbin entries.
Non-table base mixin. Uses sa_type (not sa_column) so each concrete
table subclass gets its own Column instances. Relationships are declared on
the subclasses, since a Column/relationship belongs to a single mapper.
Source code in chowda/models.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | |
SonyCiAssetStatus
Bases: Enum
SonyCi Asset status Status of SonyCi asset
Typical statuses
Created - The asset record has been created in our database. Waiting - Once uploaded the asset's status will transition to Waiting to indicate it is waiting for backend processing jobs to begin (thumbnails, preview proxies, calculating MD5 checksum, extract technical metadata, check for viruses, etc.). Processing - Once those jobs begin its status moves to Processing. Complete - The status will go to Complete when all applicable thumbnails and preview proxies are finished (note: other jobs like calculating MD5 checksum, gathering technical metadata, and performing other verifications may not be completed even though the status is Complete). Failed - If a failure happens during upload the status will go to Failed.
Other statuses
Limited - There were problems generating thumbnails and/or preview proxies, The source file is still available for download. Virus Detected - A virus was found and the file is not downloadable and generally cannot be used in our system. Executable Detected - An executable file was found and the file is not downloadable and generally cannot be used in our system. Deleted - The file has been deleted.
Source code in chowda/models.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
SonyCiEvent
Bases: SQLModel
SonyCiEvent model
A webhook notification received from SonyCi.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
SonyCi event id |
type |
SonyCiEventType | None
|
Type of the event |
createdOn |
datetime | None
|
When SonyCi created the event |
createdBy |
dict[str, Any] | None
|
SonyCi user that triggered the event |
payload |
dict[str, Any] | None
|
The complete event as received from SonyCi |
created_at |
datetime | None
|
When Chowda received the event |
assets |
list[SonyCiAsset]
|
SonyCiAssets referenced by the event |
Source code in chowda/models.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
SonyCiEventType
Bases: Enum
SonyCi webhook event type
The type of notification sent by SonyCi to the webhook API.
Source code in chowda/models.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
SonyCiRestoreStatus
Bases: Enum
SonyCi restore status
Accepted values
- Not restored
- Restore in progress
- Restore failed
- Restored
Source code in chowda/models.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
SonyCiTrashbin
Bases: SonyCiAssetBase
A SonyCiAsset that has been trashed in SonyCi.
Source code in chowda/models.py
420 421 422 423 424 425 426 427 428 | |
SonyCiUploadTransferType
Bases: Enum
SonyCi upload transfer type Indicates how the asset was uploaded.
Valid values are:
- SinglepartHttp
- MultipartHttp
- Aspera
- Copy
- FTP
- WorkspaceSend
- ClipFromSource
Source code in chowda/models.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
User
Bases: SQLModel
User model
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int | None
|
Primary key |
email |
EmailStr
|
User email |
first_name |
str
|
User first name |
last_name |
str
|
User last name |
Source code in chowda/models.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |