Skip to content
Merged
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
3 changes: 1 addition & 2 deletions apps/labrinth/src/routes/v3/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,7 @@ pub async fn collection_icon_edit(
262144,
"Icons must be smaller than 256KiB",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;

let collection_id: CollectionId = collection_item.id.into();
let upload_result = crate::util::img::upload_image_optimized(
Expand Down
3 changes: 1 addition & 2 deletions apps/labrinth/src/routes/v3/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ pub async fn images_add(
1_048_576,
"Icons must be smaller than 1MiB",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;

let content_length = bytes.len();
let upload_result = upload_image_optimized(
Expand Down
3 changes: 1 addition & 2 deletions apps/labrinth/src/routes/v3/oauth_clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,7 @@ pub async fn oauth_client_icon_edit(
262144,
"Icons must be smaller than 256KiB",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;
let upload_result = upload_image_optimized(
&format!("data/{client_id}"),
FileHostPublicity::Public,
Expand Down
3 changes: 1 addition & 2 deletions apps/labrinth/src/routes/v3/organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,8 +1376,7 @@ pub async fn organization_icon_edit(
262144,
"Icons must be smaller than 256KiB",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;

let organization_id: OrganizationId = organization_item.id.into();
let upload_result = crate::util::img::upload_image_optimized(
Expand Down
6 changes: 2 additions & 4 deletions apps/labrinth/src/routes/v3/projects/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2344,8 +2344,7 @@ pub async fn project_icon_edit_internal(
262144,
"Icons must be smaller than 256KiB",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;

let project_id: ProjectId = project_item.inner.id.into();
let upload_result = upload_image_optimized(
Expand Down Expand Up @@ -2657,8 +2656,7 @@ pub async fn add_gallery_item_internal(
5 * (1 << 20),
"Gallery image exceeds the maximum of 5MiB.",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;

let id: ProjectId = project_item.inner.id.into();
let upload_result = upload_image_optimized(
Expand Down
3 changes: 1 addition & 2 deletions apps/labrinth/src/routes/v3/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,7 @@ pub async fn user_icon_edit(
262144,
"Icons must be smaller than 256KiB",
)
.await
.wrap_api_err("executing `read_limited_from_payload`")?;
.await?;

let user_id: UserId = actual_user.id.into();
let upload_result = crate::util::img::upload_image_optimized(
Expand Down
Loading