コード例 #1
0
ファイル: ManualUpdate.cs プロジェクト: steveoams/iLyrics
 private SearchResult FetchLyrics(string artist, string song, out string lyrics)
 {
     if (LyricService.Exists(artist, song) == SearchResult.NotFound)
     {
         lyrics = string.Empty;
         return(SearchResult.NotFound);
     }
     return(LyricService.GetLyrics(artist, song, out lyrics));
 }
コード例 #2
0
        public IActionResult Get(string artist, string title)
        {
            var url = $"{artist}/{title}";

            var response = _service.GetLyrics(url);

            if (response.Result == null)
            {
                return(NotFound());
            }

            return(Ok(response));
        }
コード例 #3
0
        private SearchResult FetchLyrics(IITFileOrCDTrack currentTrack, string artist, string song, int index)
        {
            if (_lyricService.Exists(artist, song) == SearchResult.NotFound)
            {
                return(SearchResult.NotFound);
            }

            string lyrics;
            var    result = _lyricService.GetLyrics(artist, song, out lyrics);

            if (result == SearchResult.Found)
            {
                currentTrack.Lyrics = lyrics;
            }

            return(result);
        }