Compare commits

...
Author SHA1 Message Date
François-X. T. 5d1ddeda24 Fmt 2026-05-09 17:09:10 -04:00
ProspectorandGitHub a0228dc2b1 Merge branch 'main' into patch-1 2026-05-09 14:01:54 -07:00
Corsican FrogandGitHub 3c6fadf5e8 Merge branch 'main' into patch-1 2026-05-07 15:54:36 +02:00
Corsican FrogandGitHub 8af43e59b9 Merge branch 'main' into patch-1 2026-05-07 11:24:07 +02:00
Corsican FrogandGitHub 418e4f281d Merge branch 'main' into patch-1 2026-05-06 18:46:07 +02:00
Corsican FrogandGitHub abc6cf59d8 Whitelist scannable instance content files
Only scan supported content archives into instance content.

Accept .jar files for mods and .zip files for datapacks, resourcepacks, and shaderpacks, after trimming the .disabled suffix. 

This prevents .DS_Store and other unsupported files from appearing in the Content tab.

Signed-off-by: Corsican Frog <49497194+acorsicanfrog@users.noreply.github.com>
2026-05-05 20:56:54 +02:00
Corsican FrogandGitHub 849fe4e1ba Hide dotfiles from instance content scanning
Prevent hidden files such as .DS_Store from being treated as valid instance content.

This updates the profile scanning logic in [packages/app-lib/src/state/profiles.rs](/Users/froggy/Downloads/code-main/packages/app-lib/src/state/profiles.rs#L420) to ignore basenames that start with '.', and applies that filter consistently in both scan paths.

Signed-off-by: Corsican Frog <49497194+acorsicanfrog@users.noreply.github.com>
2026-05-05 13:35:01 +02:00
+24 -4
View File
@@ -417,6 +417,25 @@ struct InitialScanFile {
cache_key: String,
}
fn is_scannable_project_file(
project_type: ProjectType,
file_name: &str,
) -> bool {
let Some(extension) = Path::new(file_name.trim_end_matches(".disabled"))
.extension()
.and_then(|ext| ext.to_str())
else {
return false;
};
match project_type {
ProjectType::Mod => extension.eq_ignore_ascii_case("jar"),
ProjectType::DataPack
| ProjectType::ResourcePack
| ProjectType::ShaderPack => extension.eq_ignore_ascii_case("zip"),
}
}
impl Profile {
pub async fn get(
path: &str,
@@ -648,8 +667,10 @@ impl Profile {
&& let Some(file_name) = subdirectory
.file_name()
.and_then(|x| x.to_str())
&& !(project_type == ProjectType::ShaderPack
&& file_name.ends_with(".txt"))
&& is_scannable_project_file(
project_type,
file_name,
)
{
let file_size = subdirectory
.metadata()
@@ -1052,8 +1073,7 @@ impl Profile {
if subdirectory.is_file()
&& let Some(file_name) =
subdirectory.file_name().and_then(|x| x.to_str())
&& !(project_type == ProjectType::ShaderPack
&& file_name.ends_with(".txt"))
&& is_scannable_project_file(project_type, file_name)
{
let file_size = subdirectory
.metadata()