public static void SetDownloadStatus(IEnumerable <PlaylistMusicItem> items, ulong bytesReceived) { foreach (var item in items) { MusicItem.SetDownloadStatus(item.Song, bytesReceived); } }
protected override void OnDownloadStatusUpdate(DownloadOperation download) { base.OnDownloadStatusUpdate(download); // Updates the BytesReceived property of the possibly loaded MusicItem // so that a progress bar may be displayed under the item var musicPath = AppLocalFolderLibrary.MusicPath(download.ResultFile); var musicItem = MusicProvider.SearchItem(musicPath); var progress = download.Progress; var bytesReceived = progress.BytesReceived; if (musicItem != null) { MusicItem.SetDownloadStatus(musicItem, bytesReceived); } var playlistTracks = Playlist.Songs.Where(item => item.Song.Path == musicPath).ToList(); BasePlaylist.SetDownloadStatus(playlistTracks, bytesReceived); }