mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 20:24:27 -04:00
More fixes (again) (#858)
* Send stack trace to the UI on prod mode * Pdfs will now generate cover images. I missed something a few releases ago.
This commit is contained in:
parent
c284e4dca0
commit
d4918ee8ff
@ -14,7 +14,7 @@ namespace API.Middleware
|
|||||||
private readonly RequestDelegate _next;
|
private readonly RequestDelegate _next;
|
||||||
private readonly ILogger<ExceptionMiddleware> _logger;
|
private readonly ILogger<ExceptionMiddleware> _logger;
|
||||||
private readonly IHostEnvironment _env;
|
private readonly IHostEnvironment _env;
|
||||||
|
|
||||||
|
|
||||||
public ExceptionMiddleware(RequestDelegate next, ILogger<ExceptionMiddleware> logger, IHostEnvironment env)
|
public ExceptionMiddleware(RequestDelegate next, ILogger<ExceptionMiddleware> logger, IHostEnvironment env)
|
||||||
{
|
{
|
||||||
@ -34,14 +34,14 @@ namespace API.Middleware
|
|||||||
_logger.LogError(ex, "There was an exception");
|
_logger.LogError(ex, "There was an exception");
|
||||||
context.Response.ContentType = "application/json";
|
context.Response.ContentType = "application/json";
|
||||||
context.Response.StatusCode = (int) HttpStatusCode.InternalServerError;
|
context.Response.StatusCode = (int) HttpStatusCode.InternalServerError;
|
||||||
|
|
||||||
var response = _env.IsDevelopment()
|
var response = _env.IsDevelopment()
|
||||||
? new ApiException(context.Response.StatusCode, ex.Message, ex.StackTrace)
|
? new ApiException(context.Response.StatusCode, ex.Message, ex.StackTrace)
|
||||||
: new ApiException(context.Response.StatusCode, "Internal Server Error");
|
: new ApiException(context.Response.StatusCode, "Internal Server Error", ex.StackTrace);
|
||||||
|
|
||||||
var options = new JsonSerializerOptions
|
var options = new JsonSerializerOptions
|
||||||
{
|
{
|
||||||
PropertyNamingPolicy =
|
PropertyNamingPolicy =
|
||||||
JsonNamingPolicy.CamelCase
|
JsonNamingPolicy.CamelCase
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,4 +52,4 @@ namespace API.Middleware
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,7 @@ public class ReadingItemService : IReadingItemService
|
|||||||
MangaFormat.Epub => _bookService.GetCoverImage(filePath, fileName),
|
MangaFormat.Epub => _bookService.GetCoverImage(filePath, fileName),
|
||||||
MangaFormat.Archive => _archiveService.GetCoverImage(filePath, fileName),
|
MangaFormat.Archive => _archiveService.GetCoverImage(filePath, fileName),
|
||||||
MangaFormat.Image => _imageService.GetCoverImage(filePath, fileName),
|
MangaFormat.Image => _imageService.GetCoverImage(filePath, fileName),
|
||||||
|
MangaFormat.Pdf => _bookService.GetCoverImage(filePath, fileName),
|
||||||
_ => string.Empty
|
_ => string.Empty
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user