Fix folder bug
This commit is contained in:
parent
341b1d1eb2
commit
de489e8b2c
|
@ -30,19 +30,22 @@ 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\";
|
||||||
var poeFolderFiles = System.IO.Directory.GetFiles(poeFolderPath).Where(
|
if(System.IO.Directory.Exists(poeFolderPath))
|
||||||
s => s.EndsWith(".mp3")
|
|
||||||
|| s.EndsWith(".wav")
|
|
||||||
|| s.EndsWith(".wma")
|
|
||||||
|| s.EndsWith(".3gp")
|
|
||||||
|| s.EndsWith(".aag")
|
|
||||||
|| s.EndsWith(".m4a")
|
|
||||||
|| s.EndsWith(".ogg")
|
|
||||||
).OrderBy(f => f);
|
|
||||||
|
|
||||||
foreach (var file in poeFolderFiles)
|
|
||||||
{
|
{
|
||||||
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
|
var poeFolderFiles = System.IO.Directory.GetFiles(poeFolderPath).Where(
|
||||||
|
s => s.EndsWith(".mp3")
|
||||||
|
|| s.EndsWith(".wav")
|
||||||
|
|| s.EndsWith(".wma")
|
||||||
|
|| s.EndsWith(".3gp")
|
||||||
|
|| s.EndsWith(".aag")
|
||||||
|
|| s.EndsWith(".m4a")
|
||||||
|
|| s.EndsWith(".ogg")
|
||||||
|
).OrderBy(f => f);
|
||||||
|
|
||||||
|
foreach (var file in poeFolderFiles)
|
||||||
|
{
|
||||||
|
_customSoundsAvailable.Add(file.Replace(poeFolderPath, ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,9 +167,8 @@ namespace Filtration.ViewModels
|
||||||
_viewItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
|
_viewItemFilterBlockViewModels = new ObservableCollection<IItemFilterBlockViewModelBase>();
|
||||||
|
|
||||||
_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