Beispiel #1
0
        public async Task GetDoubanLyricsTest()
        {
            var lyricsService = new LyricsService();
            var song          = new Song {
                SID = "1675427", SSID = "63fe"
            };
            var lyrics = await lyricsService.GetLyrics(song.SID, song.SSID);

            Assert.IsNotNull(lyrics);
        }
Beispiel #2
0
        private async void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Pivot.SelectedIndex != 2)
            {
                return;
            }

            var song = App.Locator.Player.CurrentQueue.Song;

            if (LyricsTextBlock.Tag as int? == song.Id)
            {
                return;
            }

            LyricsTextBlock.Tag  = song.Id;
            LyricsTextBlock.Text = "Loading...";

            var results = await _lyrcis.GetLyrics(song.Name, song.Artist.Name);

            LyricsTextBlock.Text = string.IsNullOrEmpty(results) ? "No lyrics found for this song." : results;
        }