mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
* Code cleanup, refactored FileRepository into Unit of Work. * Added AutoCloseMenu and ReaderMode user perferences to match UI * Added extra information to ChapterInfo * Build changes * Updated the readme to have open collective information and thanks to sponsors * Fixed an issue with UnitOfWork refactor and how stats was bootsrapped. Replaced stats.kavitareader with a temp url to test out redirection bug.
26 lines
886 B
C#
26 lines
886 B
C#
using System;
|
|
using API.Interfaces.Services;
|
|
using API.Services.Clients;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace API.Extensions
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddStartupTask<T>(this IServiceCollection services)
|
|
where T : class, IStartupTask
|
|
=> services.AddTransient<IStartupTask, T>();
|
|
|
|
public static IServiceCollection AddStatsClient(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
services.AddHttpClient<StatsApiClient>(client =>
|
|
{
|
|
client.BaseAddress = new Uri("https://kavitastats.majora2007.duckdns.org");
|
|
client.DefaultRequestHeaders.Add("api-key", "MsnvA2DfQqxSK5jh");
|
|
});
|
|
|
|
return services;
|
|
}
|
|
}
|
|
} |