Пример #1
0
        public async Task <IActionResult> Keyword(string pSearchKeyword)
        {
            if (string.IsNullOrEmpty(pSearchKeyword))
            {
                return(View(new SearchResultDto()));
            }

            if (pSearchKeyword.Length < 2)
            {
                return(View(new SearchResultDto()));
            }


            AbstractSearchResultDto songsList = new SearchResultDto();

            songsList = await _youtubeSearch.SearchListByKeyword(pSearchKeyword);

            songsList.TagsList = await _tagEntity.GetRandomTags();

            return(View(songsList));
        }
        public async Task <IActionResult> SearchSong(string pSongName)
        {
            if (String.IsNullOrEmpty(pSongName))
            {
                return(BadRequest());
            }

            AbstractSearchResultDto musicSearchModel;

            musicSearchModel = await _youtubeSearch.SearchListByKeyword(pSongName);

            return(Ok(musicSearchModel));
        }