mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
* Added --card-list-item-bg-color for the card list items * Updated the card list item progress to match how cards render * Implemented the ability to configure how many backups are retained. * Fixed a bug where odd jump keys could cause a bad index error for jump bar * Commented out more code for the pagination route if we go with that. * Reverted a move of DisableConcurrentExecution to interface, as it seems to not work there. * Updated manga format utility code to pipes * Fixed bulk selection on series detail page * Fixed bulk selection on all other pages * Changed card item to OnPush * Updated image component to OnPush * Updated Series Card to OnPush * Updated Series Detail to OnPush * Lots of changes here. Integrated parentscroll support on card detail layout. Added jump bar (custom js implementation) on collection, reading list and all series pages. Updated UserParams to default to no pagination. Lots of cleanup all around * Updated some notes on a module use * Some code cleanup * Fixed up a broken test due to the mapper not being configured in the test. * Applied TabID pattern to edit collection tags * Applied css from series detail to collection detail page to remove double scrollbar * Implemented the ability to sort by Time To Read. * Throw an error to the UI when we extract an archive and it contains invalid characters in the filename for the Server OS. * Tweaked how the page scrolls for jumpbar on collection detail. We will have to polish another release * Cleaned up the styling on directory picker * Put some code in but it doesn't work for scroll to top on virtual scrolling. I'll do it later. * Fixed a container bug
85 lines
3.5 KiB
C#
85 lines
3.5 KiB
C#
using System.IO.Abstractions;
|
|
using API.Data;
|
|
using API.Helpers;
|
|
using API.Services;
|
|
using API.Services.Tasks;
|
|
using API.Services.Tasks.Metadata;
|
|
using API.SignalR;
|
|
using API.SignalR.Presence;
|
|
using Kavita.Common;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace API.Extensions
|
|
{
|
|
public static class ApplicationServiceExtensions
|
|
{
|
|
public static void AddApplicationServices(this IServiceCollection services, IConfiguration config, IWebHostEnvironment env)
|
|
{
|
|
services.AddAutoMapper(typeof(AutoMapperProfiles).Assembly);
|
|
|
|
services.AddScoped<IUnitOfWork, UnitOfWork>();
|
|
services.AddScoped<IDirectoryService, DirectoryService>();
|
|
services.AddScoped<ITokenService, TokenService>();
|
|
services.AddScoped<IFileSystem, FileSystem>();
|
|
services.AddScoped<IFileService, FileService>();
|
|
services.AddScoped<ICacheHelper, CacheHelper>();
|
|
|
|
services.AddScoped<IStatsService, StatsService>();
|
|
services.AddScoped<ITaskScheduler, TaskScheduler>();
|
|
services.AddScoped<ICacheService, CacheService>();
|
|
services.AddScoped<IArchiveService, ArchiveService>();
|
|
services.AddScoped<IBackupService, BackupService>();
|
|
services.AddScoped<ICleanupService, CleanupService>();
|
|
services.AddScoped<IBookService, BookService>();
|
|
services.AddScoped<IImageService, ImageService>();
|
|
services.AddScoped<IVersionUpdaterService, VersionUpdaterService>();
|
|
services.AddScoped<IDownloadService, DownloadService>();
|
|
services.AddScoped<IReaderService, ReaderService>();
|
|
services.AddScoped<IReadingItemService, ReadingItemService>();
|
|
services.AddScoped<IAccountService, AccountService>();
|
|
services.AddScoped<IEmailService, EmailService>();
|
|
services.AddScoped<IBookmarkService, BookmarkService>();
|
|
services.AddScoped<IThemeService, ThemeService>();
|
|
services.AddScoped<ISeriesService, SeriesService>();
|
|
|
|
services.AddScoped<IScannerService, ScannerService>();
|
|
services.AddScoped<IMetadataService, MetadataService>();
|
|
services.AddScoped<IWordCountAnalyzerService, WordCountAnalyzerService>();
|
|
|
|
|
|
|
|
services.AddScoped<IPresenceTracker, PresenceTracker>();
|
|
services.AddScoped<IEventHub, EventHub>();
|
|
|
|
services.AddSqLite(config, env);
|
|
services.AddLogging(config);
|
|
services.AddSignalR(opt => opt.EnableDetailedErrors = true);
|
|
}
|
|
|
|
private static void AddSqLite(this IServiceCollection services, IConfiguration config,
|
|
IHostEnvironment env)
|
|
{
|
|
services.AddDbContext<DataContext>(options =>
|
|
{
|
|
options.UseSqlite(config.GetConnectionString("DefaultConnection"));
|
|
options.EnableDetailedErrors();
|
|
options.EnableSensitiveDataLogging(env.IsDevelopment() || Configuration.LogLevel.Equals("Debug"));
|
|
});
|
|
}
|
|
|
|
private static void AddLogging(this IServiceCollection services, IConfiguration config)
|
|
{
|
|
services.AddLogging(loggingBuilder =>
|
|
{
|
|
var loggingSection = config.GetSection("Logging");
|
|
loggingBuilder.AddFile(loggingSection);
|
|
});
|
|
}
|
|
}
|
|
}
|