Fix folder bug

This commit is contained in:
azakhi 2018-08-31 16:54:24 +03:00
parent 341b1d1eb2
commit de489e8b2c
2 changed files with 18 additions and 16 deletions

View File

@ -30,6 +30,8 @@ namespace Filtration.ObjectModel.ThemeEditor
_customSoundsAvailable = new ObservableCollection<string>();
var poeFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + @"\My Games\Path of Exile\";
if(System.IO.Directory.Exists(poeFolderPath))
{
var poeFolderFiles = System.IO.Directory.GetFiles(poeFolderPath).Where(
s => s.EndsWith(".mp3")
|| s.EndsWith(".wav")
@ -45,6 +47,7 @@ namespace Filtration.ObjectModel.ThemeEditor
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
}
}
}
if(string.IsNullOrWhiteSpace(Value))
{

View File

@ -168,8 +168,7 @@ namespace Filtration.ViewModels
_customSoundsAvailable = new ObservableCollection<string>();
var poeFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + @"\My Games\Path of Exile\";
var poeFolderFiles = Directory.GetFiles(poeFolderPath).Where(
var poeFolderFiles = Directory.GetFiles(persistenceService.DefaultPathOfExileDirectory() + "\\").Where(
s => s.EndsWith(".mp3")
|| s.EndsWith(".wav")
|| s.EndsWith(".wma")
@ -181,7 +180,7 @@ namespace Filtration.ViewModels
foreach(var file in poeFolderFiles)
{
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
_customSoundsAvailable.Add(file.Replace(persistenceService.DefaultPathOfExileDirectory() + "\\", ""));
}
}