public async Task <NowPlaying> PlayNextAsync() { if (_context.Player.Video != null) { await _historyRepository.AddAsync(_context.Player.Video, _context).ConfigureAwait(false); _context.Player.Video = null; _context.Player.IsPlaying = false; await _context.SaveChangesAsync().ConfigureAwait(false); } var first = await _currentPlaylistRepository.GetFirstAsync().ConfigureAwait(false); if (first == null) { return(_context.Player); } var nowPlaying = await PlayNowPrivateAsync(first.Video, false).ConfigureAwait(false); await _currentPlaylistRepository.RemoveAsync(first.Id, _context).ConfigureAwait(false); await _context.SaveChangesAsync().ConfigureAwait(false); return(nowPlaying); }
public Task RemoveAsync(int id) { return(_currentPlaylistRepository.RemoveAsync(id)); }