Esempio n. 1
0
 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));
 }
        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));
        }
Esempio n. 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);
        }