Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 69 additions & 24 deletions backend/openapi-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ components:
type: string
media_files:
items:
$ref: '#/components/schemas/DocumentMedia'
$ref: '#/components/schemas/RemoteDocumentMedia'
title: Media Files
type: array
name:
Expand Down Expand Up @@ -66,7 +66,7 @@ components:
title: Dependencies
type: array
document:
$ref: '#/components/schemas/Document'
$ref: '#/components/schemas/RemoteDocument'
document_id:
format: uuid
title: Document Id
Expand Down Expand Up @@ -229,7 +229,9 @@ components:
type: string
media_files:
items:
$ref: '#/components/schemas/DocumentMedia'
anyOf:
- $ref: '#/components/schemas/LocalDocumentMedia'
- $ref: '#/components/schemas/RemoteDocumentMedia'
title: Media Files
type: array
name:
Expand All @@ -243,25 +245,6 @@ components:
- media_files
title: Document
type: object
DocumentMedia:
properties:
content_type:
title: Content Type
type: string
tags:
items:
type: string
title: Tags
type: array
url:
title: Url
type: string
required:
- url
- content_type
- tags
title: DocumentMedia
type: object
DocumentShareTokenBase:
properties:
can_write:
Expand Down Expand Up @@ -325,7 +308,7 @@ components:
type: string
media_files:
items:
$ref: '#/components/schemas/DocumentMedia'
$ref: '#/components/schemas/RemoteDocumentMedia'
title: Media Files
type: array
name:
Expand Down Expand Up @@ -422,6 +405,21 @@ components:
title: Progress
title: KeepaliveBody
type: object
LocalDocumentMedia:
properties:
path:
title: Path
type: string
tags:
items:
type: string
title: Tags
type: array
required:
- tags
- path
title: LocalDocumentMedia
type: object
LoginResponse:
properties:
token:
Expand Down Expand Up @@ -458,6 +456,53 @@ components:
title: Logged Out Redirect Url
title: PublicConfig
type: object
RemoteDocument:
properties:
changed_at:
title: Changed At
type: string
created_at:
title: Created At
type: string
id:
format: uuid
title: Id
type: string
media_files:
items:
$ref: '#/components/schemas/RemoteDocumentMedia'
title: Media Files
type: array
name:
title: Name
type: string
required:
- id
- name
- created_at
- changed_at
- media_files
title: RemoteDocument
type: object
RemoteDocumentMedia:
properties:
content_type:
title: Content Type
type: string
tags:
items:
type: string
title: Tags
type: array
url:
title: Url
type: string
required:
- tags
- url
- content_type
title: RemoteDocumentMedia
type: object
SetDurationRequest:
properties:
duration:
Expand Down Expand Up @@ -1176,7 +1221,7 @@ paths:
application/json:
schema:
items:
$ref: '#/components/schemas/DocumentMedia'
$ref: '#/components/schemas/RemoteDocumentMedia'
title: Response Get Document Media Api V1 Documents Document Id Media
Files Get
type: array
Expand Down
4 changes: 2 additions & 2 deletions backend/transcribee_backend/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from pydantic.types import AwareDatetime
from sqlmodel import DateTime, Field, Relationship, SQLModel
from transcribee_proto.api import Document as ApiDocument
from transcribee_proto.api import DocumentMedia as ApiDocumentMedia
from transcribee_proto.api import RemoteDocument as ApiDocument
from transcribee_proto.api import RemoteDocumentMedia as ApiDocumentMedia

from transcribee_backend import media_storage

Expand Down
2 changes: 1 addition & 1 deletion backend/transcribee_backend/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import Any, Dict, List, Literal, Optional

from sqlmodel import JSON, Column, Field, ForeignKey, Relationship, SQLModel, Uuid
from transcribee_proto.api import Document as ApiDocument
from transcribee_proto.api import ExportTaskParameters, TaskType
from transcribee_proto.api import RemoteDocument as ApiDocument
from typing_extensions import Self

from transcribee_backend.config import settings
Expand Down
4 changes: 2 additions & 2 deletions backend/transcribee_backend/routers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from sqlalchemy.sql.expression import desc
from sqlmodel import Session, col, select
from transcribee_proto.api import Document as ApiDocument
from transcribee_proto.api import DocumentMedia, ExportTaskParameters
from transcribee_proto.api import DocumentWithAccessInfo as ApiDocumentWithAccessInfo
from transcribee_proto.api import ExportTaskParameters, RemoteDocumentMedia

from transcribee_backend.auth import (
generate_share_token,
Expand Down Expand Up @@ -436,7 +436,7 @@ def get_document(
@document_router.get("/{document_id}/media_files/")
def get_document_media(
auth: AuthInfo = Depends(get_doc_min_readonly_auth),
) -> List[DocumentMedia]:
) -> List[RemoteDocumentMedia]:
return auth.document.as_api_document().media_files


Expand Down
Loading
Loading