Beispiel #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);
                }
            }
        }
Beispiel #2
0
        public async Task Rescan(IEnumerable <PlaylistItem> playlistItems)
        {
            using (var task = new RefreshPlaylistMetaDataTask(playlistItems))
            {
                task.InitializeComponent(this.Core);
                await this.OnBackgroundTask(task).ConfigureAwait(false);

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