Add boto3 dependency and update exercise/machine assets
- Added boto3 as a dependency in pyproject.toml and uv.lock. - Introduced multiple new exercise images in various formats (jpg, webp, avif, png). - Added new machine images to enhance the workout assets library.
This commit is contained in:
@@ -112,12 +112,45 @@ async def logic_request(
|
||||
@app.post("/media/images", response_model=MediaUploadRead, status_code=status.HTTP_201_CREATED)
|
||||
async def upload_image(
|
||||
user: CurrentUser,
|
||||
entity_type: Annotated[str, Query(pattern="^(equipment|exercise)$")],
|
||||
entity_type: Annotated[str, Query(pattern="^(equipment|exercise|machine)$")],
|
||||
file: Annotated[UploadFile, File()],
|
||||
) -> dict[str, str]:
|
||||
if entity_type == "equipment":
|
||||
entity_type = "machine"
|
||||
return await upload_catalog_image(file, user.id, entity_type)
|
||||
|
||||
|
||||
@app.get("/catalog/activity-sources")
|
||||
async def list_activity_sources(
|
||||
user: CurrentUser,
|
||||
search: str | None = None,
|
||||
kind: Annotated[str | None, Query(pattern="^(exercise|machine|equipment)$")] = None,
|
||||
category: str | None = None,
|
||||
scope: Annotated[str, Query(pattern="^(all|builtin|mine)$")] = "all",
|
||||
) -> Any:
|
||||
params = {
|
||||
key: value
|
||||
for key, value in {
|
||||
"search": search,
|
||||
"kind": kind,
|
||||
"category": category,
|
||||
"scope": scope,
|
||||
}.items()
|
||||
if value not in (None, "")
|
||||
}
|
||||
return await logic_request(
|
||||
"GET",
|
||||
"/internal/catalog/activity-sources",
|
||||
user,
|
||||
params=params,
|
||||
)
|
||||
|
||||
|
||||
@app.post("/catalog/activity-sources", status_code=status.HTTP_201_CREATED)
|
||||
async def create_activity_source(payload: dict[str, Any], user: CurrentUser) -> Any:
|
||||
return await logic_request("POST", "/internal/catalog/activity-sources", user, json=payload)
|
||||
|
||||
|
||||
@app.get("/catalog/equipment")
|
||||
async def list_equipment(user: CurrentUser, search: str | None = None) -> Any:
|
||||
return await logic_request(
|
||||
@@ -220,7 +253,7 @@ async def remove_workout_set(item_id: str, set_id: str, user: CurrentUser) -> No
|
||||
@app.get("/analytics/progression")
|
||||
async def progression(
|
||||
user: CurrentUser,
|
||||
kind: Annotated[str, Query(pattern="^(exercise|equipment)$")] = "exercise",
|
||||
kind: Annotated[str, Query(pattern="^(exercise|machine|equipment)$")] = "exercise",
|
||||
entity_id: str | None = None,
|
||||
) -> Any:
|
||||
p: dict[str, Any] = {"kind": kind}
|
||||
|
||||
Reference in New Issue
Block a user