Added initial voice work search provider logic.

This commit is contained in:
2025-08-31 01:26:38 -04:00
parent 2785566801
commit 3d0b2ed31d
29 changed files with 656 additions and 58 deletions

View File

@@ -0,0 +1,8 @@
namespace JSMR.Application.Common;
public enum AIGeneration
{
None = 0,
Partial = 1,
Full = 2
}

View File

@@ -0,0 +1,8 @@
namespace JSMR.Application.Common;
public enum AgeRating
{
AllAges = 1,
R15 = 2,
R18 = 3
}

View File

@@ -0,0 +1,10 @@
namespace JSMR.Application.Common;
public enum Locale
{
Japanese,
English,
ChineseSimplified,
ChineseTraditional,
Korean
}

View File

@@ -0,0 +1,9 @@
namespace JSMR.Application.Common;
public enum VoiceWorkStatus
{
Available = 0,
Upcoming = 1,
NewRelease = 2,
NewAndUpcoming = 3
}

View File

@@ -1,6 +1,5 @@
using JSMR.Application.Tags.Commands.SetEnglishName;
using JSMR.Application.Tags.Commands.UpdateTagStatus;
using JSMR.Application.VoiceWorks.Search;
using Microsoft.Extensions.DependencyInjection;
namespace JSMR.Application.DI;

View File

@@ -1,5 +1,4 @@
using JSMR.Application.Common.Search;
using JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Ports;

View File

@@ -0,0 +1,8 @@
namespace JSMR.Application.VoiceWorks.Queries.Search;
public enum CircleStatus
{
NotBlacklisted,
Favorited,
Blacklisted
}

View File

@@ -0,0 +1,9 @@
namespace JSMR.Application.VoiceWorks.Queries.Search;
public enum CreatorStatus
{
NotBlacklisted = 1,
FavoriteExcludeBlacklist = 2,
FavoriteIncludeBlacklist = 3,
Blacklisted = 4,
}

View File

@@ -0,0 +1,8 @@
using JSMR.Application.Common.Search;
namespace JSMR.Application.VoiceWorks.Queries.Search;
public interface IVoiceWorkSearchProvider : ISearchProvider<VoiceWorkSearchResult, VoiceWorkSearchCriteria, VoiceWorkSortField>
{
}

View File

@@ -0,0 +1,7 @@
namespace JSMR.Application.VoiceWorks.Queries.Search;
public enum SaleStatus
{
Available = 0,
Upcoming = 2,
}

View File

@@ -1,8 +1,7 @@
using JSMR.Application.Common.Caching;
using JSMR.Application.VoiceWorks.Ports;
using JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Search;
namespace JSMR.Application.VoiceWorks.Queries.Search;
//public sealed class SearchVoiceWorksHandler(IVoiceWorkReader reader, ICache cache)
//{

View File

@@ -1,6 +1,5 @@
using JSMR.Application.Common.Search;
using JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Search;
namespace JSMR.Application.VoiceWorks.Queries.Search;
public sealed record SearchVoiceWorksRequest(SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField> Options);

View File

@@ -0,0 +1,3 @@
namespace JSMR.Application.VoiceWorks.Queries.Search;
public sealed record SearchVoiceWorksResponse(VoiceWorkSearchResults Results);

View File

@@ -0,0 +1,9 @@
namespace JSMR.Application.VoiceWorks.Queries.Search;
public enum TagStatus
{
NotBlacklisted = 1,
FavoriteExcludeBlacklist = 2,
FavoriteIncludeBlacklist = 3,
Blacklisted = 4,
}

View File

