private void cboDefaultGroup_SelectedIndexChanged(object sender, EventArgs e) { ArrayList arrayList = new ArrayList(); if (cboDefaultGroup.Text != "") { int iD = ComicGroup.GetID(cboDefaultGroup.Text); arrayList.Add("group_id=" + iD); } if (cboDefaultPublisher.Text != "") { int iD2 = ComicPublisher.GetID(cboDefaultPublisher.Text); arrayList.Add("pub_id=" + iD2); } cboDefaultSeries.Items.Clear(); cboDefaultSeries.Items.Add(""); string str = ""; if (arrayList.Count > 0) { str = "WHERE " + string.Join(" AND ", CC.StringList(arrayList)); } Query query = CC.SQL.ExecQuery("SELECT name FROM series " + str); while (query.NextResult()) { cboDefaultSeries.Items.Add(query.hash["name"]); } }
private void cboDefaultPublisher_SelectedIndexChanged(object sender, EventArgs e) { string str = ""; if (cboDefaultPublisher.Text != "") { int iD = ComicPublisher.GetID(cboDefaultPublisher.Text); str = "WHERE pub_id=" + iD; } cboDefaultGroup.Items.Clear(); cboDefaultGroup.Items.Add(""); Query query = CC.SQL.ExecQuery("SELECT name FROM groups " + str); while (query.NextResult()) { cboDefaultGroup.Items.Add(query.hash["name"]); } cboDefaultGroup_SelectedIndexChanged(this, null); }
public void AutoTag() { Regex regex = new Regex("[^0-9]"); Regex regex2 = new Regex(CC.AutoTag.Pattern); Match match = regex2.Match(FileName); string value = match.Groups[CC.AutoTag.Matches[0]].Value; if (value != "") { PublisherName = value; } string value2 = match.Groups[CC.AutoTag.Matches[2]].Value; if (value2 != "") { SeriesName = value2; } string value3 = match.Groups[CC.AutoTag.Matches[1]].Value; if (value3 != "") { GroupName = value3; } string value4 = match.Groups[CC.AutoTag.Matches[4]].Value; if (value4 != "") { Name = value4; } try { Number = Convert.ToInt16(match.Groups[CC.AutoTag.Matches[5]].Value); } catch { } try { string value5 = match.Groups[CC.AutoTag.Matches[3]].Value; value5 = regex.Replace(value5, ""); SeriesVolume = Convert.ToInt16(value5); } catch { } if ((PublisherName == "") & CC.AutoTag.usePublisher) { PublisherName = CC.AutoTag.Publisher; } if ((SeriesName == "") & CC.AutoTag.useSeries) { SeriesName = CC.AutoTag.Series; } if ((GroupName == "") & CC.AutoTag.useGroup) { GroupName = CC.AutoTag.Group; } if ((Name == "") & CC.AutoTag.usePlot) { Name = CC.AutoTag.Plot; } if ((SeriesVolume == 0) & CC.AutoTag.useVolume) { SeriesVolume = CC.AutoTag.Volume; } if (SeriesName == "") { SeriesName = Path.GetFileNameWithoutExtension(FileName); } if ((SeriesVolume == 0) | (SeriesVolume >= 10)) { SeriesVolume = 1; } if (Number == 0) { Type = 2; } else if (Number.ToString().Length == 4) { Type = 1; } else { Type = 0; } for (int i = 0; i < Settings.Default.ReplaceKeys.Count; i++) { SeriesName = SeriesName.Replace(Settings.Default.ReplaceKeys[i], Settings.Default.ReplaceVals[i]); } PublisherID = ComicPublisher.GetID(PublisherName); GroupID = ComicGroup.GetID(GroupName, PublisherID, PublisherName); SeriesID = ComicSeries.GetID(SeriesName, GroupID, PublisherID); }
public static int GetID(string SeriesName, int GroupID) { return(GetID(SeriesName, GroupID, ComicPublisher.GetID(Settings.Default.UnknownPublisher))); }