private async Task ExtractMediaInformation(IMediaFile mediaFile) { var index = MediaQueue.IndexOf(mediaFile); await MediaExtractor.ExtractMediaInfo(mediaFile); if (index >= 0) { MediaQueue[index] = mediaFile; } OnMediaFileChanged(CurrentPlaybackManager, new MediaFileChangedEventArgs(mediaFile)); }
private async Task GetMediaInformation(IEnumerable <IMediaFile> mediaFiles) { foreach (var mediaFile in mediaFiles) { try { var index = MediaQueue.IndexOf(mediaFile); var info = await MediaExtractor.ExtractMediaInfo(mediaFile); if (index >= 0) { MediaQueue[index] = info; } OnMediaFileChanged(CurrentPlaybackManager, new MediaFileChangedEventArgs(info)); } catch (Exception e) { OnMediaFileFailed(this, new MediaFileFailedEventArgs(e, mediaFile)); } } }