@@ -1,27 +1,26 @@
using JSMR.Application.Common;
namespace JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Queries.Search;
public class VoiceWorkSearchCriteria
{
public string? Keywords { get; init; }
public string? Title { get; init; }
public string? Circle { get; init; }
//public SaleStatus SaleStatus { get; init; }
//public CircleStatus CircleStatus { get; init; }
//public TagStatus TagStatus { get; init; }
//public CreatorStatus CreatorStatus { get; init; }
public SaleStatus? SaleStatus { get; init; }
public CircleStatus? CircleStatus { get; init; }
public TagStatus? TagStatus { get; init; }
public CreatorStatus? CreatorStatus { get; init; }
public int[] TagIds { get; init; } = [];
public bool IncludeAllTags { get; init; }
public int[] CreatorIds { get; init; } = [];
public bool IncludeAllCreators { get; init; }
//public VoiceWorkSort Sort { get; init; }
//public VoiceWorkLanguage Language { get; init; }
public Locale Locale { get; init; } = Locale.Japanese;
public DateTime? ReleaseDateStart { get; init; }
public DateTime? ReleaseDateEnd { get; init; }
//public List<AgeRating> AgeRatings { get; init; }
public AgeRating[] AgeRatings { get; init; } = [];
public Language[] SupportedLanguages { get; init; } = [];
//public List<AIGeneration> AIGenerationOptions { get; init; }
public AIGeneration[] AIGenerationOptions { get; init; } = [];
public bool ShowFavoriteVoiceWorks { get; init; }
public bool ShowInvalidVoiceWorks { get; init; }
public int? MinDownloads { get; init; }

View File

@@ -1,6 +1,6 @@
using JSMR.Application.Common.Search;
namespace JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Queries.Search;
//public record VoiceWorkSearchOptions : SearchOptions<VoiceWorkSearchCriteria, VoiceWorkSortField>
//{

View File

@@ -0,0 +1,44 @@
using JSMR.Application.Common;
namespace JSMR.Application.VoiceWorks.Queries.Search;
public record VoiceWorkSearchResult
{
public int VoiceWorkId { get; init; }
public required string ProductId { get; init; }
public string? OriginalProductId { get; init; }
public string? Description { get; init; }
public required string ProductName { get; init; }
public required string ProductUrl { get; init; }
public bool HasImage { get; init; }
public required string Maker { get; init; }
public required string MakerId { get; init; }
public DateTime? ExpectedDate { get; init; }
public DateTime? SalesDate { get; init; }
public DateTime? PlannedReleaseDate { get; init; }
public int? Downloads { get; init; }
public int? WishlistCount { get; init; }
public byte? StarRating { get; init; }
public int? Votes { get; init; }
public bool HasTrial { get; init; }
public bool HasChobit { get; init; }
public AgeRating Rating { get; init; }
public bool Favorite { get; init; }
public byte Status { get; init; }
public byte SubtitleLanguage { get; init; }
public bool? IsValid { get; init; }
public VoiceWorkTagItem[] Tags { get; set; } = [];
public VoiceWorkCreatorItem[] Creators { get; set; } = [];
}
public class VoiceWorkTagItem
{
public int TagId { get; set; }
public required string Name { get; set; }
}
public class VoiceWorkCreatorItem
{
public int CreatorId { get; set; }
public required string Name { get; set; }
}

View File

@@ -0,0 +1,8 @@
using JSMR.Application.Common.Search;
namespace JSMR.Application.VoiceWorks.Queries.Search;
public record VoiceWorkSearchResults : SearchResult<VoiceWorkSearchResult>
{
}

View File

@@ -0,0 +1,10 @@
namespace JSMR.Application.VoiceWorks.Queries.Search;
public enum VoiceWorkSortField
{
ReleaseDate,
Downloads,
WishlistCount,
SalesToWishlistRatio,
StarRating
}

View File

@@ -1,8 +0,0 @@
using JSMR.Application.Common.Search;
namespace JSMR.Application.VoiceWorks.Search.Contracts;
public record VoiceWorkSearchResults : SearchResult<object>
{
}

View File

@@ -1,11 +0,0 @@
namespace JSMR.Application.VoiceWorks.Search.Contracts;
public enum VoiceWorkSortField
{
ReleaseDateNewToOld,
ReleaseDateOldToNew,
BestSelling,
MostWishedFor,
SalesToWishlistRatio,
StarRating
}

View File

@@ -1,5 +0,0 @@
using JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Search;
public sealed record SearchVoiceWorksResponse(VoiceWorkSearchResults Results);