diff --git a/JSMR.Api/Dockerfile b/JSMR.Api/Dockerfile index cc1b42e..9da7553 100644 --- a/JSMR.Api/Dockerfile +++ b/JSMR.Api/Dockerfile @@ -1,5 +1,5 @@ # --- Build stage --- -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src # copy solution + project files first (for caching) @@ -16,7 +16,7 @@ COPY . . RUN dotnet publish JSMR.Api/JSMR.Api.csproj -c Release -o /app/publish --no-restore # --- Runtime stage --- -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime WORKDIR /app COPY --from=build /app/publish ./ ENV ASPNETCORE_URLS=http://+:8080 diff --git a/JSMR.Api/JSMR.Api.csproj b/JSMR.Api/JSMR.Api.csproj index e8265ce..f6f8aba 100644 --- a/JSMR.Api/JSMR.Api.csproj +++ b/JSMR.Api/JSMR.Api.csproj @@ -1,17 +1,17 @@  - net9.0 + net10.0 enable enable 35cebc06-af6a-44cf-aa71-ecdaf1edc82b - + - - + + diff --git a/JSMR.Application/JSMR.Application.csproj b/JSMR.Application/JSMR.Application.csproj index 9114e16..9f51604 100644 --- a/JSMR.Application/JSMR.Application.csproj +++ b/JSMR.Application/JSMR.Application.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable @@ -11,8 +11,8 @@ - - + + diff --git a/JSMR.Domain/JSMR.Domain.csproj b/JSMR.Domain/JSMR.Domain.csproj index 125f4c9..b760144 100644 --- a/JSMR.Domain/JSMR.Domain.csproj +++ b/JSMR.Domain/JSMR.Domain.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable diff --git a/JSMR.Infrastructure/Data/Repositories/VoiceWorks/VoiceWorkSearchProvider.cs b/JSMR.Infrastructure/Data/Repositories/VoiceWorks/VoiceWorkSearchProvider.cs index dd20a04..63fc1b9 100644 --- a/JSMR.Infrastructure/Data/Repositories/VoiceWorks/VoiceWorkSearchProvider.cs +++ b/JSMR.Infrastructure/Data/Repositories/VoiceWorks/VoiceWorkSearchProvider.cs @@ -61,7 +61,7 @@ public class VoiceWorkSearchProvider(AppDbContext context, IVoiceWorkFullTextSea } if (criteria.SupportedLanguages.Length > 0) - filteredQuery = filteredQuery.Where(x => criteria.SupportedLanguages.Contains((Language)x.VoiceWork.SubtitleLanguage)); + filteredQuery = filteredQuery.Where(x => criteria.SupportedLanguages.AsEnumerable().Contains((Language)x.VoiceWork.SubtitleLanguage)); filteredQuery = ApplyCircleStatusFilter(filteredQuery, criteria); filteredQuery = ApplyTagStatusFilter(filteredQuery, criteria); @@ -85,13 +85,13 @@ public class VoiceWorkSearchProvider(AppDbContext context, IVoiceWorkFullTextSea filteredQuery = filteredQuery.Where(x => x.VoiceWork.SalesDate <= criteria.ReleaseDateEnd.Value.ToDateTime(TimeOnly.MinValue)); if (criteria.AgeRatings.Length > 0) - filteredQuery = filteredQuery.Where(x => criteria.AgeRatings.Contains((AgeRating)x.VoiceWork.Rating)); + filteredQuery = filteredQuery.Where(x => criteria.AgeRatings.AsEnumerable().Contains((AgeRating)x.VoiceWork.Rating)); //if (criteria.SupportedLanguages.Length > 0) // filteredQuery = filteredQuery.Where(x => criteria.SupportedLanguages.Contains((Language)x.VoiceWork.SubtitleLanguage)); if (criteria.AIGenerationOptions.Length > 0) - filteredQuery = filteredQuery.Where(x => criteria.AIGenerationOptions.Contains((AIGeneration)x.VoiceWork.AIGeneration)); + filteredQuery = filteredQuery.Where(x => criteria.AIGenerationOptions.AsEnumerable().Contains((AIGeneration)x.VoiceWork.AIGeneration)); if (criteria.ShowFavoriteVoiceWorks) filteredQuery = filteredQuery.Where(x => x.VoiceWork.Favorite); diff --git a/JSMR.Infrastructure/JSMR.Infrastructure.csproj b/JSMR.Infrastructure/JSMR.Infrastructure.csproj index e72f59c..e6a6d83 100644 --- a/JSMR.Infrastructure/JSMR.Infrastructure.csproj +++ b/JSMR.Infrastructure/JSMR.Infrastructure.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable @@ -19,12 +19,12 @@ - - - - - - + + + + + + diff --git a/JSMR.Tests/JSMR.Tests.csproj b/JSMR.Tests/JSMR.Tests.csproj index d55afbb..60b932b 100644 --- a/JSMR.Tests/JSMR.Tests.csproj +++ b/JSMR.Tests/JSMR.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable false diff --git a/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderFixture.cs b/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderFixture.cs index 745dfdb..54043b5 100644 --- a/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderFixture.cs +++ b/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderFixture.cs @@ -15,11 +15,11 @@ public sealed class VoiceWorkSearchProviderFixture(MariaDbContainerFixture conta ); context.VoiceWorks.AddRange( - new() { VoiceWorkId = 1, CircleId = 1, ProductId = "RJ0000001", ProductName = "Today Sounds", Description = "An average product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 1), Downloads = 500, WishlistCount = 750, StarRating = 35 }, - new() { VoiceWorkId = 2, CircleId = 2, ProductId = "RJ0000002", ProductName = "Super Comfy ASMR", Description = "An amazing product!", Status = (byte)VoiceWorkStatus.NewRelease, SalesDate = new(2025, 1, 3), Downloads = 5000, WishlistCount = 12000, StarRating = 50, Favorite = true }, - new() { VoiceWorkId = 3, CircleId = 3, ProductId = "RJ0000003", ProductName = "Low Effort", Description = "A bad product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 2), Downloads = 50, WishlistCount = 100, StarRating = 20 }, - new() { VoiceWorkId = 4, CircleId = 1, ProductId = "RJ0000004", ProductName = "Tomorrow Sounds", Description = "A average upcoming product.", Status = (byte)VoiceWorkStatus.Upcoming, ExpectedDate = new(2025, 1, 1), WishlistCount = 300 }, - new() { VoiceWorkId = 5, CircleId = 2, ProductId = "RJ0000005", ProductName = "Super Comfy ASMR+", Description = "All your favorite sounds, plus more!", Status = (byte)VoiceWorkStatus.NewAndUpcoming, ExpectedDate = new(2025, 1, 11), PlannedReleaseDate = new(2025, 1, 13), WishlistCount = 10000 } + new() { VoiceWorkId = 1, CircleId = 1, ProductId = "RJ0000001", ProductName = "Today Sounds", Description = "An average product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 1), Downloads = 500, WishlistCount = 750, StarRating = 35, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.AllAges, AIGeneration = (byte)AIGeneration.None }, + new() { VoiceWorkId = 2, CircleId = 2, ProductId = "RJ0000002", ProductName = "Super Comfy ASMR", Description = "An amazing product!", Status = (byte)VoiceWorkStatus.NewRelease, SalesDate = new(2025, 1, 3), Downloads = 5000, WishlistCount = 12000, StarRating = 50, Favorite = true, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.AllAges, AIGeneration = (byte)AIGeneration.None }, + new() { VoiceWorkId = 3, CircleId = 3, ProductId = "RJ0000003", ProductName = "Low Effort", Description = "A bad product.", Status = (byte)VoiceWorkStatus.Available, SalesDate = new(2025, 1, 2), Downloads = 50, WishlistCount = 100, StarRating = 20, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.R18, AIGeneration = (byte)AIGeneration.Partial }, + new() { VoiceWorkId = 4, CircleId = 1, ProductId = "RJ0000004", ProductName = "Tomorrow Sounds", Description = "A average upcoming product.", Status = (byte)VoiceWorkStatus.Upcoming, ExpectedDate = new(2025, 1, 1), WishlistCount = 300, SubtitleLanguage = (byte)Language.Japanese, Rating = (byte)AgeRating.AllAges, AIGeneration = (byte)AIGeneration.None }, + new() { VoiceWorkId = 5, CircleId = 2, ProductId = "RJ0000005", ProductName = "Super Comfy ASMR+", Description = "All your favorite sounds, plus more!", Status = (byte)VoiceWorkStatus.NewAndUpcoming, ExpectedDate = new(2025, 1, 11), PlannedReleaseDate = new(2025, 1, 13), WishlistCount = 10000, SubtitleLanguage = (byte)Language.English, Rating = (byte)AgeRating.R15, AIGeneration = (byte)AIGeneration.None } ); context.Tags.AddRange( diff --git a/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderTests.cs b/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderTests.cs index 406dcd7..5922877 100644 --- a/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderTests.cs +++ b/JSMR.Tests/Search/VoiceWork/VoiceWorkSearchProviderTests.cs @@ -1,5 +1,6 @@ using JSMR.Application.Common.Search; using JSMR.Application.VoiceWorks.Queries.Search; +using JSMR.Domain.Enums; using JSMR.Infrastructure.Data; using JSMR.Infrastructure.Data.Repositories.VoiceWorks; using Shouldly; @@ -651,4 +652,61 @@ public class VoiceWorkSearchProviderTests(VoiceWorkSearchProviderFixture fixture .Select(item => item.ProductId) .ShouldBe(["RJ0000002"]); } + + [Fact] + public async Task Filter_Language() + { + var options = new SearchOptions() + { + Criteria = new() + { + SupportedLanguages = [Language.English] + } + }; + + var result = await SearchAsync(options); + + result.Items + .OrderBy(item => item.ProductId) + .Select(item => item.ProductId) + .ShouldBe(["RJ0000005"]); + } + + [Fact] + public async Task Filter_Age_Rating() + { + var options = new SearchOptions() + { + Criteria = new() + { + AgeRatings = [AgeRating.R15] + } + }; + + var result = await SearchAsync(options); + + result.Items + .OrderBy(item => item.ProductId) + .Select(item => item.ProductId) + .ShouldBe(["RJ0000005"]); + } + + [Fact] + public async Task Filter_AI_Generation() + { + var options = new SearchOptions() + { + Criteria = new() + { + AIGenerationOptions = [AIGeneration.Partial] + } + }; + + var result = await SearchAsync(options); + + result.Items + .OrderBy(item => item.ProductId) + .Select(item => item.ProductId) + .ShouldBe(["RJ0000003"]); + } } \ No newline at end of file diff --git a/JSMR.UI.Blazor/Dockerfile b/JSMR.UI.Blazor/Dockerfile index 84f2226..adc1103 100644 --- a/JSMR.UI.Blazor/Dockerfile +++ b/JSMR.UI.Blazor/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /app COPY . . RUN dotnet publish -c Release -o out diff --git a/JSMR.UI.Blazor/JSMR.UI.Blazor.csproj b/JSMR.UI.Blazor/JSMR.UI.Blazor.csproj index cd492be..638d44e 100644 --- a/JSMR.UI.Blazor/JSMR.UI.Blazor.csproj +++ b/JSMR.UI.Blazor/JSMR.UI.Blazor.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 enable enable service-worker-assets.js @@ -11,11 +11,12 @@ - - + + - + + diff --git a/JSMR.Worker/JSMR.Worker.csproj b/JSMR.Worker/JSMR.Worker.csproj index 942f7bb..6774aff 100644 --- a/JSMR.Worker/JSMR.Worker.csproj +++ b/JSMR.Worker/JSMR.Worker.csproj @@ -2,7 +2,7 @@ Exe - net9.0 + net10.0 enable enable f4ef1bd4-0cc5-4663-8108-fbb9c9eef5ae @@ -26,9 +26,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - +