mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 11:25:02 +02:00
Initial commit for server side approach
This is the first commit for bringing this over to the server side. It works! Right now it fails if the autoscanner or or the manual individual book scanner try to do it's thing. I'll need to update those
This commit is contained in:
parent
effc63755b
commit
b3d9323f66
6 changed files with 175 additions and 42 deletions
|
@ -62,6 +62,7 @@ class Scanner {
|
|||
}
|
||||
|
||||
async scanLibraryItem(libraryMediaType, folder, libraryItem) {
|
||||
Logger.debug(`[Scanner] SCANNING ITEMS JOE`)
|
||||
// TODO: Support for single media item
|
||||
var libraryItemData = await getLibraryItemFileData(libraryMediaType, folder, libraryItem.path, false, this.db.serverSettings)
|
||||
if (!libraryItemData) {
|
||||
|
@ -114,6 +115,7 @@ class Scanner {
|
|||
}
|
||||
|
||||
async scan(library, options = {}) {
|
||||
Logger.debug('[scan] inside of scan')
|
||||
if (this.isLibraryScanning(library.id)) {
|
||||
Logger.error(`[Scanner] Already scanning ${library.id}`)
|
||||
return
|
||||
|
@ -126,6 +128,7 @@ class Scanner {
|
|||
|
||||
var scanOptions = new ScanOptions()
|
||||
scanOptions.setData(options, this.db.serverSettings)
|
||||
Logger.debug(`[Scanner] scanOptions: ${JSON.stringify(scanOptions)}`)
|
||||
|
||||
var libraryScan = new LibraryScan()
|
||||
libraryScan.setData(library, scanOptions)
|
||||
|
@ -165,6 +168,8 @@ class Scanner {
|
|||
async scanLibrary(libraryScan) {
|
||||
var libraryItemDataFound = []
|
||||
|
||||
Logger.debug(`[scanLibrary] libraryScan: ${JSON.stringify(libraryScan)}`)
|
||||
|
||||
// Scan each library
|
||||
for (let i = 0; i < libraryScan.folders.length; i++) {
|
||||
var folder = libraryScan.folders[i]
|
||||
|
@ -750,6 +755,7 @@ class Scanner {
|
|||
}
|
||||
|
||||
async matchLibraryItems(library) {
|
||||
Logger.debug("SCANNING!")
|
||||
if (library.mediaType === 'podcast') {
|
||||
Logger.error(`[Scanner] matchLibraryItems: Match all not supported for podcasts yet`)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue