Webserver: GetAllSongs() uses now a cache

This commit is contained in:
lukeIam committed 2015-12-20 17:42:30 +01:00
1 parent 16f4d790de
commit 871a7227fc
1 file changed
+9 -2
+9 -2
View File
@@ -624,11 +624,18 @@ namespace Vocaluxe.Base.Server
return _GetSongInfo(song, true);
}
private static SSongInfo[] songInfoCache = null;
public static SSongInfo[] GetAllSongs()
{
List<CSong> songs = CSongs.Songs;
return (from s in songs
if (songInfoCache == null)
{
List<CSong> songs = CSongs.Songs;
songInfoCache = (from s in songs
select _GetSongInfo(s, false)).AsParallel().ToArray<SSongInfo>();
}
return songInfoCache;
}
public static string GetMp3Path(int songId)