Loads faster if song-folder doesn't exist.

This commit is contained in:
Florian Küpper committed 2014-08-02 11:16:35 +02:00
1 parent fcdd58f827
commit f43116073d
1 file changed
+4
+4
View File
@@ -20,6 +20,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.IO;
using VocaluxeLib; using VocaluxeLib;
using VocaluxeLib.Songs; using VocaluxeLib.Songs;
@@ -339,11 +340,14 @@ namespace Vocaluxe.Base
CLog.StartBenchmark("List Songs"); CLog.StartBenchmark("List Songs");
var files = new List<string>(); var files = new List<string>();
foreach (string p in CConfig.SongFolders) foreach (string p in CConfig.SongFolders)
{
if (Directory.Exists(p))
{ {
string path = p; string path = p;
files.AddRange(CHelper.ListFiles(path, "*.txt", true, true)); files.AddRange(CHelper.ListFiles(path, "*.txt", true, true));
files.AddRange(CHelper.ListFiles(path, "*.txd", true, true)); files.AddRange(CHelper.ListFiles(path, "*.txd", true, true));
} }
}
CLog.StopBenchmark("List Songs"); CLog.StopBenchmark("List Songs");
CLog.StartBenchmark("Read TXTs"); CLog.StartBenchmark("Read TXTs");