Added initial voice work search provider logic.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
using JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Ports;
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public enum CircleStatus
|
||||
{
|
||||
NotBlacklisted,
|
||||
Favorited,
|
||||
Blacklisted
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public enum CreatorStatus
|
||||
{
|
||||
NotBlacklisted = 1,
|
||||
FavoriteExcludeBlacklist = 2,
|
||||
FavoriteIncludeBlacklist = 3,
|
||||
Blacklisted = 4,
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public interface IVoiceWorkSearchProvider : ISearchProvider<VoiceWorkSearchResult, VoiceWorkSearchCriteria, VoiceWorkSortField>
|
||||
{
|
||||
|
||||
}
|
||||
7
JSMR.Application/VoiceWorks/Queries/Search/SaleStatus.cs
Normal file
7
JSMR.Application/VoiceWorks/Queries/Search/SaleStatus.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public enum SaleStatus
|
||||
{
|
||||
Available = 0,
|
||||
Upcoming = 2,
|
||||
}
|
||||
@@ -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)
|
||||
//{
|
||||
@@ -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);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public sealed record SearchVoiceWorksResponse(VoiceWorkSearchResults Results);
|
||||
9
JSMR.Application/VoiceWorks/Queries/Search/TagStatus.cs
Normal file
9
JSMR.Application/VoiceWorks/Queries/Search/TagStatus.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public enum TagStatus
|
||||
{
|
||||
NotBlacklisted = 1,
|
||||
FavoriteExcludeBlacklist = 2,
|
||||
FavoriteIncludeBlacklist = 3,
|
||||
Blacklisted = 4,
|
||||
}
|
||||
@@ -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; }
|
||||
@@ -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>
|
||||
//{
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public record VoiceWorkSearchResults : SearchResult<VoiceWorkSearchResult>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace JSMR.Application.VoiceWorks.Queries.Search;
|
||||
|
||||
public enum VoiceWorkSortField
|
||||
{
|
||||
ReleaseDate,
|
||||
Downloads,
|
||||
WishlistCount,
|
||||
SalesToWishlistRatio,
|
||||
StarRating
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using JSMR.Application.Common.Search;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
public record VoiceWorkSearchResults : SearchResult<object>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
public enum VoiceWorkSortField
|
||||
{
|
||||
ReleaseDateNewToOld,
|
||||
ReleaseDateOldToNew,
|
||||
BestSelling,
|
||||
MostWishedFor,
|
||||
SalesToWishlistRatio,
|
||||
StarRating
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
using JSMR.Application.VoiceWorks.Search.Contracts;
|
||||
|
||||
namespace JSMR.Application.VoiceWorks.Search;
|
||||
|
||||
public sealed record SearchVoiceWorksResponse(VoiceWorkSearchResults Results);
|
||||
Reference in New Issue
Block a user