SDownload.Framework.Streams.SCTrackStream.Download C# (CSharp) Метод

Download() публичный Метод

Downloads the necessary files and handles any exceptions
public Download ( bool ignoreExtras = false ) : Task
ignoreExtras bool If the extra files associated with the main resource should be skipped
Результат Task
        public override async Task<bool> Download(bool ignoreExtras = false)
        {
            var result = await base.Download(ignoreExtras);
            if (!result)
            {
                // If the last attempt was manual, it's impossible
                if (_forceManual)
                {
                    // Can ignore this being called for every reattempt, view will close and ignore
                    View.Report("Impossible! :/", true);

                    // Ignore songs that have streaming blocked and can't be downloaded, throw everything else
                    if (LastException.Message.Contains("401"))
                    {
                        View.Report("Impossible! :/", true);
                    }
                    else
                    {
                        View.Report("Error!", true);
                        CrashHandler.Throw("There was an issue downloading the necessary file(s)!",
                                               LastException);
                    }
                }
                else
                    result = await RetryDownload();

            }
            return result && await Validate();
        }