Exemplo n.º 1
0
        private void LyricFoundMethod(String lyricStrings, String artist, String title, String site, int row)
        {
            foreach (ListViewItem lvi in lvSelectedSongs.Items)
            {
                if (lvi.Text.Equals(artist) && lvi.SubItems[1].Text.Equals(title))
                {
                    if (lvi.SubItems[3].Text.Equals("miss"))
                    {
                        MessageBox.Show("This is an error and should not be able to happen!");
                    }

                    lvi.ImageIndex       = 0;
                    lvi.SubItems[2].Text = "LyricsDB";
                    lvi.SubItems[3].Text = "OK";
                    lvi.EnsureVisible();

                    var capArtist = LyricUtil.CapatalizeString(artist);
                    var capTitle  = LyricUtil.CapatalizeString(title);

                    DatabaseUtil.WriteToLyricsDatabase(MyLyricsUtils.LyricsDB, MyLyricsUtils.LyricsMarkedDB, capArtist, capTitle, lyricStrings, site);
                    DatabaseUtil.SerializeLyricDB();

                    if (!site.Equals("music tag"))
                    {
                        if (SettingManager.GetParamAsBool(SettingManager.AutomaticWriteToMusicTag, true))
                        {
                            TagReaderUtil.WriteLyrics(capArtist, capTitle, lyricStrings);
                        }
                    }

                    _mNoOfCurrentlySearches -= 1;
                    ++_mNoOfSearchesCompleted;

                    break;
                }
            }

            //lvSelectedSongs.Update();
        }
Exemplo n.º 2
0
        private void lyricFoundMethod(String lyricStrings, String artist, String track, String site)
        {
            m_LyricText = lyricStrings;
            m_artist    = artist;
            m_track     = track;

            --m_SongsToSearch;
            lbSongsToSearch2.Text = m_SongsToSearch.ToString();

            m_SongsWithLyric += 1;
            m_LyricsFound    += 1;

            lbSongsWithLyric2.Text = m_SongsWithLyric.ToString();
            lbLyricsFound2.Text    = m_LyricsFound.ToString();

            string capArtist = LyricUtil.CapatalizeString(m_artist);
            string capTitle  = LyricUtil.CapatalizeString(m_track);

            DatabaseUtil.WriteToLyricsDatabase(MyLyricsSettings.LyricsDB, MyLyricsSettings.LyricsMarkedDB, capArtist, capTitle, lyricStrings, site);

            StreamReader sr = File.OpenText(logFullFileName);

            log = sr.ReadToEnd();
            sr.Close();
            string logText = capArtist + " - " + capTitle + " has a match at " + site + ".\r\n";

            log += DateTime.Now.ToString() + " " + logText;
            lbLastActivity2.Text = logText;
            System.IO.StreamWriter writerLog = new System.IO.StreamWriter(logFullFileName);
            writerLog.Write(log);
            writerLog.Close();

            m_noOfCurrentlySearches -= 1;
            progressBar.PerformStep();
            this.Update();
        }
Exemplo n.º 3
0
        private void LyricFoundMethod(String lyricStrings, String artist, String track, String site, int row)
        {
            _mArtist = artist;
            _mTrack  = track;

            --_mSongsToSearch;
            lbSongsToSearch2.Text = _mSongsToSearch.ToString(CultureInfo.InvariantCulture);

            _mSongsWithLyric += 1;
            _mLyricsFound    += 1;

            IncrementLyricsFoundBySite(site);

            lbSongsWithLyric2.Text = _mSongsWithLyric.ToString(CultureInfo.InvariantCulture);
            lbLyricsFound2.Text    = _mLyricsFound.ToString(CultureInfo.InvariantCulture);

            var capArtist = LyricUtil.CapatalizeString(_mArtist);
            var capTitle  = LyricUtil.CapatalizeString(_mTrack);

            DatabaseUtil.WriteToLyricsDatabase(MyLyricsUtils.LyricsDB, MyLyricsUtils.LyricsMarkedDB, capArtist, capTitle, lyricStrings, site);
            lbMessage.Text = GetLyricsFoundBySite();

            if (!site.Equals("music tag") && _mAutomaticWriteToMusicTag)
            {
                TagReaderUtil.WriteLyrics(capArtist, capTitle, lyricStrings);
            }

            var logText = capArtist + " - " + capTitle + " has a match at " + site;

            lbLastActivity2.Text = logText;

            BatchLogger.Info("HIT!: {0}", logText);

            progressBar.PerformStep();
            Update();
        }