public UpdateAllMetadataCommandTests()
 {
     _movies = new ObservableCollection<IMovieViewModel>();
     _progressManager = Substitute.For<IProgressManagerViewModel>();
     _busyProvider = Substitute.For<IBusyProvider>();
     _command = new UpdateAllMetadataCommand<IMovieViewModel>(_movies, _progressManager, _busyProvider);
 }
 public FindNewEpisodesCommand(ObservableCollection <ITvShowViewModel> tvShows, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
 {
     _tvShows = tvShows;
     _tvShows.CollectionChanged += TvShowsCollectionChanged;
     _progressManager            = progressManager;
     _busyProvider = busyProvider;
 }
 public UpdateMetadataCommandTests()
 {
     _metadataProvider = Substitute.For<IMetadataProvider>();
     _progressManager = Substitute.For<IProgressManagerViewModel>();
     _busyProvider = Substitute.For<IBusyProvider>();
     _command = new UpdateMetadataCommand(_metadataProvider, _progressManager, _busyProvider);
 }
示例#4
0
        public AlbumViewModel(IMusicFileService musicFileService,
                              IAlbumMetadataService metadataService,
                              IMusicImageUpdater imageUpdater,
                              IMusicViewModelFactory viewModelFactory,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IProgressManagerViewModel progressManager,
                              IKeyDataStore keyDataStore,
                              IArtistViewModel artistViewModel,
                              string path)
            : base(busyProvider, dialogViewer, viewModelFactory.GetTrack("dummy"))
        {
            _musicFileService = musicFileService;
            _metadataService  = metadataService;
            _viewModelFactory = viewModelFactory;
            _busyProvider     = busyProvider;
            _artistViewModel  = artistViewModel;
            Title             = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Path      = path;
            CoverArt  = viewModelFactory.GetImage(true, new AlbumCoverArtImageStrategy(imageUpdater, this));
            Selection = viewModelFactory.GetAlbumSelection(this);

            Genres = new DashDelimitedCollectionViewModel <string>(s => s);
            Moods  = new DashDelimitedCollectionViewModel <string>(s => s);
            Styles = new DashDelimitedCollectionViewModel <string>(s => s);
            Themes = new DashDelimitedCollectionViewModel <string>(s => s);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
        public ArtistViewModel(IArtistMetadataService metadataService,
                               IMusicViewModelFactory viewModelFactory,
                               IMusicFileService musicFileService,
                               IMusicImageUpdater imageUpdater,
                               IProgressManagerViewModel progressManager,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IKeyDataStore keyDataStore,
                               string path)
            : base(busyProvider, dialogViewer, viewModelFactory.GetAlbum("dummy", null))
        {
            _metadataService  = metadataService;
            _viewModelFactory = viewModelFactory;
            _musicFileService = musicFileService;
            _busyProvider     = busyProvider;
            Name      = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Path      = path;
            Fanart    = viewModelFactory.GetImage(true, new ArtistFanartImageStrategy(imageUpdater, this));
            Selection = viewModelFactory.GetArtistSelection(this);

            Genres      = new DashDelimitedCollectionViewModel <string>(s => s);
            Moods       = new DashDelimitedCollectionViewModel <string>(s => s);
            Styles      = new DashDelimitedCollectionViewModel <string>(s => s);
            YearsActive = new DashDelimitedCollectionViewModel <int>(int.Parse);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
        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 TvShowViewModel(ITvShowViewModelFactory viewModelFactory,
                               ITvShowFileService tvShowFileService,
                               ITvShowMetadataService metadataService,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IProgressManagerViewModel progressManager,
                               IKeyDataStore keyDataStore,
                               string path)
            : base(busyProvider, dialogViewer)
        {
            _viewModelFactory  = viewModelFactory;
            _tvShowFileService = tvShowFileService;
            _metadataService   = metadataService;
            _busyProvider      = busyProvider;
            Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Title.PropertyChanged += TitleValueChanged;
            Path      = path;
            Selection = viewModelFactory.GetTvShowSelection(this);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);

            Images       = viewModelFactory.GetTvShowImages(this, path);
            ActorManager = viewModelFactory.GetActorManager(path, () => OnPropertyChanged("ActorManager"));
            Genres       = new DashDelimitedCollectionViewModel <string>(s => s);

            // We need to set a "dummy" item in the collection for an arrow to appear in the TreeView since we're lazy-loading the items under it
            Children.Add(_viewModelFactory.GetSeason(this, "dummy"));
        }
 public UpdateMetadataCommandTests()
 {
     _metadataProvider = Substitute.For <IMetadataProvider>();
     _progressManager  = Substitute.For <IProgressManagerViewModel>();
     _busyProvider     = Substitute.For <IBusyProvider>();
     _command          = new UpdateMetadataCommand(_metadataProvider, _progressManager, _busyProvider);
 }
 public FindNewEpisodesCommand(ObservableCollection<ITvShowViewModel> tvShows, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
 {
     _tvShows = tvShows;
     _tvShows.CollectionChanged += TvShowsCollectionChanged;
     _progressManager = progressManager;
     _busyProvider = busyProvider;
 }
        public MovieSetViewModel(IFileSystemService fileSystemService,
                                 IMovieViewModelFactory viewModelFactory,
                                 IMovieMetadataService metadataService,
                                 IProgressManagerViewModel progressManager,
                                 IBusyProvider busyProvider,
                                 IDialogViewer dialogViewer,
                                 string setName)
            : base(busyProvider, dialogViewer, null)
        {
            _fileSystemService = fileSystemService;
            _metadataService   = metadataService;
            _busyProvider      = busyProvider;
            SetName            = DisplayNameInternal = setName;
            Fanart             = viewModelFactory.GetImage(new SetFanartImageStrategy(metadataService, this));
            Poster             = viewModelFactory.GetImage(new SetPosterImageStrategy(metadataService, this));

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);

#pragma warning disable 4014
            // Fire and forget the refresh
            AsyncHelper.ExecuteEventHandlerTask(this, Refresh);
#pragma warning restore 4014
        }
示例#11
0
 public FindNewEpisodesCommandTests()
 {
     _tvShows         = new ObservableCollection <ITvShowViewModel>();
     _progressManager = Substitute.For <IProgressManagerViewModel>();
     _busyProvider    = Substitute.For <IBusyProvider>();
     _command         = new FindNewEpisodesCommand(_tvShows, _progressManager, _busyProvider);
 }
示例#12
0
        public MovieViewModel(IMovieMetadataService metadataService,
                              IMovieViewModelFactory viewModelFactory,
                              IFileSystemService fileSystemService,
                              IProgressManagerViewModel progressManager,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IKeyDataStore keyDataStore,
                              string path)
            : base(busyProvider, dialogViewer)
        {
            _metadataService   = metadataService;
            _viewModelFactory  = viewModelFactory;
            _fileSystemService = fileSystemService;
            _busyProvider      = busyProvider;
            RefreshCommand     = new RefreshMetadataCommand(this);
            UpdateCommand      = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand        = new SaveMetadataCommand(this);
            DeleteCommand      = new DeleteMetadataCommand(this);

            Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path + "?title"));
            Title.PropertyChanged += TitlePropertyChanged;
            SetName = new StringCachedPropertyDecorator(keyDataStore, path + "?setName");
            SetName.PropertyChanged += TitlePropertyChanged;
            Path         = path;
            Selection    = viewModelFactory.GetSelection(this);
            Poster       = viewModelFactory.GetImage(new PosterImageStrategy(metadataService, this));
            Fanart       = viewModelFactory.GetImage(new FanartImageStrategy(metadataService, this));
            Credits      = new DashDelimitedCollectionViewModel <string>(s => s);
            Directors    = new DashDelimitedCollectionViewModel <string>(s => s);
            Genres       = new DashDelimitedCollectionViewModel <string>(s => s);
            ActorManager = viewModelFactory.GetActorManager(path, () => OnPropertyChanged("ActorManager"));
        }
