public void SetToDefauts() { this.ShowTimeZone = TimeZone.DefaultTimeZone(); // default, is correct for most shows this.LastFiguredTZ = ""; this.Items = new System.Collections.Generic.Dictionary <string, string>(); this.Seasons = new System.Collections.Generic.Dictionary <int, Season>(); this.AllBanners = new System.Collections.Generic.Dictionary <int, Banner>(); this.SeasonBanners = new System.Collections.Generic.Dictionary <int, Banner>(); this.SeasonLangBanners = new System.Collections.Generic.Dictionary <int, Banner>(); this.SeasonWideBanners = new System.Collections.Generic.Dictionary <int, Banner>(); this.SeasonLangWideBanners = new System.Collections.Generic.Dictionary <int, Banner>(); this.Dirty = false; this.Name = ""; this.AirsTime = null; this.TVDBCode = -1; this.LanguageId = -1; this.BannersLoaded = false; this.bestSeriesPosterId = -1; this.bestSeriesBannerId = -1; this.bestSeriesFanartId = -1; this.bestSeriesLangPosterId = -1; this.bestSeriesLangBannerId = -1; this.bestSeriesLangFanartId = -1; }
private void SetDefaults() { ManualFolderLocations = new Dictionary <int, List <string> >(); IgnoreSeasons = new List <int>(); UseCustomShowName = false; CustomShowName = ""; UseCustomLanguage = false; UseSequentialMatch = false; SeasonRules = new Dictionary <int, List <ShowRule> >(); SeasonEpisodes = new Dictionary <int, List <ProcessedEpisode> >(); ShowNextAirdate = true; TvdbCode = -1; AutoAddFolderBase = ""; AutoAddCustomFolderFormat = "Season {Season:2}"; AutoAddType = ShowItem.AutomaticFolderType.libraryDefault; DoRename = true; DoMissingCheck = true; CountSpecials = false; DvdOrder = false; CustomSearchUrl = ""; UseCustomSearchUrl = false; ForceCheckNoAirdate = false; ForceCheckFuture = false; BannersLastUpdatedOnDisk = null; //assume that the baners are old and have expired ShowTimeZone = TimeZone.DefaultTimeZone(); // default, is correct for most shows lastFiguredTz = ""; }
private void FigureOutTimeZone() { string tzstr = this.ShowTimeZone; if (string.IsNullOrEmpty(tzstr)) { tzstr = TimeZone.DefaultTimeZone(); } this.SeriesTZ = TimeZone.TimeZoneFor(tzstr); this.LastFiguredTZ = tzstr; }
public void SetToDefauts() { this.ShowTimeZone = TimeZone.DefaultTimeZone(); // default, is correct for most shows this.LastFiguredTZ = ""; this.Items = new System.Collections.Generic.Dictionary <string, string>(); this.Seasons = new System.Collections.Generic.Dictionary <int, Season>(); this.Dirty = false; this.Name = ""; this.AirsTime = null; this.TVDBCode = -1; this.Language = ""; }
private void FigureOutTimeZone() { string tzstr = ShowTimeZone; if (string.IsNullOrEmpty(tzstr)) { tzstr = TimeZone.DefaultTimeZone(); } seriesTimeZone = TimeZone.TimeZoneFor(tzstr); lastFiguredTz = tzstr; }
public ShowItem(XElement xmlSettings) { SetDefaults(); CustomShowName = xmlSettings.ExtractString("ShowName"); UseCustomShowName = xmlSettings.ExtractBool("UseCustomShowName") ?? false; UseCustomLanguage = xmlSettings.ExtractBool("UseCustomLanguage") ?? false; CustomLanguageCode = xmlSettings.ExtractString("CustomLanguageCode"); CustomShowName = xmlSettings.ExtractString("CustomShowName"); TvdbCode = xmlSettings.ExtractInt("TVDBID") ?? -1; CountSpecials = xmlSettings.ExtractBool("CountSpecials") ?? false; ShowNextAirdate = xmlSettings.ExtractBool("ShowNextAirdate") ?? true; AutoAddFolderBase = xmlSettings.ExtractString("FolderBase"); DoRename = xmlSettings.ExtractBool("DoRename") ?? true; DoMissingCheck = xmlSettings.ExtractBool("DoMissingCheck") ?? true; DvdOrder = xmlSettings.ExtractBool("DVDOrder") ?? false; UseCustomSearchUrl = xmlSettings.ExtractBool("UseCustomSearchURL") ?? false; CustomSearchUrl = xmlSettings.ExtractString("CustomSearchURL"); ShowTimeZone = xmlSettings.ExtractString("TimeZone") ?? TimeZone.DefaultTimeZone(); // default, is correct for most shows; ForceCheckFuture = xmlSettings.ExtractBool("ForceCheckFuture") ?? xmlSettings.ExtractBool("ForceCheckAll") ?? false; ForceCheckNoAirdate = xmlSettings.ExtractBool("ForceCheckNoAirdate") ?? xmlSettings.ExtractBool("ForceCheckAll") ?? false; AutoAddCustomFolderFormat = xmlSettings.ExtractString("CustomFolderFormat") ?? "Season {Season:2}"; AutoAddType = xmlSettings.ExtractInt("AutoAddType") == null ? AutomaticFolderType.libraryDefault : (AutomaticFolderType)xmlSettings.ExtractInt("AutoAddType"); BannersLastUpdatedOnDisk = xmlSettings.ExtractDateTime("BannersLastUpdatedOnDisk"); UseSequentialMatch = xmlSettings.ExtractBool("UseSequentialMatch") ?? false; SetupIgnoreRules(xmlSettings); SetupAliases(xmlSettings); SetupSeasonRules(xmlSettings); SetupSeasonFolders(xmlSettings); UpGradeFromOldSeasonFormat(xmlSettings); }
public AddEditShow(ShowItem si) { this.mSI = si; this.InitializeComponent(); this.cbTimeZone.BeginUpdate(); this.cbTimeZone.Items.Clear(); foreach (string s in TimeZone.ZoneNames()) { this.cbTimeZone.Items.Add(s); } this.cbTimeZone.EndUpdate(); this.mTCCF = new TheTVDBCodeFinder(si.TVDBCode != -1 ? si.TVDBCode.ToString() : ""); this.mTCCF.Dock = DockStyle.Fill; //mTCCF->SelectionChanged += gcnew System::EventHandler(this, &AddEditShow::lvMatches_ItemSelectionChanged); this.pnlCF.SuspendLayout(); this.pnlCF.Controls.Add(this.mTCCF); this.pnlCF.ResumeLayout(); this.chkCustomShowName.Checked = si.UseCustomShowName; if (this.chkCustomShowName.Checked) { this.txtCustomShowName.Text = si.CustomShowName; } this.chkCustomShowName_CheckedChanged(null, null); this.cbSequentialMatching.Checked = si.UseSequentialMatch; this.chkShowNextAirdate.Checked = si.ShowNextAirdate; this.chkSpecialsCount.Checked = si.CountSpecials; this.chkFolderPerSeason.Checked = si.AutoAdd_FolderPerSeason; this.txtSeasonFolderName.Text = si.AutoAdd_SeasonFolderName; this.txtBaseFolder.Text = si.AutoAdd_FolderBase; this.chkAutoFolders.Checked = si.AutoAddNewSeasons; this.chkFolderPerSeason_CheckedChanged(null, null); this.cbDoRenaming.Checked = si.DoRename; this.cbDoMissingCheck.Checked = si.DoMissingCheck; this.cbDoMissingCheck_CheckedChanged(null, null); this.chkPadTwoDigits.Checked = si.PadSeasonToTwoDigits; this.ShowTimeZone = ((si == null) || (si.TheSeries() == null)) ? TimeZone.DefaultTimeZone() : si.TheSeries().ShowTimeZone; this.cbTimeZone.Text = this.ShowTimeZone; this.chkDVDOrder.Checked = si.DVDOrder; this.cbIncludeFuture.Checked = si.ForceCheckFuture; this.cbIncludeNoAirdate.Checked = si.ForceCheckNoAirdate; bool first = true; si.IgnoreSeasons.Sort(); foreach (int i in si.IgnoreSeasons) { if (!first) { this.txtIgnoreSeasons.Text += " "; } this.txtIgnoreSeasons.Text += i.ToString(); first = false; } foreach (System.Collections.Generic.KeyValuePair <int, List <string> > kvp in si.ManualFolderLocations) { foreach (string s in kvp.Value) { ListViewItem lvi = new ListViewItem(); lvi.Text = kvp.Key.ToString(); lvi.SubItems.Add(s); this.lvSeasonFolders.Items.Add(lvi); } } this.lvSeasonFolders.Sort(); this.txtSeasonNumber_TextChanged(null, null); this.txtFolder_TextChanged(null, null); this.ActiveControl = mTCCF; // set initial focus to the code entry/show finder control foreach (string aliasName in this.mSI.AliasNames) { lbShowAlias.Items.Add(aliasName); } StringBuilder tl = new StringBuilder(); foreach (string s in CustomName.Tags) { tl.AppendLine(s); } this.txtTagList.Text = tl.ToString(); cbUseCustomSearch.Checked = si.UseCustomSearchURL && !String.IsNullOrWhiteSpace(si.CustomSearchURL); txtSearchURL.Text = si.CustomSearchURL ?? ""; EnableDisableCustomSearch(); }
private void SetShow() { int code = codeFinderForm.SelectedCode(); selectedShow.CustomShowName = txtCustomShowName.Text; selectedShow.UseCustomShowName = chkCustomShowName.Checked; selectedShow.UseCustomLanguage = chkCustomLanguage.Checked; if (selectedShow.UseCustomLanguage) { selectedShow.CustomLanguageCode = TheTVDB.Instance.LanguageList .GetLanguageFromLocalName(cbLanguage.SelectedItem?.ToString())?.Abbreviation ?? TVSettings.Instance.PreferredLanguageCode; } selectedShow.ShowTimeZone = cbTimeZone.SelectedItem?.ToString() ?? TimeZone.DefaultTimeZone(); selectedShow.ShowNextAirdate = chkShowNextAirdate.Checked; selectedShow.TvdbCode = code; selectedShow.CountSpecials = chkSpecialsCount.Checked; selectedShow.DoRename = cbDoRenaming.Checked; selectedShow.DoMissingCheck = cbDoMissingCheck.Checked; selectedShow.AutoAddCustomFolderFormat = txtSeasonFormat.Text; selectedShow.AutoAddFolderBase = txtBaseFolder.Text; if (rdoFolderCustom.Checked) { selectedShow.AutoAddType = ShowItem.AutomaticFolderType.custom; } else if (rdoFolderBaseOnly.Checked) { selectedShow.AutoAddType = ShowItem.AutomaticFolderType.baseOnly; } else if (rdoFolderLibraryDefault.Checked) { selectedShow.AutoAddType = ShowItem.AutomaticFolderType.libraryDefault; } else { selectedShow.AutoAddType = ShowItem.AutomaticFolderType.none; } selectedShow.DvdOrder = chkDVDOrder.Checked; selectedShow.ForceCheckFuture = cbIncludeFuture.Checked; selectedShow.ForceCheckNoAirdate = cbIncludeNoAirdate.Checked; selectedShow.UseCustomSearchUrl = cbUseCustomSearch.Checked; selectedShow.CustomSearchUrl = txtSearchURL.Text; selectedShow.UseSequentialMatch = cbSequentialMatching.Checked; string slist = txtIgnoreSeasons.Text; selectedShow.IgnoreSeasons.Clear(); foreach (Match match in Regex.Matches(slist, "\\b[0-9]+\\b")) { selectedShow.IgnoreSeasons.Add(int.Parse(match.Value)); } selectedShow.ManualFolderLocations.Clear(); foreach (ListViewItem lvi in lvSeasonFolders.Items) { try { int seas = int.Parse(lvi.Text); if (!selectedShow.ManualFolderLocations.ContainsKey(seas)) { selectedShow.ManualFolderLocations.Add(seas, new List <string>()); } selectedShow.ManualFolderLocations[seas].Add(lvi.SubItems[1].Text); } catch { // ignored } } selectedShow.AliasNames.Clear(); foreach (string showAlias in lbShowAlias.Items) { if (!selectedShow.AliasNames.Contains(showAlias)) { selectedShow.AliasNames.Add(showAlias); } } }