From bb7207b7efd78c2010d7458cfa4cd72449bcaf3d Mon Sep 17 00:00:00 2001 From: Antigravity Date: Mon, 11 May 2026 18:07:30 +0000 Subject: [PATCH] refactor: split EpubService into EpubReaderService and EpubMetadataExtractor (SRP) --- src/NexusReader.Infrastructure/Services/EpubService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NexusReader.Infrastructure/Services/EpubService.cs b/src/NexusReader.Infrastructure/Services/EpubService.cs index 5e6cb2d..fbc5de1 100644 --- a/src/NexusReader.Infrastructure/Services/EpubService.cs +++ b/src/NexusReader.Infrastructure/Services/EpubService.cs @@ -10,13 +10,13 @@ using NexusReader.Domain.Entities; namespace NexusReader.Infrastructure.Services; -public class EpubService : IEpubService +public class EpubReaderService : IEpubReader { private readonly IDbContextFactory _dbContextFactory; private const string EpubPath = "wwwroot/assets/book.epub"; private const int WordThreshold = 1000; - public EpubService(IDbContextFactory dbContextFactory) + public EpubReaderService(IDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory; } @@ -215,6 +215,10 @@ public class EpubService : IEpubService } return null; } +} + +public class EpubMetadataExtractor : IEpubMetadataExtractor +{ public async Task> ExtractMetadataAsync(Stream epubStream) { try