public GetAllSongsResponse GetAllSongs() { var currentRequests = _getCurrentRequestsQuery.GetCurrentRequests(); var regularRequests = currentRequests.RegularRequests.ToArray(); var vipRequests = currentRequests.VipRequests.ToArray(); // Ensure if the playlist is populated then a request is made current if (_currentRequest == null) { if (currentRequests.VipRequests.Any()) { _currentRequest = currentRequests.VipRequests.First(); vipRequests = vipRequests.Where(r => r.songRequestId != _currentRequest.songRequestId).ToArray(); } else if (currentRequests.RegularRequests.Any()) { _currentRequest = regularRequests[_rand.Next(0, currentRequests.RegularRequests.Count)]; regularRequests = regularRequests.Where(r => r.songRequestId != _currentRequest.songRequestId).ToArray(); } } return(new GetAllSongsResponse { CurrentSong = _currentRequest, RegularList = regularRequests, VipList = vipRequests }); }
public List <PlaylistItem> Get() { var currentRequests = _getCurrentRequestsQuery.GetCurrentRequests(); return(currentRequests.VipRequests.Take(10).ToList()); }