mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:37:22 +01:00
check if directory has subdirectories when setting storage location
This commit is contained in:
parent
47a876e70d
commit
cfb8cdaa79
1 changed files with 3 additions and 2 deletions
|
|
@ -571,7 +571,8 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
||||||
_isOneDrive = path.Contains("onedrive", StringComparison.OrdinalIgnoreCase);
|
_isOneDrive = path.Contains("onedrive", StringComparison.OrdinalIgnoreCase);
|
||||||
_isPenumbraDirectory = string.Equals(path.ToLowerInvariant(), _ipcManager.PenumbraModDirectory?.ToLowerInvariant(), StringComparison.Ordinal);
|
_isPenumbraDirectory = string.Equals(path.ToLowerInvariant(), _ipcManager.PenumbraModDirectory?.ToLowerInvariant(), StringComparison.Ordinal);
|
||||||
_isDirectoryWritable = IsDirectoryWritable(path);
|
_isDirectoryWritable = IsDirectoryWritable(path);
|
||||||
_cacheDirectoryHasOtherFilesThanCache = Directory.GetFiles(path, "*", SearchOption.AllDirectories).Any(f => Path.GetFileNameWithoutExtension(f).Length != 40);
|
_cacheDirectoryHasOtherFilesThanCache = Directory.GetFiles(path, "*", SearchOption.AllDirectories).Any(f => Path.GetFileNameWithoutExtension(f).Length != 40)
|
||||||
|
|| Directory.GetDirectories(path).Any();
|
||||||
_cacheDirectoryIsValidPath = PathRegex().IsMatch(path);
|
_cacheDirectoryIsValidPath = PathRegex().IsMatch(path);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(path)
|
if (!string.IsNullOrEmpty(path)
|
||||||
|
|
@ -609,7 +610,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
||||||
}
|
}
|
||||||
else if (_cacheDirectoryHasOtherFilesThanCache)
|
else if (_cacheDirectoryHasOtherFilesThanCache)
|
||||||
{
|
{
|
||||||
ColorTextWrapped("Your selected directory has files inside that are not Mare related. Use an empty directory or a previous Mare storage directory only.", ImGuiColors.DalamudRed);
|
ColorTextWrapped("Your selected directory has files or directories inside that are not Mare related. Use an empty directory or a previous Mare storage directory only.", ImGuiColors.DalamudRed);
|
||||||
}
|
}
|
||||||
else if (!_cacheDirectoryIsValidPath)
|
else if (!_cacheDirectoryIsValidPath)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue