Esempio n. 1
0
        private async Task DownloadAllAlbumArtsInternal(CancellationToken token)
        {
            var dispatcher = Application.Current.Dispatcher;

            if (dispatcher == null)
            {
                throw new ApplicationException("Dispatcher is null");
            }

            this.Status = "Downloading albums...";

            // TODO notify current processed document? (processing is in parallel)

            foreach (var resolvedBandInfo in this.ResolvedBandInfos)
            {
                Logger.Debug($"Saving all albums for {resolvedBandInfo}");

                dispatcher.Invoke(() =>
                                  this.CurrentBand = resolvedBandInfo.Name
                                  );

                var albums = await App.InfoProvider.GetAllAlbums(resolvedBandInfo, token);

                await SaveUtils.SaveAllAlbumArts(albums);
            }

            dispatcher.Invoke(() => {
                this.Status       = "Downloading successfully ended";
                this.CurrentAlbum = String.Empty;
                this.CurrentBand  = String.Empty;
            });
        }
Esempio n. 2
0
        private async void SaveAllAlbumArts()
        {
            var infos = await App.InfoProvider.GetAllAlbums(this.DetailedInfo);

            await SaveUtils.SaveAllAlbumArts(infos);
        }