skip .sync and .softlan_game_installed
This commit is contained in:
@@ -2578,8 +2578,28 @@ async fn get_game_file_descriptions(
|
|||||||
|
|
||||||
for entry in walkdir::WalkDir::new(&game_path)
|
for entry in walkdir::WalkDir::new(&game_path)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
// Skip the local install folder; it's not meant to sync.
|
.filter_entry(|entry| {
|
||||||
.filter_entry(|entry| !entry.path().starts_with(&local_dir))
|
let path = entry.path();
|
||||||
|
|
||||||
|
// Skip the local install folder; it's not meant to sync.
|
||||||
|
if path.starts_with(&local_dir) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Root-level exclusions only.
|
||||||
|
if entry.depth() == 1
|
||||||
|
&& let Some(name) = path.file_name().and_then(|n| n.to_str())
|
||||||
|
{
|
||||||
|
if entry.file_type().is_dir() && name == ".sync" {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if entry.file_type().is_file() && name == ".softlan_game_installed" {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
true
|
||||||
|
})
|
||||||
.filter_map(std::result::Result::ok)
|
.filter_map(std::result::Result::ok)
|
||||||
{
|
{
|
||||||
let relative_path = match entry.path().strip_prefix(&base_dir) {
|
let relative_path = match entry.path().strip_prefix(&base_dir) {
|
||||||
|
|||||||
Reference in New Issue
Block a user