mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
Folder Watching Polish + Epub Fix (#1550)
* Fixed entrypoint writing bad json (from develop) * Fixed a bug where log file could write out a crap ton of information (serializing Series object) when a db error occurs. * Fixed an issue with scan loop where concurrency issues could occur on new series being added. * Tweaked the logger to suppress some noisy logs when using Debug log level. * Fixed a regression with epub parsing from v3.2 of Vers-One's release * Fixed up folder watching to work more reliable. Validated in production. * Code cleanup
This commit is contained in:
@@ -44,9 +44,9 @@ public class ProcessSeries : IProcessSeries
|
||||
private readonly IMetadataService _metadataService;
|
||||
private readonly IWordCountAnalyzerService _wordCountAnalyzerService;
|
||||
|
||||
private IList<Genre> _genres;
|
||||
private IList<Person> _people;
|
||||
private IList<Tag> _tags;
|
||||
private volatile IList<Genre> _genres;
|
||||
private volatile IList<Person> _people;
|
||||
private volatile IList<Tag> _tags;
|
||||
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ public class ProcessSeries : IProcessSeries
|
||||
{
|
||||
seriesAdded = true;
|
||||
series = DbFactory.Series(firstInfo.Series, firstInfo.LocalizedSeries);
|
||||
_unitOfWork.SeriesRepository.Add(series);
|
||||
}
|
||||
|
||||
if (series.LibraryId == 0) series.LibraryId = library.Id;
|
||||
@@ -156,7 +157,6 @@ public class ProcessSeries : IProcessSeries
|
||||
await UpdateSeriesFolderPath(parsedInfos, library, series);
|
||||
|
||||
series.LastFolderScanned = DateTime.Now;
|
||||
_unitOfWork.SeriesRepository.Attach(series);
|
||||
|
||||
if (_unitOfWork.HasChanges())
|
||||
{
|
||||
@@ -167,7 +167,7 @@ public class ProcessSeries : IProcessSeries
|
||||
catch (Exception ex)
|
||||
{
|
||||
await _unitOfWork.RollbackAsync();
|
||||
_logger.LogCritical(ex, "[ScannerService] There was an issue writing to the for series {@SeriesName}", series);
|
||||
_logger.LogCritical(ex, "[ScannerService] There was an issue writing to the database for series {@SeriesName}", series.Name);
|
||||
|
||||
await _eventHub.SendMessageAsync(MessageFactory.Error,
|
||||
MessageFactory.ErrorEvent($"There was an issue writing to the DB for Series {series}",
|
||||
|
||||
Reference in New Issue
Block a user