add publishing of kontor-model
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s

This commit is contained in:
Thomas Peetz
2026-08-26 18:33:35 +02:00
parent 652378e7de
commit d80aefe6b2
12 changed files with 1743 additions and 1197 deletions
@@ -9,15 +9,49 @@ class MediaLofiResponse(BaseModel):
created_date: datetime
last_modified_date: datetime
version: int
title: str = ""
file_name: str = ""
url: str = ""
review: bool = False
should_download: bool = False
title: str = ""
url: str = ""
class AddLofi(BaseModel):
url: str
class MediaLofiModel(BaseModel):
"""
Pydantic Model to import MediaLofi.
"""
id: str
created_date: datetime
last_modified_date: datetime
version: int = 0
title: str = ""
file_name: str = ""
url: str = ""
review: bool = False
should_download: bool = False
def lofi_to_model(model: MediaLofiResponse, medialofi: MediaLofi) -> MediaLofi:
"""
Set data of response to model
"""
medialofi.file_name = model.file_name
if model.url is not None:
medialofi.url = model.url
else:
medialofi.url = ""
if model.title is not None:
medialofi.title = model.title
else:
medialofi.title = ""
medialofi.last_modified_date = datetime.now()
medialofi.review = model.review
medialofi.should_download = model.should_download
return medialofi
def lofi_to_response(lofi: MediaLofi) -> MediaLofiResponse:
response: MediaLofiResponse = MediaLofiResponse(
id=lofi.id,