Add project files.

This commit is contained in:
2025-08-26 09:20:13 -04:00
parent 6c6a149821
commit d2201d6f9b
118 changed files with 1924 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using JSMR.Application.Common;
namespace JSMR.Application.VoiceWorks.Search.Contracts;
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 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 DateTime? ReleaseDateStart { get; init; }
public DateTime? ReleaseDateEnd { get; init; }
//public List<AgeRating> AgeRatings { get; init; }
public Language[] SupportedLanguages { get; init; } = [];
//public List<AIGeneration> AIGenerationOptions { get; init; }
public bool ShowFavoriteVoiceWorks { get; init; }
public bool ShowInvalidVoiceWorks { get; init; }
public int? MinDownloads { get; init; }
public int? MaxDownloads { get; init; }
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,31 @@
using JSMR.Application.Common.Caching;
using JSMR.Application.VoiceWorks.Ports;
using JSMR.Application.VoiceWorks.Search.Contracts;
namespace JSMR.Application.VoiceWorks.Search;
//public sealed class SearchVoiceWorksHandler(IVoiceWorkReader reader, ICache cache)
//{
// //public async Task<SearchVoiceWorksResponse> HandleAsync(SearchVoiceWorksRequest request, CancellationToken cancellationToken)
// //{
// // VoiceWorkSearchOptions searchOptions = request.Options;
// // string cacheKey = $"vw:{searchOptions.GetHashCode()}";
// // VoiceWorkSearchResults? cachedResults = await cache.GetAsync<VoiceWorkSearchResults>(cacheKey, cancellationToken);
// // if (cachedResults != null)
// // return new SearchVoiceWorksResponse(cachedResults);
// // VoiceWorkSearchResults results = await reader.SearchAsync(searchOptions, cancellationToken);
// // CacheEntryOptions cacheEntryOptions = new()
// // {
// // SlidingExpiration = TimeSpan.FromMinutes(10)
// // };
// // await cache.SetAsync(cacheKey, results, cacheEntryOptions, cancellationToken);
// // return new SearchVoiceWorksResponse(results);
// //}
//}

View File

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

View File

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