private void SummaryPlayStartClicked(object sender, RoutedEventArgs e) { if ((sender as Button)?.DataContext is PodcastEpisodeView kvp) { PodcastFunctions.PlayFile(kvp, true).ConfigureAwait(false); } }
private void SearchPodcastsClicked(object sender, RoutedEventArgs e) { var res = PodcastFunctions.SearchPodcasts(searchData.SearchString); searchData.SearchResults.Clear(); searchData.SearchResults = res; }
private void WindowClosing(object sender, CancelEventArgs e) { FileDownloader.Kill(); VlcApi.Kill(); PodcastFunctions.Kill(); WindowPlacementHandler.GetPlacement(new WindowInteropHelper(this).Handle); }
private void TimeSliderMouseUp(object sender, MouseButtonEventArgs e) { if (sender is Slider slider) { sliderData.MovingTimeSlider = false; PodcastFunctions.SeekFile(slider.Value).ConfigureAwait(false); } }
private void SearchPodcastKeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter && sender is TextBox textBox) { var res = PodcastFunctions.SearchPodcasts(textBox.Text); searchData.SearchResults.Clear(); searchData.SearchResults = res; } }
private void DownloadRecentClicked(object sender, RoutedEventArgs e) { if ((sender as Button)?.DataContext is PodcastEpisodeView kvp) { var podcast = config.ConfigObject.PodcastMap.Podcasts.FirstOrDefault(x => x.Value.PrimaryName == kvp.PrimaryName).Value; var ep = kvp.Episode.EpisodeNumber; if (podcast == null) { return; } PodcastFunctions.DownloadEpisode(ep, podcast).ConfigureAwait(false); } }
private void OnFinishDownloading(bool res, int ep, string shortCode) { if (ShortCode != shortCode) { return; } var episodeToUse = _episodes[ep]; episodeToUse.IsDownloaded = res; Config.Instance.SaveConfig(); FileDownloader.OnDownloadFinishedEvent -= OnFinishDownloading; PodcastFunctions.UpdateLatestPodcastList().ConfigureAwait(false); }
public async Task InitializePodcasts() { isLoading = true; foreach (var pod in config.ConfigObject.PodcastMap.Podcasts) { await pod.Value.CheckForNew(); await pod.Value.FillNewEpisodes(); await pod.Value.CheckForDownloadedEpisodes(); } await PodcastFunctions.UpdateLatestPodcastList().ConfigureAwait(false); await PodcastFunctions.UpdateLatestPlayedList().ConfigureAwait(false); errorData.Error = ""; VlcApi.DoNothing(); isLoading = false; }
private void StopClicked(object sender, RoutedEventArgs e) { PodcastFunctions.StopCommand().ConfigureAwait(false); }