public TrackWithFeelings NextTrack() { if (HasNextTrack()) { TrackWithFeelings trackToReturn = _tracks.First(); _tracks.RemoveAt(0); return(trackToReturn); } return(null); }
public async Task UserLikesTrackAsync(PartyGoer user, string trackUri, string partyCode) { if (!_usersLikesDislikes.DoesUserLikeTrack(user, trackUri)) { _usersLikesDislikes.UserLikesTrack(user, trackUri); TrackWithFeelings track = _tracks.Find(p => p.GetTrackWithoutFeelings().Id.Equals(trackUri, StringComparison.OrdinalIgnoreCase)); if (track != null) { track.UserLikesTrack(); _tracks.Sort(new ReorderQueueComparer()); await DomainEvents.RaiseAsync(new UpdateQueue { Tracks = _tracks.Select(p => p.GetTrackWithoutFeelings()).ToList(), PartyCode = partyCode }); } } }