From: <sa...@us...> - 2007-01-29 21:07:39
|
Revision: 42 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=42&view=rev Author: saamand Date: 2007-01-29 13:07:30 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs trunk/plugins/MyLyrics/LyricsEngine/Setup.cs trunk/plugins/MyLyrics/LyricsEngine/Wiki.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs 2007-01-29 16:38:44 UTC (rev 41) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs 2007-01-29 21:07:30 UTC (rev 42) @@ -60,6 +60,8 @@ int m_managedThreadId = -1; public static event EventHandler StopTheSearchAndAbort; + + private bool m_noMoreValidLicenseKeys = false; @@ -319,5 +321,11 @@ { set { LyricController.noOfLyricsToSearch = value; } } + + public bool NoMoreValidLicenseKeys + { + get { return m_noMoreValidLicenseKeys; } + set { m_noMoreValidLicenseKeys = value; } + } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricSearch.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyLyrics/LyricsEngine/Setup.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2007-01-29 16:38:44 UTC (rev 41) +++ trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2007-01-29 21:07:30 UTC (rev 42) @@ -15,7 +15,7 @@ "LeosLyrics", "LyricsFreak", "SongMeanings" - //"LyricsHostring", + //"LyricsHosting", //"MusicMadeMe", }; Modified: trunk/plugins/MyLyrics/LyricsEngine/Wiki.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Wiki.cs 2007-01-29 16:38:44 UTC (rev 41) +++ trunk/plugins/MyLyrics/LyricsEngine/Wiki.cs 2007-01-29 21:07:30 UTC (rev 42) @@ -33,7 +33,7 @@ IAsyncResult ar = del.BeginInvoke(this.artist, this.title, null, null); - while (noOfTries < 12) + while (noOfTries < 20) { // If the user has aborted stop the search and return (false) if (Abort) @@ -46,7 +46,7 @@ } else { - Thread.Sleep(2000); + Thread.Sleep(500); } ++noOfTries; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2007-01-29 16:38:44 UTC (rev 41) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2007-01-29 21:07:30 UTC (rev 42) @@ -75,7 +75,9 @@ static bool lyricsFound = false; + String[] m_sitesToSearch; + public GUIMyLyrics() { m_EventStopThread = new ManualResetEvent(false); @@ -202,14 +204,67 @@ GUIControl.ClearControl(GetID, (int)Controls.CONTROL_Lyric); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_Lyric, m_LyricText); + bool useSing365, useLyricsHosting, useLyricsMania, useSongMeanings, useLyricsFreak, useMMMD, useLeosLyrics, useLyrics007, useLyricWiki; + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { - m_GoogleLicenseKeys[0] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey1", ""); + m_GoogleLicenseKeys[0] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey1", "zhQlW3ZQFHLE2dibwGRcpcDJvThQ/TTU"); m_GoogleLicenseKeys[1] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey2", ""); m_GoogleLicenseKeys[2] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey3", ""); m_GoogleLicenseKeys[3] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey4", ""); m_GoogleLicenseKeys[4] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey5", ""); + + useSing365 = ((string)xmlreader.GetValueAsString("myLyrics", "useSing365", "False")).ToString().Equals("True") ? true : false; + useLyricsHosting = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsHosting", "False")).ToString().Equals("True") ? true : false; + useLyricsMania = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsMania", "False")).ToString().Equals("True") ? true : false; + useSongMeanings = ((string)xmlreader.GetValueAsString("myLyrics", "useSongMeaning", "False")).ToString().Equals("True") ? true : false; + useLyricsFreak = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsFreak", "False")).ToString().Equals("True") ? true : false; + useMMMD = ((string)xmlreader.GetValueAsString("myLyrics", "useMMMD", "False")).ToString().Equals("True") ? true : false; + useLeosLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useLeosLyrics", "False")).ToString().Equals("True") ? true : false; + useLyrics007 = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "False")).ToString().Equals("True") ? true : false; + useLyricWiki = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; } + + ArrayList sitesToSearch = new ArrayList(); + + if (useSing365 && Setup.IsMember("Sing365")) + { + sitesToSearch.Add("Sing365"); + } + if (useLyricsHosting && Setup.IsMember("LyricsHosting")) + { + sitesToSearch.Add("LyricsHosting"); + } + if (useLyricsMania && Setup.IsMember("LyricsMania")) + { + sitesToSearch.Add("LyricsMania"); + } + if (useSongMeanings && Setup.IsMember("SongMeanings")) + { + sitesToSearch.Add("SongMeanings"); + } + if (useLyricsFreak && Setup.IsMember("LyricsFreak")) + { + sitesToSearch.Add("LyricsFreak"); + } + if (useMMMD && Setup.IsMember("MusicMadeMe")) + { + sitesToSearch.Add("MusicMadeMe"); + } + if (useLeosLyrics && Setup.IsMember("LeosLyrics")) + { + sitesToSearch.Add("LeosLyrics"); + } + if (useLyrics007 && Setup.IsMember("Lyrics007")) + { + sitesToSearch.Add("Lyrics007"); + } + if (useLyricWiki && Setup.IsMember("LyricWiki")) + { + sitesToSearch.Add("LyricWiki"); + } + + m_sitesToSearch = (string[])sitesToSearch.ToArray(typeof(string)); } void SaveSettings() @@ -320,7 +375,7 @@ lc.GoogleLicenseKey = m_GoogleLicenseKeys[m_GoogleLicenseKeyIndex]; - LyricConfigInfo lyricConfigInfo = new LyricConfigInfo(lc.GoogleLicenseKey, m_artist, m_title, "lyrics", Setup.accessibleLyricSites); + LyricConfigInfo lyricConfigInfo = new LyricConfigInfo(lc.GoogleLicenseKey, m_artist, m_title, "lyrics", m_sitesToSearch); lc.addNewLyricSearch(lyricConfigInfo); } } @@ -447,8 +502,10 @@ { set { - //m_StatusText = ((String)value[0]).ToString() + ((String)value[1]).ToString(); - //GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, m_StatusText); + string line1 = (string)value[0]; + string line2 = (string)value[1]; + m_StatusText = line1 + "\r\n" + line2; + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, m_StatusText); } } @@ -456,10 +513,7 @@ { set { - //int noToSearch = (int)value[0]; - //int noSearched = (int)value[1]; - //int noFound = (int)value[2]; - //int noNotFound = (int)value[2]; + } } @@ -480,7 +534,8 @@ ShowLyricOnScreen(lyricText, site); SaveLyricToDatabase(); - if (lc != null) + // if not found by LyricWiki, write which license key was used + if (lc != null && !site.Equals("LyricWiki")) { LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + (lc.GoogleLicenseKey.Equals("") ? "empty key" : lc.GoogleLicenseKey)); } @@ -507,7 +562,7 @@ if (!lyricsFound && m_artist.Equals(artist) && m_title.Equals(title)) { LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + "Search terminates: No lyric found..."); - m_StatusText = "No lyric found."; + m_StatusText = "No lyric found"; GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, m_StatusText); } } @@ -551,8 +606,9 @@ if (googlePopUpMessageShown == false) { LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Warning, 0, LyricDiagnostics.elapsedTimeString() + noValidKeysMessage); - PopUpMessage("Google license key", "All queries of your google license key(s)", "has been used, which properly will result", "in decrease of the lyrics hit ratio."); + PopUpMessage("LyricWiki only valid source", "Your google license keys don't hold any valid query entries", "Therefore only LyricWiki will be searched.", ""); googlePopUpMessageShown = true; + lc.NoMoreValidLicenseKeys = true; } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs 2007-01-29 16:38:44 UTC (rev 41) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs 2007-01-29 21:07:30 UTC (rev 42) @@ -631,7 +631,7 @@ this.tabPageSetup.Padding = new System.Windows.Forms.Padding(3); this.tabPageSetup.Size = new System.Drawing.Size(520, 502); this.tabPageSetup.TabIndex = 2; - this.tabPageSetup.Text = "Setup"; + this.tabPageSetup.Text = "Search Setup"; this.tabPageSetup.UseVisualStyleBackColor = true; // // gbSettings @@ -773,8 +773,6 @@ // cbLeosLyrics // this.cbLeosLyrics.AutoSize = true; - this.cbLeosLyrics.Checked = true; - this.cbLeosLyrics.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLeosLyrics.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbLeosLyrics.Location = new System.Drawing.Point(208, 43); this.cbLeosLyrics.Name = "cbLeosLyrics"; @@ -799,8 +797,6 @@ // cbLyricsMania // this.cbLyricsMania.AutoSize = true; - this.cbLyricsMania.Checked = true; - this.cbLyricsMania.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricsMania.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbLyricsMania.Location = new System.Drawing.Point(49, 43); this.cbLyricsMania.Name = "cbLyricsMania"; @@ -812,8 +808,6 @@ // cbLyrics007 // this.cbLyrics007.AutoSize = true; - this.cbLyrics007.Checked = true; - this.cbLyrics007.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyrics007.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbLyrics007.Location = new System.Drawing.Point(208, 21); this.cbLyrics007.Name = "cbLyrics007"; @@ -825,8 +819,6 @@ // cbSing365 // this.cbSing365.AutoSize = true; - this.cbSing365.Checked = true; - this.cbSing365.CheckState = System.Windows.Forms.CheckState.Checked; this.cbSing365.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbSing365.Location = new System.Drawing.Point(49, 65); this.cbSing365.Name = "cbSing365"; @@ -838,8 +830,6 @@ // cbSongMeaning // this.cbSongMeaning.AutoSize = true; - this.cbSongMeaning.Checked = true; - this.cbSongMeaning.CheckState = System.Windows.Forms.CheckState.Checked; this.cbSongMeaning.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbSongMeaning.Location = new System.Drawing.Point(366, 21); this.cbSongMeaning.Name = "cbSongMeaning"; @@ -851,8 +841,6 @@ // cbLyricsFreak // this.cbLyricsFreak.AutoSize = true; - this.cbLyricsFreak.Checked = true; - this.cbLyricsFreak.CheckState = System.Windows.Forms.CheckState.Checked; this.cbLyricsFreak.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.cbLyricsFreak.Location = new System.Drawing.Point(208, 65); this.cbLyricsFreak.Name = "cbLyricsFreak"; @@ -921,19 +909,19 @@ this.mpLabel6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mpLabel6.Location = new System.Drawing.Point(11, 72); this.mpLabel6.Name = "mpLabel6"; - this.mpLabel6.Size = new System.Drawing.Size(55, 16); + this.mpLabel6.Size = new System.Drawing.Size(50, 16); this.mpLabel6.TabIndex = 19; this.mpLabel6.Text = "Notice:"; // // lbGoogleNotice // this.lbGoogleNotice.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbGoogleNotice.Location = new System.Drawing.Point(62, 72); + this.lbGoogleNotice.Location = new System.Drawing.Point(67, 72); this.lbGoogleNotice.Name = "lbGoogleNotice"; - this.lbGoogleNotice.Size = new System.Drawing.Size(412, 25); + this.lbGoogleNotice.Size = new System.Drawing.Size(433, 38); this.lbGoogleNotice.TabIndex = 18; - this.lbGoogleNotice.Text = "Currently the Google web service does not require a license key to operate!\r\nAcco" + - "rdingly it is recommended to use all of the seven working lyric sites."; + this.lbGoogleNotice.Text = "As of December 5, 2006, Google are no longer issuing new API keys for the SOAP Se" + + "arch API. Users with existing SOAP Search API keys will not be affected.\r\n"; // // labelPluginBannerHint // @@ -980,7 +968,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(529, 566); + this.ClientSize = new System.Drawing.Size(530, 562); this.ControlBox = false; this.Controls.Add(this.btClose); this.Controls.Add(this.tabControl); Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs 2007-01-29 16:38:44 UTC (rev 41) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs 2007-01-29 21:07:30 UTC (rev 42) @@ -118,21 +118,21 @@ { try { - tbLicenseKey1.Text = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey1", ""); + tbLicenseKey1.Text = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey1", "zhQlW3ZQFHLE2dibwGRcpcDJvThQ/TTU"); tbLicenseKey2.Text = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey2", ""); tbLicenseKey3.Text = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey3", ""); tbLicenseKey4.Text = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey4", ""); tbLicenseKey5.Text = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey5", ""); lbLimit.Text = xmlreader.GetValueAsString("myLyrics", "limit", "100"); - cbSing365.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSing365", "True")).ToString().Equals("True") ? true : false; + cbSing365.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSing365", "False")).ToString().Equals("True") ? true : false; cbLyricsHosting.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsHosting", "False")).ToString().Equals("True") ? true : false; - cbLyricsMania.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsMania", "True")).ToString().Equals("True") ? true : false; - cbSongMeaning.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSongMeaning", "True")).ToString().Equals("True") ? true : false; - cbLyricsFreak.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsFreak", "True")).ToString().Equals("True") ? true : false; + cbLyricsMania.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsMania", "False")).ToString().Equals("True") ? true : false; + cbSongMeaning.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useSongMeaning", "False")).ToString().Equals("True") ? true : false; + cbLyricsFreak.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsFreak", "False")).ToString().Equals("True") ? true : false; cbMMMD.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useMMMD", "False")).ToString().Equals("True") ? true : false; - cbLeosLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLeosLyrics", "True")).ToString().Equals("True") ? true : false; - cbLyrics007.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; + cbLeosLyrics.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLeosLyrics", "False")).ToString().Equals("True") ? true : false; + cbLyrics007.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "False")).ToString().Equals("True") ? true : false; cbLyricWiki.Checked = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; if (Setup.IsMember("Sing365") == false) @@ -140,7 +140,7 @@ cbSing365.Checked = false; cbSing365.Enabled = false; } - if (Setup.IsMember("LyricsHostring") == false) + if (Setup.IsMember("LyricsHosting") == false) { cbLyricsHosting.Checked = false; cbLyricsHosting.Enabled = false; @@ -472,6 +472,7 @@ } else { + lc.NoMoreValidLicenseKeys = true; ThreadFinished = new String[] { m_artist, m_track, "The search has ended due to no more valid license keys entries today.", "" }; } } @@ -568,7 +569,7 @@ if (cbLyricsFreak.Checked) sitesToSearch.Add("LyricsFreak"); if (cbSongMeaning.Checked) sitesToSearch.Add("SongMeanings"); if (cbMMMD.Checked) sitesToSearch.Add("MusicMadeMe"); - if (cbLyricsHosting.Checked) sitesToSearch.Add("LyricsHostring"); + if (cbLyricsHosting.Checked) sitesToSearch.Add("LyricsHosting"); return (string[])sitesToSearch.ToArray("".GetType()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |