/// <summary> /// Get list of recorded programs and the information needed to delete them /// from MythWeb, and show them in the ListView. /// </summary> public void RefreshRecordings() { if(!string.IsNullOrEmpty(_settings.ServerName)) { _recordings = new MythRecordings(_settings.ServerName, _settings.ServerPort, _settings.SortOption); if(_selected != null) { if(_selected.Tag is Show) ListShows(((Show)_selected.Tag).Title); else if(_selected.Tag is Season) { Season season = (Season)_selected.Tag; Show show = _recordings.Shows.Where(s => s.Title == season.Show.Title).FirstOrDefault(); if(show != null) ListSeasons(show, season.Number); else ListShows(); } else if(_selected.Tag is Episode) { Episode episode = (Episode)_selected.Tag; Show show = _recordings.Shows.Where(s => s.Title == episode.Season.Show.Title).FirstOrDefault(); if(show != null) { Season season = show.Seasons.Where(s => s.Number == episode.Season.Number).FirstOrDefault(); if(season != null) ListEpisodes(season, episode.Name); else ListSeasons(show); } else ListShows(); } } else ListShows(); } }
/// <summary> /// Create a show that has at least one recorded episode. /// </summary> /// <param name="parent">MythRecordings object that will contain the new show</param> /// <param name="title">Show title</param> public Show(MythRecordings parent, string title) { _recordings = parent; _title = title; }
private void _cmnuMainSettings_Click(object sender, EventArgs e) { new MythServerConfig(_settings).ShowDialog(this); if(!string.IsNullOrEmpty(_settings.ServerName) && (_recordings == null || !_recordings.Equals(_settings.ServerName, _settings.ServerPort))) { _recordings = new MythRecordings(_settings.ServerName, _settings.ServerPort); RefreshRecordings(); } }