From: <sa...@us...> - 2007-11-15 18:58:51
|
Revision: 1066 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1066&view=rev Author: saamand Date: 2007-11-15 10:58:45 -0800 (Thu, 15 Nov 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2007-11-15 16:24:06 UTC (rev 1065) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsController.cs 2007-11-15 18:58:45 UTC (rev 1066) @@ -17,11 +17,13 @@ private ILyricForm m_Form; // status - private int noOfLyricsToSearch; - private int noOfLyricsSearched; - private int noOfLyricsFound; - private int noOfLyricsNotFound; + private int m_noOfLyricsToSearch; + private int m_noOfLyricsSearched; + private int m_noOfLyricsFound; + private int m_noOfLyricsNotFound; + private int m_noOfCurrentSearches; + private bool m_StopSearches; private bool m_allowAllToComplete; @@ -46,12 +48,12 @@ this.m_allowAllToComplete = allowAllToSearch; this.m_automaticUpdate = automaticUpdate; - noOfLyricsToSearch = 1; - noOfLyricsSearched = 0; - noOfLyricsFound = 0; - noOfLyricsNotFound = 0; + m_noOfLyricsToSearch = 1; + m_noOfLyricsSearched = 0; + m_noOfLyricsFound = 0; + m_noOfLyricsNotFound = 0; + m_noOfCurrentSearches = 0; - ArrayList easySitesArrayList = new ArrayList(); // If search all, then include all @@ -136,6 +138,8 @@ public void AddNewLyricSearch(string artist, string title) { + ++m_noOfCurrentSearches; + if (lyricsSites.Length > 0) { // create worker thread instance @@ -164,15 +168,15 @@ { //LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + artist + " - " + title + " - " + site + " - " +lyricFound.ToString() ); if (lyricFound) - ++noOfLyricsFound; + ++m_noOfLyricsFound; else - ++noOfLyricsNotFound; + ++m_noOfLyricsNotFound; - ++noOfLyricsSearched; + ++m_noOfLyricsSearched; - m_Form.UpdateStatus = new Object[] { noOfLyricsToSearch, noOfLyricsSearched, noOfLyricsFound, noOfLyricsNotFound }; + m_Form.UpdateStatus = new Object[] { m_noOfLyricsToSearch, m_noOfLyricsSearched, m_noOfLyricsFound, m_noOfLyricsNotFound }; - if ((noOfLyricsSearched >= noOfLyricsToSearch)) + if ((m_noOfLyricsSearched >= m_noOfLyricsToSearch)) { FinishThread(artist, title, "All songs have been searched!", site); } @@ -181,6 +185,8 @@ internal void LyricFound(String lyricStrings, String artist, String title, String site) { + --m_noOfCurrentSearches; + if (m_allowAllToComplete || m_StopSearches == false) { m_Form.LyricFound = new Object[] { lyricStrings, artist, title, site }; @@ -190,6 +196,8 @@ internal void LyricNotFound(String artist, String title, String message, String site) { + --m_noOfCurrentSearches; + if (m_allowAllToComplete || m_StopSearches == false) { m_Form.LyricNotFound = new Object[] { artist, title, message, site }; @@ -234,7 +242,12 @@ public int NoOfLyricsToSearch { - set { noOfLyricsToSearch = value; } + set { m_noOfLyricsToSearch = value; } } + + public int NoOfCurrentSearches + { + get { return m_noOfCurrentSearches; } + } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs 2007-11-15 16:24:06 UTC (rev 1065) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/EvilLabs.cs 2007-11-15 18:58:45 UTC (rev 1066) @@ -96,7 +96,7 @@ lyric = line.Replace("<br>", "\r\n").Trim(); // if warning message from Evil Labs' sql-server, then lyric isn't found - if (lyric.Contains("<b>Warning</b>")) + if (lyric.Contains("<b>Warning</b>") || lyric.Contains("type=")) { lyric = "Not found"; } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2007-11-15 16:24:06 UTC (rev 1065) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsSites/Wiki.cs 2007-11-15 18:58:45 UTC (rev 1066) @@ -17,7 +17,7 @@ public static bool Abort; LyricSearch lyricSearch ; - private string[] commonReplacementsLyricWiki = new string[16] { "<br>", "", "<BR>", "", "?d", "'d", "?s", "'s", "?t", "'t", "?v", "'v", "?e", "'e", "?r", "'r" }; + private string[] commonReplacementsLyricWiki = new string[18] { "<br>", "", "<br/>", "", "<BR>", "", "?d", "'d", "?s", "'s", "?t", "'t", "?v", "'v", "?e", "'e", "?r", "'r" }; private string[] commonRemoveFromLyricWiki = new string[2] { "[[category", "[[Category" }; public Wiki(LyricSearch lyricSearch) @@ -34,7 +34,7 @@ IAsyncResult ar = del.BeginInvoke(this.artist, this.title, null, null); - while (noOfTries < 10) + while (noOfTries < 9) { // If the user has aborted stop the search and return (false) if (Abort || lyricSearch.SearchHasEnded) @@ -121,7 +121,8 @@ } } - if (lyric.Contains("API request randomly") || lyric.Contains("Upgrading right") || lyric.Contains("LyricWiki.org")) + if (lyric.Contains("API request randomly") || lyric.Contains("Upgrading right") || lyric.Contains("LyricWiki.org") + || lyric.Contains("<!-- PUT LYRICS HERE")) { lyric = string.Empty; } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2007-11-15 16:24:06 UTC (rev 1065) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics Configuration/MyLyricsSetup.cs 2007-11-15 18:58:45 UTC (rev 1066) @@ -70,7 +70,6 @@ int m_SongsToSearch = 0; int m_LyricsFound = 0; int m_LyricsNotFound = 0; - int m_noOfCurrentlySearches = 0; // Search criteries bool m_DisregardKnownLyric = true; @@ -82,7 +81,7 @@ bool m_automaticWriteToMusicTag = true; - const int m_NoOfCurrentSearchesAllowed = 5; + const int m_NoOfCurrentSearchesAllowed = 6; int m_Limit = 100; // Collections and arrays @@ -366,7 +365,6 @@ m_EventStopThread = new ManualResetEvent(false); m_noOfMessages = 0; - m_noOfCurrentlySearches = 0; btStartBatchSearch.Enabled = false; @@ -486,7 +484,6 @@ writerLog.Write(log); writerLog.Close(); - m_noOfCurrentlySearches -= 1; progressBar.PerformStep(); this.Update(); } @@ -520,7 +517,6 @@ writerLog.Write(log); writerLog.Close(); - m_noOfCurrentlySearches -= 1; progressBar.PerformStep(); this.Update(); } @@ -769,9 +765,8 @@ else if (lc == null) return; - if (m_noOfCurrentlySearches < m_NoOfCurrentSearchesAllowed && lc.StopSearches == false) + if (lc.NoOfCurrentSearches < m_NoOfCurrentSearchesAllowed && lc.StopSearches == false) { - m_noOfCurrentlySearches += 1; string[] lyricID = (string[])lyricConfigInfosQueue.Dequeue(); lc.AddNewLyricSearch(lyricID[0], lyricID[1]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |