Skip to content

Commit

Permalink
make quality an integer, add source mimetype to jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
tykling committed Nov 21, 2024
1 parent ac9048b commit 36d1f3e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/jobs/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class JobResponseSchema(Schema):
user_uuid: uuid.UUID | None = None
source_url: str
source_filename: str
source_mimetype: str

@staticmethod
def resolve_job_uuid(obj: BaseJob, context: dict[str, HttpRequest]) -> uuid.UUID:
Expand All @@ -56,9 +57,9 @@ def resolve_user_uuid(obj: BaseJob, context: dict[str, HttpRequest]) -> uuid.UUI
return obj.user_id # type: ignore[no-any-return]

@staticmethod
def resolve_source_url(obj: BaseJob, context: dict[str, HttpRequest]) -> str:
"""Get the value for the source_url field."""
return obj.source_url
def resolve_source_mimetype(obj: BaseJob, context: dict[str, HttpRequest]) -> str:
"""Get the value for the source_mimetype field."""
return str(obj.basefile.mimetype)


class ImageConversionJobResponseSchema(JobResponseSchema):
Expand Down Expand Up @@ -125,7 +126,7 @@ class SettingsSchema(Schema):

filetypes: dict[str, dict[str, str]]
licenses: dict[str, str]
encoding: dict[str, dict[str, dict[str, bool | float]]]
encoding: dict[str, dict[str, dict[str, bool | int]]]


class SettingsResponseSchema(Schema):
Expand Down

0 comments on commit 36d1f3e

Please sign in to comment.