Exemplo n.º 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 };
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        public SongInfo AddSongInfo(SongInfoDto songInfoDto)
        {
            SongInfo songInfo = SongInfo.ToEntity(songInfoDto);

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