Esempio n. 1
0
 public IActionResult DownloadToOneDrive([FromBody] DownloadToOneDriveRequest request)
 {
     try
     {
         _searchService.DownloadSongToOneDrive(request.SongId);
         return(Ok());
     }
     catch (Exception e)
     {
         _logger.LogError(e, "Error in DownloadToOneDrive");
         return(BadRequest());
     }
 }
Esempio n. 2
0
        public async Task <bool> DownloadToOneDrive(DownloadToOneDriveRequest request)
        {
            try
            {
                var result = await _searchClient.PutAsync("DownloadToOneDrive", HttpClientHelper.GetJsonData(request));

                return(result.IsSuccessStatusCode);
            }
            catch (Exception e)
            {
                return(HttpClientHelper.LogError <bool>(_logger, e, new object[] { request.SongId }));
            }
        }