Webserver: GetAllSongs() uses now a cache
This commit is contained in:
1 parent
16f4d790de
commit
871a7227fc
1 file changed
+8
-1
@@ -624,13 +624,20 @@ namespace Vocaluxe.Base.Server
|
|||||||
return _GetSongInfo(song, true);
|
return _GetSongInfo(song, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static SSongInfo[] songInfoCache = null;
|
||||||
public static SSongInfo[] GetAllSongs()
|
public static SSongInfo[] GetAllSongs()
|
||||||
|
{
|
||||||
|
if (songInfoCache == null)
|
||||||
{
|
{
|
||||||
List<CSong> songs = CSongs.Songs;
|
List<CSong> songs = CSongs.Songs;
|
||||||
return (from s in songs
|
songInfoCache = (from s in songs
|
||||||
select _GetSongInfo(s, false)).AsParallel().ToArray<SSongInfo>();
|
select _GetSongInfo(s, false)).AsParallel().ToArray<SSongInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return songInfoCache;
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetMp3Path(int songId)
|
public static string GetMp3Path(int songId)
|
||||||
{
|
{
|
||||||
CSong song = CSongs.GetSong(songId);
|
CSong song = CSongs.GetSong(songId);
|
||||||
|
|||||||
Reference in new issue
Block a user