public static DownloadTrack ( String url, InfoReportProxy view, bool exit = false ) : void | ||
url | String | The link provided to the application from the view |
view | InfoReportProxy | The view to report progress back to |
exit | bool | Exit after download? |
return | void |
public static async void DownloadTrack(String url, InfoReportProxy view, bool exit = false)
{
CrashHandler.AddExtra("stream_url", url);
try
{
BaseStream sound;
if (url.Contains(@"/sets/"))
sound = new SCSetStream(url, view);
else
sound = new SCTrackStream(url, view);
var download = sound.Download();
if (download != null && await download)
sound.Finish();
}
catch (Exception e)
{
CrashHandler.Throw("There was an issue downloading the stream!", e);
}
finally
{
CrashHandler.ClearExtras();
if (exit)
{
Application.Exit();
}
}
}
}