You've already forked AstralRinth
forked from didirus/AstralRinth
MR App 0.9.5 - Big bugfix update (#3585)
* Add launcher_feature_version to Profile * Misc fixes - Add typing to theme and settings stuff - Push instance route on creation from installing a modpack - Fixed servers not reloading properly when first added * Make old instances scan the logs folder for joined servers on launcher startup * Create AttachedWorldData * Change AttachedWorldData interface * Rename WorldType::World to WorldType::Singleplayer * Implement world display status system * Fix Minecraft font * Fix set_world_display_status Tauri error * Add 'Play instance' option * Add option to disable worlds showing in Home * Fixes - Fix available server filter only showing if there are some available - Fixed server and singleplayer filters sometimes showing when there are only servers or singleplayer worlds - Fixed new worlds not being automatically added when detected - Rephrased Jump back into worlds option description * Fixed sometimes more than 6 items showing up in Jump back in * Fix servers.dat issue with instances you haven't played before * Fix too large of bulk requests being made, limit max to 800 #3430 * Add hiding from home page, add types to Mods.vue * Make recent worlds go into grid when display is huge * Fix lint * Remove redundant media query * Fix protocol version on home page, and home page being blocked by pinging servers * Clippy fix * More Clippy fixes * Fix Prettier lints * Undo `from_string` changes --------- Co-authored-by: Josiah Glosson <soujournme@gmail.com> Co-authored-by: Alejandro González <me@alegon.dev>
This commit is contained in:
@@ -424,7 +424,7 @@ pub async fn collection_icon_edit(
|
||||
|
||||
let collection_id: CollectionId = collection_item.id.into();
|
||||
let upload_result = crate::util::img::upload_image_optimized(
|
||||
&format!("data/{}", collection_id),
|
||||
&format!("data/{collection_id}"),
|
||||
bytes.freeze(),
|
||||
&ext.ext,
|
||||
Some(96),
|
||||
|
||||
@@ -393,7 +393,7 @@ pub async fn oauth_client_icon_edit(
|
||||
)
|
||||
.await?;
|
||||
let upload_result = upload_image_optimized(
|
||||
&format!("data/{}", client_id),
|
||||
&format!("data/{client_id}"),
|
||||
bytes.freeze(),
|
||||
&ext.ext,
|
||||
Some(96),
|
||||
|
||||
@@ -1096,7 +1096,7 @@ pub async fn organization_icon_edit(
|
||||
|
||||
let organization_id: OrganizationId = organization_item.id.into();
|
||||
let upload_result = crate::util::img::upload_image_optimized(
|
||||
&format!("data/{}", organization_id),
|
||||
&format!("data/{organization_id}"),
|
||||
bytes.freeze(),
|
||||
&ext.ext,
|
||||
Some(96),
|
||||
|
||||
@@ -676,8 +676,7 @@ pub async fn cancel_payout(
|
||||
.make_paypal_request::<(), ()>(
|
||||
Method::POST,
|
||||
&format!(
|
||||
"payments/payouts-item/{}/cancel",
|
||||
platform_id
|
||||
"payments/payouts-item/{platform_id}/cancel"
|
||||
),
|
||||
None,
|
||||
None,
|
||||
@@ -689,7 +688,7 @@ pub async fn cancel_payout(
|
||||
payouts
|
||||
.make_tremendous_request::<(), ()>(
|
||||
Method::POST,
|
||||
&format!("rewards/{}/cancel", platform_id),
|
||||
&format!("rewards/{platform_id}/cancel"),
|
||||
None,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -810,8 +810,7 @@ async fn project_create_inner(
|
||||
|| image.context.inner_id().is_some()
|
||||
{
|
||||
return Err(CreateError::InvalidInput(format!(
|
||||
"Image {} is not unused and in the 'project' context",
|
||||
image_id
|
||||
"Image {image_id} is not unused and in the 'project' context"
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -830,8 +829,7 @@ async fn project_create_inner(
|
||||
image_item::Image::clear_cache(image.id.into(), redis).await?;
|
||||
} else {
|
||||
return Err(CreateError::InvalidInput(format!(
|
||||
"Image {} does not exist",
|
||||
image_id
|
||||
"Image {image_id} does not exist"
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,10 +710,8 @@ pub async fn project_edit(
|
||||
));
|
||||
}
|
||||
|
||||
let ids_to_delete = links
|
||||
.iter()
|
||||
.map(|(name, _)| name.clone())
|
||||
.collect::<Vec<String>>();
|
||||
let ids_to_delete =
|
||||
links.keys().cloned().collect::<Vec<String>>();
|
||||
// Deletes all links from hashmap- either will be deleted or be replaced
|
||||
sqlx::query!(
|
||||
"
|
||||
@@ -1270,10 +1268,7 @@ pub async fn projects_edit(
|
||||
.await?;
|
||||
|
||||
if let Some(links) = &bulk_edit_project.link_urls {
|
||||
let ids_to_delete = links
|
||||
.iter()
|
||||
.map(|(name, _)| name.clone())
|
||||
.collect::<Vec<String>>();
|
||||
let ids_to_delete = links.keys().cloned().collect::<Vec<String>>();
|
||||
// Deletes all links from hashmap- either will be deleted or be replaced
|
||||
sqlx::query!(
|
||||
"
|
||||
@@ -1482,7 +1477,7 @@ pub async fn project_icon_edit(
|
||||
|
||||
let project_id: ProjectId = project_item.inner.id.into();
|
||||
let upload_result = upload_image_optimized(
|
||||
&format!("data/{}", project_id),
|
||||
&format!("data/{project_id}"),
|
||||
bytes.freeze(),
|
||||
&ext.ext,
|
||||
Some(96),
|
||||
@@ -1700,7 +1695,7 @@ pub async fn add_gallery_item(
|
||||
|
||||
let id: ProjectId = project_item.inner.id.into();
|
||||
let upload_result = upload_image_optimized(
|
||||
&format!("data/{}/images", id),
|
||||
&format!("data/{id}/images"),
|
||||
bytes.freeze(),
|
||||
&ext.ext,
|
||||
Some(350),
|
||||
|
||||
@@ -178,8 +178,7 @@ pub async fn report_create(
|
||||
|| image.context.inner_id().is_some()
|
||||
{
|
||||
return Err(ApiError::InvalidInput(format!(
|
||||
"Image {} is not unused and in the 'report' context",
|
||||
image_id
|
||||
"Image {image_id} is not unused and in the 'report' context"
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -198,8 +197,7 @@ pub async fn report_create(
|
||||
image_item::Image::clear_cache(image.id.into(), &redis).await?;
|
||||
} else {
|
||||
return Err(ApiError::InvalidInput(format!(
|
||||
"Image {} could not be found",
|
||||
image_id
|
||||
"Image {image_id} could not be found"
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,8 +527,7 @@ pub async fn thread_send_message(
|
||||
) || image.context.inner_id().is_some()
|
||||
{
|
||||
return Err(ApiError::InvalidInput(format!(
|
||||
"Image {} is not unused and in the 'thread_message' context",
|
||||
image_id
|
||||
"Image {image_id} is not unused and in the 'thread_message' context"
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -548,8 +547,7 @@ pub async fn thread_send_message(
|
||||
.await?;
|
||||
} else {
|
||||
return Err(ApiError::InvalidInput(format!(
|
||||
"Image {} does not exist",
|
||||
image_id
|
||||
"Image {image_id} does not exist"
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ pub async fn user_icon_edit(
|
||||
|
||||
let user_id: UserId = actual_user.id.into();
|
||||
let upload_result = crate::util::img::upload_image_optimized(
|
||||
&format!("data/{}", user_id),
|
||||
&format!("data/{user_id}"),
|
||||
bytes.freeze(),
|
||||
&ext.ext,
|
||||
Some(96),
|
||||
|
||||
@@ -486,8 +486,7 @@ async fn version_create_inner(
|
||||
|| image.context.inner_id().is_some()
|
||||
{
|
||||
return Err(CreateError::InvalidInput(format!(
|
||||
"Image {} is not unused and in the 'version' context",
|
||||
image_id
|
||||
"Image {image_id} is not unused and in the 'version' context"
|
||||
)));
|
||||
}
|
||||
|
||||
@@ -506,8 +505,7 @@ async fn version_create_inner(
|
||||
image_item::Image::clear_cache(image.id.into(), redis).await?;
|
||||
} else {
|
||||
return Err(CreateError::InvalidInput(format!(
|
||||
"Image {} does not exist",
|
||||
image_id
|
||||
"Image {image_id} does not exist"
|
||||
)));
|
||||
}
|
||||
}
|
||||
@@ -810,7 +808,7 @@ pub async fn upload_file(
|
||||
) -> Result<(), CreateError> {
|
||||
let (file_name, file_extension) = get_name_ext(content_disposition)?;
|
||||
|
||||
if other_file_names.contains(&format!("{}.{}", file_name, file_extension)) {
|
||||
if other_file_names.contains(&format!("{file_name}.{file_extension}")) {
|
||||
return Err(CreateError::InvalidInput(
|
||||
"Duplicate files are not allowed to be uploaded to Modrinth!"
|
||||
.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user