mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-07 07:15:18 -04:00
Performance/cache epub (#438)
Changed: (Performance) Added the ability for epubs to cache, allowing faster page load for users with network mounted storage. (Fixes Investigate caching epubs (benefit for network mounted users) #433 )
This commit is contained in:
@@ -106,11 +106,18 @@ namespace API.Services
|
||||
|
||||
public void CopyFileToDirectory(string fullFilePath, string targetDirectory)
|
||||
{
|
||||
var fileInfo = new FileInfo(fullFilePath);
|
||||
if (fileInfo.Exists)
|
||||
{
|
||||
fileInfo.CopyTo(Path.Join(targetDirectory, fileInfo.Name));
|
||||
}
|
||||
try
|
||||
{
|
||||
var fileInfo = new FileInfo(fullFilePath);
|
||||
if (fileInfo.Exists)
|
||||
{
|
||||
fileInfo.CopyTo(Path.Join(targetDirectory, fileInfo.Name), true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "There was a critical error when copying {File} to {Directory}", fullFilePath, targetDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user