Webserver: GetAllSongs() uses now a cache
This commit is contained in:
1 parent
16f4d790de
commit
871a7227fc
1 file changed
+9
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user