mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
New: Use Goodreads directly, allow multiple editions of a book (new DB required)
This commit is contained in:
@@ -16,16 +16,19 @@ namespace Readarr.Api.V1.ManualImport
|
||||
{
|
||||
private readonly IAuthorService _authorService;
|
||||
private readonly IBookService _bookService;
|
||||
private readonly IEditionService _editionService;
|
||||
private readonly IManualImportService _manualImportService;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public ManualImportModule(IManualImportService manualImportService,
|
||||
IAuthorService authorService,
|
||||
IEditionService editionService,
|
||||
IBookService bookService,
|
||||
Logger logger)
|
||||
{
|
||||
_authorService = authorService;
|
||||
_bookService = bookService;
|
||||
_editionService = editionService;
|
||||
_manualImportService = manualImportService;
|
||||
_logger = logger;
|
||||
|
||||
@@ -86,10 +89,12 @@ namespace Readarr.Api.V1.ManualImport
|
||||
Size = resource.Size,
|
||||
Author = resource.Author == null ? null : _authorService.GetAuthor(resource.Author.Id),
|
||||
Book = resource.Book == null ? null : _bookService.GetBook(resource.Book.Id),
|
||||
Edition = resource.EditionId == 0 ? null : _editionService.GetEdition(resource.EditionId),
|
||||
Quality = resource.Quality,
|
||||
DownloadId = resource.DownloadId,
|
||||
AdditionalFile = resource.AdditionalFile,
|
||||
ReplaceExistingFiles = resource.ReplaceExistingFiles
|
||||
ReplaceExistingFiles = resource.ReplaceExistingFiles,
|
||||
DisableReleaseSwitching = resource.DisableReleaseSwitching
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Readarr.Api.V1.ManualImport
|
||||
public long Size { get; set; }
|
||||
public AuthorResource Author { get; set; }
|
||||
public BookResource Book { get; set; }
|
||||
public int EditionId { get; set; }
|
||||
public QualityModel Quality { get; set; }
|
||||
public int QualityWeight { get; set; }
|
||||
public string DownloadId { get; set; }
|
||||
@@ -24,6 +25,7 @@ namespace Readarr.Api.V1.ManualImport
|
||||
public ParsedTrackInfo AudioTags { get; set; }
|
||||
public bool AdditionalFile { get; set; }
|
||||
public bool ReplaceExistingFiles { get; set; }
|
||||
public bool DisableReleaseSwitching { get; set; }
|
||||
}
|
||||
|
||||
public static class ManualImportResourceMapper
|
||||
@@ -43,6 +45,7 @@ namespace Readarr.Api.V1.ManualImport
|
||||
Size = model.Size,
|
||||
Author = model.Author.ToResource(),
|
||||
Book = model.Book.ToResource(),
|
||||
EditionId = model.Edition?.Id ?? 0,
|
||||
Quality = model.Quality,
|
||||
|
||||
//QualityWeight
|
||||
@@ -50,7 +53,8 @@ namespace Readarr.Api.V1.ManualImport
|
||||
Rejections = model.Rejections,
|
||||
AudioTags = model.Tags,
|
||||
AdditionalFile = model.AdditionalFile,
|
||||
ReplaceExistingFiles = model.ReplaceExistingFiles
|
||||
ReplaceExistingFiles = model.ReplaceExistingFiles,
|
||||
DisableReleaseSwitching = model.DisableReleaseSwitching
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user