From f43116073d5f58b2e45ce8ecca386ecafb31e1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sat, 2 Aug 2014 11:16:35 +0200 Subject: [PATCH] Loads faster if song-folder doesn't exist. --- Vocaluxe/Base/CSongs.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index 36d0d6f2..2bf74681 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading; +using System.IO; using VocaluxeLib; using VocaluxeLib.Songs; @@ -340,9 +341,12 @@ namespace Vocaluxe.Base var files = new List(); foreach (string p in CConfig.SongFolders) { - string path = p; - files.AddRange(CHelper.ListFiles(path, "*.txt", true, true)); - files.AddRange(CHelper.ListFiles(path, "*.txd", true, true)); + if (Directory.Exists(p)) + { + string path = p; + files.AddRange(CHelper.ListFiles(path, "*.txt", true, true)); + files.AddRange(CHelper.ListFiles(path, "*.txd", true, true)); + } } CLog.StopBenchmark("List Songs");