Example #1
0
        protected override void StartInternal(Song song)
        {
            this.GetFetchRequestData(song).Status = LyricsFetchStatus.Fetching;

            LyricsFetcher fetcher = new LyricsFetcher();

            fetcher.Sources      = this.Sources;
            fetcher.StatusEvent += new EventHandler <LyricsFetchStatusEventArgs>(fetcher_StatusEvent);

            Thread thread = new Thread(new ParameterizedThreadStart(fetcher.FetchSongLyrics));

            thread.IsBackground = true;
            thread.Start(song);
        }
        public void TestLyricsFetch()
        {
            LyricsFetcher lf = new LyricsFetcher();
            lf.Sources.Add(new LyricsSourceLyrdb());
            lf.Sources.Add(new LyricsSourceLyricsFly());

            lf.StatusEvent += new EventHandler<LyricsFetchStatusEventArgs>(lf_StatusEvent);

            List<Song> songs = this.GetSongs();

            foreach (Song s in songs)
                Assert.IsNull(s.Lyrics);

            foreach (Song s in songs)
                lf.FetchSongLyrics(s);

            foreach (Song s in songs)
                Assert.AreNotEqual("", s.Lyrics);
        }
        protected override void StartInternal(Song song)
        {
            this.GetFetchRequestData(song).Status = LyricsFetchStatus.Fetching;

            LyricsFetcher fetcher = new LyricsFetcher();
            fetcher.Sources = this.Sources;
            fetcher.StatusEvent += new EventHandler<LyricsFetchStatusEventArgs>(fetcher_StatusEvent);

            Thread thread = new Thread(new ParameterizedThreadStart(fetcher.FetchSongLyrics));
            thread.IsBackground = true;
            thread.Start(song);
        }