Fix folder bug
This commit is contained in:
parent
341b1d1eb2
commit
de489e8b2c
|
@ -30,6 +30,8 @@ namespace Filtration.ObjectModel.ThemeEditor
|
||||||
_customSoundsAvailable = new ObservableCollection<string>();
|
_customSoundsAvailable = new ObservableCollection<string>();
|
||||||
|
|
||||||
var poeFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + @"\My Games\Path of Exile\";
|
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(
|
var poeFolderFiles = System.IO.Directory.GetFiles(poeFolderPath).Where(
|
||||||
s => s.EndsWith(".mp3")
|
s => s.EndsWith(".mp3")
|
||||||
|| s.EndsWith(".wav")
|
|| s.EndsWith(".wav")
|
||||||
|
@ -45,6 +47,7 @@ namespace Filtration.ObjectModel.ThemeEditor
|
||||||
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
|
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(string.IsNullOrWhiteSpace(Value))
|
if(string.IsNullOrWhiteSpace(Value))
|
||||||
{
|
{
|
||||||
|
|
|
@ -168,8 +168,7 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
_customSoundsAvailable = new ObservableCollection<string>();
|
_customSoundsAvailable = new ObservableCollection<string>();
|
||||||
|
|
||||||
var poeFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + @"\My Games\Path of Exile\";
|
var poeFolderFiles = Directory.GetFiles(persistenceService.DefaultPathOfExileDirectory() + "\\").Where(
|
||||||
var poeFolderFiles = Directory.GetFiles(poeFolderPath).Where(
|
|
||||||
s => s.EndsWith(".mp3")
|
s => s.EndsWith(".mp3")
|
||||||
|| s.EndsWith(".wav")
|
|| s.EndsWith(".wav")
|
||||||
|| s.EndsWith(".wma")
|
|| s.EndsWith(".wma")
|
||||||
|
@ -181,7 +180,7 @@ namespace Filtration.ViewModels
|
||||||
|
|
||||||
foreach(var file in poeFolderFiles)
|
foreach(var file in poeFolderFiles)
|
||||||
{
|
{
|
||||||
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
|
_customSoundsAvailable.Add(file.Replace(persistenceService.DefaultPathOfExileDirectory() + "\\", ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue