private async void AddFeed() { var dialog = new Views.AddURLDialog(); bool result = await _app.ShowDialog("Add URL...", dialog, DialogButtons.OkCancel); if (result) { try { var feed = await DownloadFeed(dialog.Url); _db.Podcasts.Save(new PodcastUri { Name = feed.Title.Text, Uri = dialog.Url }); Podcasts.UpdateWith(_db.Podcasts.GetAll()); Feed.UpdateWith(ParseFeed(feed)); } catch (Exception ex) { await _app.ShowMessageBox("Error", "Can't download or parse given url", DialogButtons.Ok); _app.Log.Exception(ex); } } }
private async void AddUrl() { var dialog = new Views.AddURLDialog(); bool result = await _app.ShowDialog("Add URL...", dialog, DialogButtons.OkCancel); if (result) { if (dialog.Url.EndsWith("m3u") || dialog.Url.EndsWith("pls") || dialog.Url.EndsWith("m3u8")) { await DoOpenList(dialog.Url, true); } else { List.Add(dialog.Url); } } }