public EpisodeViewModel(ITvShowViewModelFactory viewModelFactory, IEpisodeMetadataService metadataService, ITvShowViewModel tvShowViewModel, IProgressManagerViewModel progressManager, IBusyProvider busyProvider, IDialogViewer dialogViewer, IKeyDataStore keyDataStore, string path) : base(busyProvider, dialogViewer) { _metadataService = metadataService; _tvShowViewModel = tvShowViewModel; _busyProvider = busyProvider; Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path + "?title")); Title.PropertyChanged += CachedPropertyChanged; SeasonNumber = new RequiredPropertyDecorator <int?>(new IntCachedPropertyDecorator(keyDataStore, path + "?seasonNumber")); SeasonNumber.PropertyChanged += CachedPropertyChanged; EpisodeNumber = new RequiredPropertyDecorator <int?>(new IntCachedPropertyDecorator(keyDataStore, path + "?episodeNumber")); EpisodeNumber.PropertyChanged += CachedPropertyChanged; Path = path; Credits = new DashDelimitedCollectionViewModel <string>(s => s); Directors = new DashDelimitedCollectionViewModel <string>(s => s); ImagePath = viewModelFactory.GetImage(true); RefreshCommand = new RefreshMetadataCommand(this); UpdateCommand = new UpdateMetadataCommand(this, progressManager, busyProvider); SaveCommand = new SaveMetadataCommand(this); DeleteCommand = new DeleteMetadataCommand(this); }
public TvShowSelectionViewModel(ITvShowMetadataService metadataService, ITvShowViewModel tvShowMetadata, IBusyProvider busyProvider) : base(busyProvider, tvShowMetadata.Title.OriginalValue) { _metadataService = metadataService; _tvShowMetadata = tvShowMetadata; }
private void AddTvShows(IEnumerable <string> tvShows) { foreach (string path in tvShows) { ITvShowViewModel newTvShow = _viewModelFactory.GetTvShow(path); TvShows.Add(newTvShow); } }
private void RemoveTvShows(IEnumerable <string> tvShows) { foreach (string path in tvShows) { ITvShowViewModel tvShowToRemove = TvShows.First(show => show.Path == path); TvShows.Remove(tvShowToRemove); } }
public SeasonViewModelTests() { _viewModelFactory = Substitute.For <ITvShowViewModelFactory>(); _tvShowFileService = Substitute.For <ITvShowFileService>(); _tvShowMetadata = Substitute.For <ITvShowViewModel>(); _busyProvider = _busyProvider = Substitute.For <IBusyProvider>(); _path = @"C:\Folder\TV Shows\Game of Thrones\Season 1"; _viewModel = new SeasonViewModel(_viewModelFactory, _tvShowFileService, _tvShowMetadata, null, _busyProvider, _path); }
public SeasonViewModelTests() { _viewModelFactory = Substitute.For<ITvShowViewModelFactory>(); _tvShowFileService = Substitute.For<ITvShowFileService>(); _tvShowMetadata = Substitute.For<ITvShowViewModel>(); _busyProvider = _busyProvider = Substitute.For<IBusyProvider>(); _path = @"C:\Folder\TV Shows\Game of Thrones\Season 1"; _viewModel = new SeasonViewModel(_viewModelFactory, _tvShowFileService, _tvShowMetadata, null, _busyProvider, _path); }
public EpisodeViewModelTests() { _metadataService = Substitute.For<IEpisodeMetadataService>(); _tvShowMetadata = Substitute.For<ITvShowViewModel>(); ITvShowViewModelFactory viewModelFactory = Substitute.For<ITvShowViewModelFactory>(); _busyProvider = _busyProvider = Substitute.For<IBusyProvider>(); var keyDataStore = Substitute.For<IKeyDataStore>(); _path = @"C:\Folder\TV Shows\Game of Thrones\Season 2\3x09.mkv"; _viewModel = new EpisodeViewModel(viewModelFactory, _metadataService, _tvShowMetadata, null, _busyProvider, null, keyDataStore, _path); }
public EpisodeViewModelTests() { _metadataService = Substitute.For <IEpisodeMetadataService>(); _tvShowMetadata = Substitute.For <ITvShowViewModel>(); ITvShowViewModelFactory viewModelFactory = Substitute.For <ITvShowViewModelFactory>(); _busyProvider = _busyProvider = Substitute.For <IBusyProvider>(); var keyDataStore = Substitute.For <IKeyDataStore>(); _path = @"C:\Folder\TV Shows\Game of Thrones\Season 2\3x09.mkv"; _viewModel = new EpisodeViewModel(viewModelFactory, _metadataService, _tvShowMetadata, null, _busyProvider, null, keyDataStore, _path); }
public SeasonViewModel(ITvShowViewModelFactory viewModelFactory, ITvShowFileService tvShowFileService, ITvShowViewModel tvShowMetadata, ITvShowMetadataService metadataService, IBusyProvider busyProvider, string path) : base(busyProvider, viewModelFactory.GetEpisode(tvShowMetadata, "dummy")) { _viewModelFactory = viewModelFactory; _tvShowFileService = tvShowFileService; _tvShowMetadata = tvShowMetadata; _busyProvider = busyProvider; _path = path; _posterUrl = viewModelFactory.GetImage(true, new SeasonPosterImageStrategy(metadataService, tvShowMetadata.Path, path)); _bannerUrl = viewModelFactory.GetImage(false, new SeasonBannerImageStrategy(metadataService, tvShowMetadata.Path, path)); }
public TvShowImagesViewModel(ITvShowFileService tvShowFileService, ITvShowMetadataService metadataService, ITvShowViewModelFactory viewModelFactory, ITvShowViewModel metadataViewModel, IBusyProvider busyProvider, string path) { _tvShowFileService = tvShowFileService; _viewModelFactory = viewModelFactory; _busyProvider = busyProvider; _path = path; SeasonImages = new ObservableCollection<ISeasonImagesViewModel>(); FanartUrl = viewModelFactory.GetImage(true, new FanartImageStrategy(metadataService, metadataViewModel)); PosterUrl = viewModelFactory.GetImage(true, new PosterImageStrategy(metadataService, metadataViewModel)); BannerUrl = viewModelFactory.GetImage(false, new BannerImageStrategy(metadataService, metadataViewModel)); }
public TvShowImagesViewModel(ITvShowFileService tvShowFileService, ITvShowMetadataService metadataService, ITvShowViewModelFactory viewModelFactory, ITvShowViewModel metadataViewModel, IBusyProvider busyProvider, string path) { _tvShowFileService = tvShowFileService; _viewModelFactory = viewModelFactory; _busyProvider = busyProvider; _path = path; SeasonImages = new ObservableCollection <ISeasonImagesViewModel>(); FanartUrl = viewModelFactory.GetImage(true, new FanartImageStrategy(metadataService, metadataViewModel)); PosterUrl = viewModelFactory.GetImage(true, new PosterImageStrategy(metadataService, metadataViewModel)); BannerUrl = viewModelFactory.GetImage(false, new BannerImageStrategy(metadataService, metadataViewModel)); }
public void Sources_RemovesSpecificFolder_RemovesTvShow() { // Arrange const string folder = @"C:\Folder\TV Shows\Game of Thrones"; ITvShowViewModel tvShowViewModel = Substitute.For <ITvShowViewModel>(); tvShowViewModel.Path.Returns(folder); _viewModelFactory.GetTvShow(folder) .Returns(tvShowViewModel); _sourceManagerViewModel.SpecificFolders.Add(folder); // Act _sourceManagerViewModel.SpecificFolders.Remove(folder); // Assert Assert.Empty(_viewModel.TvShows); }
public void Execute_WithTvShows_UpdatesTheseTvShows() { // Arrange ITvShowViewModel viewModel1 = Substitute.For <ITvShowViewModel>(); _tvShows.Add(viewModel1); IEnumerable <ProgressItem> items = new List <ProgressItem> { CreateProgressItem() }; viewModel1.FindNewEpisodes() .Returns(items.ToTask()); // Act _command.Execute(null); // Assert _progressManager.Received() .AddItem(Arg.Any <ProgressItem>()); _progressManager.Received() .Start().Async(); }
public ISeasonViewModel GetSeason(ITvShowViewModel tvShowMetadata, string path) { return(new SeasonViewModel(this, _tvShowFileService, tvShowMetadata, _tvShowMetadataService, _busyProvider, path)); }
public ITvShowImagesViewModel GetTvShowImages(ITvShowViewModel metadataViewModel, string path) { return new TvShowImagesViewModel(_tvShowFileService, _tvShowMetadataService, this, metadataViewModel, _busyProvider, path); }
public BannerImageStrategy(ITvShowMetadataService metadataService, ITvShowViewModel metadataViewModel) { _metadataService = metadataService; _metadataViewModel = metadataViewModel; }
public FanartImageStrategy(ITvShowMetadataService metadataService, ITvShowViewModel metadataViewModel) { _metadataService = metadataService; _metadataViewModel = metadataViewModel; }
public ISeasonViewModel GetSeason(ITvShowViewModel tvShowMetadata, string path) { return new SeasonViewModel(this, _tvShowFileService, tvShowMetadata, _tvShowMetadataService, _busyProvider, path); }
public ITvShowSelectionViewModel GetTvShowSelection(ITvShowViewModel tvShowMetadata) { return(new TvShowSelectionViewModel(_tvShowMetadataService, tvShowMetadata, _busyProvider)); }
public IEpisodeViewModel GetEpisode(ITvShowViewModel tvShowMetadata, string path) { return(new EpisodeViewModel(this, _episodeMetadataService, tvShowMetadata, _progressManagerViewModel, _busyProvider, _dialogViewer, _keyDataStore, path)); }
public IEpisodeViewModel GetEpisode(ITvShowViewModel tvShowMetadata, string path) { return new EpisodeViewModel(this, _episodeMetadataService, tvShowMetadata, _progressManagerViewModel, _busyProvider, _dialogViewer, _keyDataStore, path); }
public ITvShowImagesViewModel GetTvShowImages(ITvShowViewModel metadataViewModel, string path) { return(new TvShowImagesViewModel(_tvShowFileService, _tvShowMetadataService, this, metadataViewModel, _busyProvider, path)); }
public ITvShowSelectionViewModel GetTvShowSelection(ITvShowViewModel tvShowMetadata) { return new TvShowSelectionViewModel(_tvShowMetadataService, tvShowMetadata, _busyProvider); }