示例#13
0
 public UpdateAllMetadataCommandTests()
 {
     _movies          = new ObservableCollection <IMovieViewModel>();
     _progressManager = Substitute.For <IProgressManagerViewModel>();
     _busyProvider    = Substitute.For <IBusyProvider>();
     _command         = new UpdateAllMetadataCommand <IMovieViewModel>(_movies, _progressManager, _busyProvider);
 }
 public FindNewEpisodesCommandTests()
 {
     _tvShows = new ObservableCollection<ITvShowViewModel>();
     _progressManager = Substitute.For<IProgressManagerViewModel>();
     _busyProvider = Substitute.For<IBusyProvider>();
     _command = new FindNewEpisodesCommand(_tvShows, _progressManager, _busyProvider);
 }
 public UpdateAllMetadataCommand(ObservableCollection <T> items, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
 {
     _items = items;
     _items.CollectionChanged += TvShowsCollectionChanged;
     _progressManager          = progressManager;
     _busyProvider             = busyProvider;
 }
        public TvShowManagerViewModel(ITvShowViewModelFactory viewModelFactory, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
        {
            _viewModelFactory = viewModelFactory;
            _busyProvider = busyProvider;
            TvShows = new ObservableCollection<ITvShowViewModel>();

            UpdateAll = new UpdateAllMetadataCommand<ITvShowViewModel>(TvShows, progressManager, busyProvider);
            FindNewEpisodes = new FindNewEpisodesCommand(TvShows, progressManager, busyProvider);

            Sources = viewModelFactory.GetSourceManager(SourceType.TvShow);
            Sources.SpecificFolders.CollectionChanged += SourceFoldersCollectionChanged;
        }
示例#17
0
        public TvShowManagerViewModel(ITvShowViewModelFactory viewModelFactory, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
        {
            _viewModelFactory = viewModelFactory;
            _busyProvider     = busyProvider;
            TvShows           = new ObservableCollection <ITvShowViewModel>();

            UpdateAll       = new UpdateAllMetadataCommand <ITvShowViewModel>(TvShows, progressManager, busyProvider);
            FindNewEpisodes = new FindNewEpisodesCommand(TvShows, progressManager, busyProvider);

            Sources = viewModelFactory.GetSourceManager(SourceType.TvShow);
            Sources.SpecificFolders.CollectionChanged += SourceFoldersCollectionChanged;
        }
示例#18
0
 public MovieManagerViewModel(IFileSystemService fileSystemService,
                              IMovieViewModelFactory viewModelFactory,
                              IProgressManagerViewModel progressManager,
                              IBusyProvider busyProvider)
 {
     _fileSystemService = fileSystemService;
     _viewModelFactory  = viewModelFactory;
     _busyProvider      = busyProvider;
     Movies             = new ObservableCollection <IMovieItem>();
     UpdateAll          = new UpdateAllMetadataCommand <IMovieItem>(Movies, progressManager, busyProvider);
     Sources            = _viewModelFactory.GetSourceManager();
     Sources.SpecificFolders.CollectionChanged += SourceFoldersCollectionChanged;
 }
 public MovieManagerViewModel(IFileSystemService fileSystemService,
     IMovieViewModelFactory viewModelFactory,
     IProgressManagerViewModel progressManager,
     IBusyProvider busyProvider)
 {
     _fileSystemService = fileSystemService;
     _viewModelFactory = viewModelFactory;
     _busyProvider = busyProvider;
     Movies = new ObservableCollection<IMovieItem>();
     UpdateAll = new UpdateAllMetadataCommand<IMovieItem>(Movies, progressManager, busyProvider);
     Sources = _viewModelFactory.GetSourceManager();
     Sources.SpecificFolders.CollectionChanged += SourceFoldersCollectionChanged;
 }
 public MovieViewModelFactory(ISourceService sourceService,
                              IMovieMetadataService metadataService,
                              IFileSystemService fileSystemService,
                              IProgressManagerViewModel progressManager,
                              IKeyDataStore keyDataStore,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _metadataService       = metadataService;
     _progressManager       = progressManager;
     _keyDataStore          = keyDataStore;
     _busyProvider          = busyProvider;
     _dialogViewer          = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public MovieViewModelFactory(ISourceService sourceService,
     IMovieMetadataService metadataService,
     IFileSystemService fileSystemService,
     IProgressManagerViewModel progressManager,
     IKeyDataStore keyDataStore,
     IBusyProvider busyProvider,
     IDialogViewer dialogViewer,
     IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _metadataService = metadataService;
     _progressManager = progressManager;
     _keyDataStore = keyDataStore;
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public TvShowViewModelFactory(ISourceService sourceService,
     IFileSystemService fileSystemService,
     ITvShowFileService tvShowFileService,
     ITvShowMetadataService tvShowMetadataService,
     IEpisodeMetadataService episodeMetadataService,
     IProgressManagerViewModel progressManagerViewModel,
     IKeyDataStore keyDataStore,
     IBusyProvider busyProvider,
     IDialogViewer dialogViewer,
     IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _tvShowFileService = tvShowFileService;
     _tvShowMetadataService = tvShowMetadataService;
     _episodeMetadataService = episodeMetadataService;
     _progressManagerViewModel = progressManagerViewModel;
     _keyDataStore = keyDataStore;
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public TvShowViewModelFactory(ISourceService sourceService,
                               IFileSystemService fileSystemService,
                               ITvShowFileService tvShowFileService,
                               ITvShowMetadataService tvShowMetadataService,
                               IEpisodeMetadataService episodeMetadataService,
                               IProgressManagerViewModel progressManagerViewModel,
                               IKeyDataStore keyDataStore,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService            = sourceService;
     _fileSystemService        = fileSystemService;
     _tvShowFileService        = tvShowFileService;
     _tvShowMetadataService    = tvShowMetadataService;
     _episodeMetadataService   = episodeMetadataService;
     _progressManagerViewModel = progressManagerViewModel;
     _keyDataStore             = keyDataStore;
     _busyProvider             = busyProvider;
     _dialogViewer             = dialogViewer;
     _actorViewModelFactory    = actorViewModelFactory;
 }
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
     IAlbumMetadataService albumMetadataService,
     ISourceService sourceService,
     IFileSystemService fileSystemService,
     IMusicFileService musicFileService,
     IMusicImageService imageService,
     IMusicImageUpdater imageUpdater,
     IBusyProvider busyProvider,
     IKeyDataStore keyDataStore,
     IProgressManagerViewModel progressManager,
     IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService = albumMetadataService;
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _musicFileService = musicFileService;
     _imageService = imageService;
     _imageUpdater = imageUpdater;
     _busyProvider = busyProvider;
     _keyDataStore = keyDataStore;
     _progressManager = progressManager;
     _dialogViewer = dialogViewer;
 }
示例#25
0
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
                              IAlbumMetadataService albumMetadataService,
                              ISourceService sourceService,
                              IFileSystemService fileSystemService,
                              IMusicFileService musicFileService,
                              IMusicImageService imageService,
                              IMusicImageUpdater imageUpdater,
                              IBusyProvider busyProvider,
                              IKeyDataStore keyDataStore,
                              IProgressManagerViewModel progressManager,
                              IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService  = albumMetadataService;
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _musicFileService      = musicFileService;
     _imageService          = imageService;
     _imageUpdater          = imageUpdater;
     _busyProvider          = busyProvider;
     _keyDataStore          = keyDataStore;
     _progressManager       = progressManager;
     _dialogViewer          = dialogViewer;
 }
 public UpdateMetadataCommand(IMetadataProvider metadataProvider, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
 {
     _metadataProvider = metadataProvider;
     _progressManager = progressManager;
     _busyProvider = busyProvider;
 }
 public void Show(IProgressManagerViewModel progressManager)
 {
     DataContext = progressManager;
     Show();
 }
 public UpdateMetadataCommand(IMetadataProvider metadataProvider, IProgressManagerViewModel progressManager, IBusyProvider busyProvider)
 {
     _metadataProvider = metadataProvider;
     _progressManager  = progressManager;
     _busyProvider     = busyProvider;
 }