protected void SetUp() { PlaylistItemDataMapper = new PlaylistItemDataMapper(); Config = new TestConfiguration(); WebApi = new TestWebApi(Config); Repo = new PlaylistsRepositoryImpl(WebApi, PlaylistItemDataMapper); }
public PlaylistsController(IPlaylistsRepository _repo, IUsersRepository _usersRepo, ISongRepository _songsRepo) { repo = _repo; usersRepo = _usersRepo; songsRepo = _songsRepo; }
public SearchController(ISongRepository _songRepo, IAlbumRepository _albumRepo, IArtistRepository _artistRepo, IUsersRepository _usersRepo, IPlaylistsRepository _playlistRepo, IMapper _mapper) { songRepo = _songRepo; albumRepo = _albumRepo; artistRepo = _artistRepo; usersRepo = _usersRepo; playlistRepo = _playlistRepo; mapper = _mapper; }
public LocalLibraryService( ITracksRepository tracksRepository, ITrackFactory trackFactory, IPlaylistsRepository playlistsRepository, IPlaylistFactory playlistFactory) { this._tracksRepository = tracksRepository ?? throw new ArgumentNullException(nameof(tracksRepository)); this._trackFactory = trackFactory ?? throw new ArgumentNullException(nameof(trackFactory)); this._playlistsRepository = playlistsRepository ?? throw new ArgumentNullException(nameof(playlistsRepository)); this._playlistFactory = playlistFactory ?? throw new ArgumentNullException(nameof(playlistFactory)); this._playlistBaseChangesSubscription = new SerialDisposable().DisposeWith(this._disposables); this._tracksChangesSubscription = new SerialDisposable().DisposeWith(this._disposables); this.TracksChanges = ObservableChangeSet.Create <Track, uint>( async cache => { var items = await this._tracksRepository.GetAllAsync(); cache.AddOrUpdate(items); //return new CompositeDisposable( // //this._tracksRepository.TracksAddeded.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems))), // //this._tracksRepository.TracksRemoved.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.Remove(addedItems))), // //this._tracksRepository.TracksUpdated.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems))) // ); }, x => x.Id) // TODO: add synchronization to handle multiple subscriptions? .RefCount() //.Multicast(new ReplaySubject<IChangeSet<Track, uint>>()) //.AutoConnect(1, subscription => this._tracksChangesSubscription.Disposable = subscription) ; this.PlaylistsChanges = ObservableChangeSet.Create <PlaylistBase, uint>( async cache => { var items = await this._playlistsRepository.GetAllPlaylistsAsync(); cache.AddOrUpdate(items); //return new CompositeDisposable( //// this._playlistsRepository.Addeded.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems))), //// this._playlistsRepository.Removed.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.Remove(addedItems))), //// this._playlistsRepository.Updated.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems))) //); }, x => x.Id) .RefCount() //.Multicast(new ReplaySubject<IChangeSet<PlaylistBase, uint>>()) //.AutoConnect(1, subscription => this._playlistBaseChangesSubscription.Disposable = subscription) ; }
public LocalLibraryService( ITracksRepository tracksRepository, ITrackFactory trackFactory, IPlaylistsRepository playlistsRepository, IPlaylistFactory playlistFactory) { this._tracksRepository = tracksRepository ?? throw new ArgumentNullException(nameof(tracksRepository)); this._trackFactory = trackFactory ?? throw new ArgumentNullException(nameof(trackFactory)); this._playlistsRepository = playlistsRepository ?? throw new ArgumentNullException(nameof(playlistsRepository)); this._playlistFactory = playlistFactory ?? throw new ArgumentNullException(nameof(playlistFactory)); this.TracksChanges = ObservableChangeSet.Create <Track, uint>( async cache => { var items = await this.GetTracksAsync( //TimeSpan.FromSeconds(3) ); GC.Collect(); cache.AddOrUpdate(items); GC.Collect(); //return new CompositeDisposable( // this._tracksRepository.Addeded.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems))), // this._tracksRepository.Removed.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.Remove(addedItems))), // this._tracksRepository.Updated.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems)))); }, x => x.Id) // TODO: add synchronization to handle multiple subscriptions? .RefCount(); this.PlaylistsChanges = ObservableChangeSet.Create <PlaylistBase, uint>( async cache => { var items = await this._playlistsRepository.GetAllPlaylistsAsync(); cache.AddOrUpdate(items); //return new CompositeDisposable( // this._playlistsRepository.Addeded.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems))), // this._playlistsRepository.Removed.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.Remove(addedItems))), // this._playlistsRepository.Updated.Subscribe(addedItems => cache.Edit(cacheUpdater => cacheUpdater.AddOrUpdate(addedItems)))); }, x => x.Id) .RefCount(); }
public DeletePlaylist(IPlaylistsRepository playlistsRepository) { _playlistsRepository = playlistsRepository ?? throw new ArgumentNullException(nameof(playlistsRepository)); }
public GetAllPlaylists(IPlaylistsRepository playlistsRepository) { _playlistsRepository = playlistsRepository; }
public PlaylistsService(IPlaylistsRepository playlistsRepository) { _playlistsRepository = playlistsRepository ?? throw new ArgumentNullException(nameof(playlistsRepository)); }
public GetPlayListsUseCase(ILog log, IPlaylistsRepository playlistsRepo) { Log = log; PlaylistsRepo = playlistsRepo; }