private void SetBlobProperties(SongInfoDto songDto) { songDto.BlobFileReference = _blobStorageService.GetBlobFileUriLocation(songDto.RelativePath); songDto.AlbumImagePath = songDto.AlbumImagePath != null && songDto.AlbumImagePath.Any() ? _blobStorageService.GetAlbumImagesUrls(songDto.AlbumImagePath) : new[] { _blobStorageService.DefaultAlbumLogoImageUrl }; }
public ActionResult <SongInfoDto> GetSongInfoById(int id, bool includeAlbum = false) { SongInfoDto songInfoDto = _songInfoService .GetSongInfoById(id, includeAlbum) .ToDto(); SetBlobProperties(songInfoDto); return(new ActionResult <SongInfoDto>(songInfoDto)); }
public SongInfo AddSongInfo(SongInfoDto songInfoDto) { SongInfo songInfo = SongInfo.ToEntity(songInfoDto); return(_songInfoGenericRepository.Add(songInfo)); }
public ActionResult <bool> SongPlayed([FromBody] SongInfoDto songInfo) { return(new ActionResult <bool>( _songInfoService.SongPlayed(songInfo.Id))); }
public ActionResult <SongInfoDto> AddSongInfo(SongInfoDto songInfo) { return(new ActionResult <SongInfoDto>( _songInfoService.AddSongInfo(songInfo).ToDto())); }