Пример #1
0
        private async Task Download()
#endif
        {
            while (TracksToDownload.Count > 0)
            {
                var track = TracksToDownload[0];
                if (downloadAgain)
                {
                    track.filePath = "";
                    track.UpdateItem();
                }
#if DEBUG
                YoutubeDL.DownloadTrack(track);
#else
                if (Counter < 3)
                {
                    YoutubeDL.DownloadTrack(track);
                }
                else
                {
                    await YoutubeDL.DownloadTrack(track);
                }
#endif
                TracksToDownload.Remove(track);
            }
        }
Пример #2
0
        internal static async void PlayAfterDownload(List <Track> tracks)
        {
            if (tracks.Count == 0)
            {
                return;
            }
            var track = tracks[0];

#if DEBUG
            YoutubeDL.DownloadTrack(track);
#else
            await YoutubeDL.DownloadTrack(track);
#endif
            track.MusicTab.Play(track);
            while (!MusicPlayer.Instance.IsPlaying)
            {
                //await Task.Delay(200);
                Thread.Sleep(200);
            }
            AddToDownload(tracks.GetRange(1, tracks.Count - 1));
        }
Пример #3
0
        public async Task DownloadTrack(Track track) =>
#endif
#if DEBUG
        YoutubeDL.DownloadTrack(track);