Пример #1
0
        public async Task Rescan(IEnumerable <IFileData> fileDatas)
        {
            var libraryItems  = fileDatas.OfType <LibraryItem>().ToArray();
            var playlistItems = fileDatas.OfType <PlaylistItem>().ToArray();

            if (libraryItems.Any())
            {
                using (var task = new RefreshLibraryMetaDataTask(libraryItems))
                {
                    task.InitializeComponent(this.Core);
                    await this.OnBackgroundTask(task).ConfigureAwait(false);

                    await task.Run().ConfigureAwait(false);
                }
            }
            if (playlistItems.Any())
            {
                using (var task = new RefreshPlaylistMetaDataTask(playlistItems))
                {
                    task.InitializeComponent(this.Core);
                    await this.OnBackgroundTask(task).ConfigureAwait(false);

                    await task.Run().ConfigureAwait(false);
                }
            }
        }
Пример #2
0
        public async Task Rescan(IEnumerable <LibraryItem> libraryItems)
        {
            using (var task = new RefreshLibraryMetaDataTask(libraryItems))
            {
                task.InitializeComponent(this.Core);
                await this.OnBackgroundTask(task).ConfigureAwait(false);

                await task.Run().ConfigureAwait(false);
            }
        }