Exemple #1
0
 public async Task Refresh()
 {
     LazyLoaded();
     using (_busyProvider.DoWork())
     {
         await TryRefreshInternal();
     }
 }
Exemple #2
0
        public async Task SaveLocalFile()
        {
            using (_busyProvider.DoWork())
            {
                await _fileSystemService.CopyFile(Url, _path);

                IsClosed = true;
                _imageSelectionViewModel.IsClosed = true;
            }
        }
 private async Task LoadImagesInternal()
 {
     using (_busyProvider.DoWork())
     {
         AvailableMovieImages images = await _metadataService.FindSetImages(DisplayName);
         await SetImagePathIfNeeded(images.Fanarts, Fanart);
         await SetImagePathIfNeeded(images.Posters, Poster);
         await Refresh();
     }
 }
 public async Task Load()
 {
     if (!_loaded)
     {
         _loaded = true;
         using (_busyProvider.DoWork())
         {
             await LoadInternal();
         }
     }
 }
        public async Task <IEnumerable <ProgressItem> > FindNewEpisodes()
        {
            using (_busyProvider.DoWork())
            {
                await LoadChildren();

                List <ProgressItem> items = new List <ProgressItem>();
                foreach (ISeasonViewModel season in Children)
                {
                    items.AddRange(await season.FindNewEpisodes());
                }
                return(items);
            }
        }
Exemple #6
0
 private async Task AddMovies(IEnumerable <string> movies)
 {
     using (_busyProvider.DoWork())
     {
         foreach (string path in movies)
         {
             foreach (string file in await FindMovieFiles(path))
             {
                 IMovieViewModel newMovie = _viewModelFactory.GetMovie(file);
                 AddMovie(newMovie);
                 newMovie.PropertyChanged += MoviePropertyChanged;
             }
         }
     }
 }
        public void Load()
        {
            using (_busyProvider.DoWork())
            {
                IEnumerable <Source> sources = _sourceService.GetSources(_sourceType);

                // Since we're loading the sources from the repo, don't save them back when adding them in the manager
                RootFolders.CollectionChanged     -= RootFoldersCollectionChanged;
                SpecificFolders.CollectionChanged -= SpecificFoldersCollectionChanged;

                LoadFolders(sources);

                RootFolders.CollectionChanged     += RootFoldersCollectionChanged;
                SpecificFolders.CollectionChanged += SpecificFoldersCollectionChanged;
            }
        }
Exemple #8
0
 void ILifecycleService.Initialize()
 {
     using (_busyProvider.DoWork())
     {
         Sources.Load();
         TvShows.CollectionChanged += RefreshNewItems;
     }
 }
Exemple #9
0
 private async Task UpdateMethod()
 {
     using (_busyProvider.DoWork())
     {
         await _metadataService.Update(Path, _artistViewModel.Id);
         await Refresh();
     }
 }
        public async Task Refresh()
        {
            using (_busyProvider.DoWork())
            {
                await InitialLoadSeasonImages();

                ForceInitialLoadTvShowImages();
            }
        }
Exemple #11
0
        public async Task SaveSelectedItem()
        {
            using (_busyProvider.DoWork())
            {
                await SaveInternal(SelectedItem);

                IsClosed = true;
            }
        }
        public async Task Search()
        {
            using (_busyProvider.DoWork())
            {
                IEnumerable <T> items = await SearchInternal(SearchTitle);

                SetAvailableItems(items);
            }
        }
        public async Task LoadAvailableImages()
        {
            using (_busyProvider.DoWork())
            {
                ImageSelection = new ImageSelectionViewModel(_fileSystemService, _busyProvider, Path, _horizontalAlignement);
                IEnumerable <Image> images = await _imageStrategy.FindImages();

                ImageSelection.SetAvailableItems(images);
                ImageSelection.PropertyChanged += ImageSelectionPropertyChanged;
            }
        }
 public override async Task ExecuteAsync(object parameter)
 {
     using (_busyProvider.DoWork())
     {
         foreach (ProgressItem item in await _metadataProvider.Update())
         {
             _progressManager.AddItem(item);
         }
         await _progressManager.Start();
     }
 }
 public async Task Start()
 {
     using (_busyProvider.DoWork())
     {
         _collecting = false;
         foreach (ProgressItem item in Total)
         {
             CurrentItem = item;
             await ExecuteItem(item);
         }
     }
 }
 public override async Task ExecuteAsync(object parameter)
 {
     using (_busyProvider.DoWork())
     {
         foreach (ITvShowViewModel tvShow in _tvShows)
         {
             foreach (ProgressItem item in await tvShow.FindNewEpisodes())
             {
                 _progressManager.AddItem(item);
             }
         }
         await _progressManager.Start();
     }
 }