mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 20:24:27 -04:00
Performance Enhancements (#937)
This commit is contained in:
parent
aeb6d8e983
commit
491d9600dd
@ -94,6 +94,7 @@ public class ChapterRepository : IChapterRepository
|
|||||||
ChapterTitle = data.TitleName
|
ChapterTitle = data.TitleName
|
||||||
})
|
})
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
|
.AsSplitQuery()
|
||||||
.SingleOrDefaultAsync();
|
.SingleOrDefaultAsync();
|
||||||
|
|
||||||
return chapterInfo;
|
return chapterInfo;
|
||||||
|
@ -305,6 +305,7 @@ public class SeriesRepository : ISeriesRepository
|
|||||||
.Include(s => s.Metadata)
|
.Include(s => s.Metadata)
|
||||||
.ThenInclude(m => m.People)
|
.ThenInclude(m => m.People)
|
||||||
.Where(s => s.Id == seriesId)
|
.Where(s => s.Id == seriesId)
|
||||||
|
.AsSplitQuery()
|
||||||
.SingleOrDefaultAsync();
|
.SingleOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,6 +321,7 @@ public class SeriesRepository : ISeriesRepository
|
|||||||
.Include(s => s.Metadata)
|
.Include(s => s.Metadata)
|
||||||
.ThenInclude(m => m.CollectionTags)
|
.ThenInclude(m => m.CollectionTags)
|
||||||
.Where(s => seriesIds.Contains(s.Id))
|
.Where(s => seriesIds.Contains(s.Id))
|
||||||
|
.AsSplitQuery()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,6 +619,7 @@ public class SeriesRepository : ISeriesRepository
|
|||||||
.Where(t => t.SeriesMetadatas.Select(s => s.SeriesId).Contains(seriesId))
|
.Where(t => t.SeriesMetadatas.Select(s => s.SeriesId).Contains(seriesId))
|
||||||
.ProjectTo<CollectionTagDto>(_mapper.ConfigurationProvider)
|
.ProjectTo<CollectionTagDto>(_mapper.ConfigurationProvider)
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
|
.AsSplitQuery()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -640,6 +643,7 @@ public class SeriesRepository : ISeriesRepository
|
|||||||
.OrderBy(s => s.LibraryId)
|
.OrderBy(s => s.LibraryId)
|
||||||
.ThenBy(s => s.SortName)
|
.ThenBy(s => s.SortName)
|
||||||
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
|
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
|
||||||
|
.AsSplitQuery()
|
||||||
.AsNoTracking();
|
.AsNoTracking();
|
||||||
|
|
||||||
return await PagedList<SeriesDto>.CreateAsync(query, userParams.PageNumber, userParams.PageSize);
|
return await PagedList<SeriesDto>.CreateAsync(query, userParams.PageNumber, userParams.PageSize);
|
||||||
|
@ -178,6 +178,7 @@ public class VolumeRepository : IVolumeRepository
|
|||||||
.OrderBy(volume => volume.Number)
|
.OrderBy(volume => volume.Number)
|
||||||
.ProjectTo<VolumeDto>(_mapper.ConfigurationProvider)
|
.ProjectTo<VolumeDto>(_mapper.ConfigurationProvider)
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
|
.AsSplitQuery()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
await AddVolumeModifiers(userId, volumes);
|
await AddVolumeModifiers(userId, volumes);
|
||||||
|
@ -57,6 +57,9 @@ namespace API.Services
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(archivePath) || !(File.Exists(archivePath) && Parser.Parser.IsArchive(archivePath) || Parser.Parser.IsEpub(archivePath))) return ArchiveLibrary.NotSupported;
|
if (string.IsNullOrEmpty(archivePath) || !(File.Exists(archivePath) && Parser.Parser.IsArchive(archivePath) || Parser.Parser.IsEpub(archivePath))) return ArchiveLibrary.NotSupported;
|
||||||
|
|
||||||
|
var ext = _directoryService.FileSystem.Path.GetExtension(archivePath).ToUpper();
|
||||||
|
if (ext.Equals(".CBR") || ext.Equals(".RAR")) return ArchiveLibrary.SharpCompress;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var a2 = ZipFile.OpenRead(archivePath);
|
using var a2 = ZipFile.OpenRead(archivePath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user