switchade t bootstrap och testar solid-bootstrap. konf för calibre. test m covers
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
using Bibblan.Models;
|
||||
using Bibblan.ViewModels;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bibblan.Business.Services
|
||||
{
|
||||
public class CalibreService
|
||||
{
|
||||
private readonly BibblanOptions _options;
|
||||
CalibreContext _context;
|
||||
public CalibreService(CalibreContext context)
|
||||
public CalibreService(CalibreContext context, IOptions<BibblanOptions> options)
|
||||
{
|
||||
_options = options.Value;
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public byte[] Cover(string path)
|
||||
{
|
||||
var fullPath = Path.Combine(_options.CalibreRoot, path, "cover.jpg");
|
||||
return File.ReadAllBytes(fullPath);
|
||||
}
|
||||
|
||||
public IQueryable<BookVm> GetAllBooks()
|
||||
{
|
||||
return from b in _context.Books
|
||||
|
Reference in New Issue
Block a user