예제 #1
0
        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 };
        }
예제 #2
0
        public ActionResult <SongInfoDto> GetSongInfoById(int id,
                                                          bool includeAlbum = false)
        {
            SongInfoDto songInfoDto = _songInfoService
                                      .GetSongInfoById(id, includeAlbum)
                                      .ToDto();

            SetBlobProperties(songInfoDto);
            return(new ActionResult <SongInfoDto>(songInfoDto));
        }
예제 #3
0
        public SongInfo AddSongInfo(SongInfoDto songInfoDto)
        {
            SongInfo songInfo = SongInfo.ToEntity(songInfoDto);

            return(_songInfoGenericRepository.Add(songInfo));
        }
예제 #4
0
 public ActionResult <bool> SongPlayed([FromBody] SongInfoDto songInfo)
 {
     return(new ActionResult <bool>(
                _songInfoService.SongPlayed(songInfo.Id)));
 }
예제 #5
0
 public ActionResult <SongInfoDto> AddSongInfo(SongInfoDto songInfo)
 {
     return(new ActionResult <SongInfoDto>(
                _songInfoService.AddSongInfo(songInfo).ToDto()));
 }