Updated scanner logic, and added initial scanner tests.
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using JSMR.Application.Circles.Queries.GetCreators;
|
||||
using JSMR.Application.Circles.Queries.GetTags;
|
||||
using JSMR.Application.Circles.Queries.Search;
|
||||
using JSMR.Application.Common;
|
||||
using JSMR.Application.Common.Caching;
|
||||
using JSMR.Application.Creators.Ports;
|
||||
using JSMR.Application.Creators.Queries.Search.Ports;
|
||||
using JSMR.Application.Integrations.Ports;
|
||||
using JSMR.Application.Scanning.Ports;
|
||||
using JSMR.Application.Tags.Ports;
|
||||
using JSMR.Application.Tags.Queries.Search.Ports;
|
||||
using JSMR.Application.VoiceWorks.Ports;
|
||||
@@ -17,6 +19,7 @@ using JSMR.Infrastructure.Data.Repositories.Tags;
|
||||
using JSMR.Infrastructure.Data.Repositories.VoiceWorks;
|
||||
using JSMR.Infrastructure.Http;
|
||||
using JSMR.Infrastructure.Integrations.DLSite;
|
||||
using JSMR.Infrastructure.Scanning;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace JSMR.Infrastructure.DI;
|
||||
@@ -32,6 +35,8 @@ public static class InfrastructureServiceCollectionExtensions
|
||||
services.AddScoped<IVoiceWorkSearchProvider, VoiceWorkSearchProvider>();
|
||||
services.AddScoped<IVoiceWorkFullTextSearch, MySqlVoiceWorkFullTextSearch>();
|
||||
services.AddScoped<IVoiceWorkWriter, VoiceWorkWriter>();
|
||||
services.AddKeyedScoped<IVoiceWorksScanner, JapaneseVoiceWorksScanner>(Locale.Japanese);
|
||||
services.AddKeyedScoped<IVoiceWorksScanner, EnglishVoiceWorksScanner>(Locale.English);
|
||||
|
||||
services.AddScoped<ITagSearchProvider, TagSearchProvider>();
|
||||
services.AddScoped<ITagWriter, TagWriter>();
|
||||
@@ -42,6 +47,11 @@ public static class InfrastructureServiceCollectionExtensions
|
||||
services.AddSingleton<ICache, MemoryCacheAdapter>();
|
||||
services.AddSingleton<ISpamCircleCache, SpamCircleCache>();
|
||||
|
||||
services.AddHttpClient<IHttpService, HttpService>(client =>
|
||||
{
|
||||
client.DefaultRequestHeaders.UserAgent.ParseAdd("JSMR/1.0");
|
||||
});
|
||||
|
||||
services.AddScoped<IHttpService, HttpService>();
|
||||
services.AddScoped<IHtmlLoader, HtmlLoader>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user