From 636f0d7b0614be58337ee0e7cf57cc41daf8d464 Mon Sep 17 00:00:00 2001 From: Foqsz Date: Fri, 31 Oct 2025 09:30:28 -0300 Subject: [PATCH 1/3] feat: update packages --- .../MyMusicLibrary.API/MyMusicLibrary.API.csproj | 6 +++--- .../MyMusicLibrary.Application.csproj | 4 ++-- .../MyMusicLibrary.Infrastructure.csproj | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj b/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj index d98a38c..eb13dc1 100644 --- a/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj +++ b/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj b/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj index f90e4f1..1697a40 100644 --- a/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj +++ b/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj @@ -13,8 +13,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj b/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj index 37984aa..b7c11a9 100644 --- a/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj +++ b/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj @@ -12,16 +12,16 @@ - - + + - - - + + + From a4ed23c0825d9046f7d5ba7fd1420b64994c6dad Mon Sep 17 00:00:00 2001 From: Foqsz Date: Fri, 31 Oct 2025 09:30:47 -0300 Subject: [PATCH 2/3] feat: new exception message --- .../ResourceMessagesException.Designer.cs | 9 +++++++++ .../ResourceMessagesException.pt-BR.resx | 3 +++ .../ResourceMessagesException.resx | 3 +++ 3 files changed, 15 insertions(+) diff --git a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs index 0432da0..c8f07ea 100644 --- a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs +++ b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs @@ -222,6 +222,15 @@ public static string MUSIC_NOT_BELONG_TO_USER { } } + /// + /// Looks up a localized string similar to URL does not exist.. + /// + public static string MUSIC_URL_NOT_FOUND { + get { + return ResourceManager.GetString("MUSIC_URL_NOT_FOUND", resourceCulture); + } + } + /// /// Looks up a localized string similar to Name cannot be empty.. /// diff --git a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx index 3c275de..386c399 100644 --- a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx +++ b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx @@ -216,4 +216,7 @@ Você não tem permissão para acessar. + + URL não encontrada. + \ No newline at end of file diff --git a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx index c278502..16db393 100644 --- a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx +++ b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx @@ -216,4 +216,7 @@ You do not have permission to access. + + URL does not exist. + \ No newline at end of file From a31f5965d800cd21bc828aeba8229f5b81992d89 Mon Sep 17 00:00:00 2001 From: Foqsz Date: Fri, 31 Oct 2025 09:31:07 -0300 Subject: [PATCH 3/3] feat: ne validation get musicId --- .../UseCases/Music/GetById/GetMusicByIdUseCase.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs b/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs index f283a74..d68fdcd 100644 --- a/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs +++ b/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs @@ -36,6 +36,9 @@ public async Task Execute(long id) var musicUrl = await _s3Service.GetFileUrl(music.MusicKey!); + if(musicUrl is null) + throw new NotFoundException(ResourceMessagesException.MUSIC_URL_NOT_FOUND); + var musicMapper = _mapper.Map(music); musicMapper.UrlMusicS3 = musicUrl.url;