mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 18:24:46 +02:00
Support cbr and cbz comics and comic reader #109
This commit is contained in:
parent
18c1d8f1a3
commit
88e2bac3f5
12 changed files with 276 additions and 20 deletions
|
@ -139,6 +139,10 @@ class Audiobook {
|
|||
return this.ebooks.find(file => file.ext === '.pdf')
|
||||
}
|
||||
|
||||
get hasComic() {
|
||||
return this.ebooks.find(file => file.ext === '.cbr' || file.ext === '.cbz')
|
||||
}
|
||||
|
||||
get hasMissingIno() {
|
||||
return !this.ino || this._audioFiles.find(abf => !abf.ino) || this._otherFiles.find(f => !f.ino) || this._tracks.find(t => !t.ino)
|
||||
}
|
||||
|
@ -210,7 +214,7 @@ class Audiobook {
|
|||
hasInvalidParts: this.invalidParts ? this.invalidParts.length : 0,
|
||||
// numEbooks: this.ebooks.length,
|
||||
ebooks: this.ebooks.map(ebook => ebook.toJSON()),
|
||||
numEbooks: (this.hasEpub || this.hasMobi || this.hasPdf) ? 1 : 0, // Only supporting epubs in the reader currently
|
||||
numEbooks: (this.hasEpub || this.hasMobi || this.hasPdf || this.hasComic) ? 1 : 0,
|
||||
numTracks: this.tracks.length,
|
||||
chapters: this.chapters || [],
|
||||
isMissing: !!this.isMissing,
|
||||
|
@ -237,7 +241,7 @@ class Audiobook {
|
|||
audioFiles: this._audioFiles.map(audioFile => audioFile.toJSON()),
|
||||
otherFiles: this._otherFiles.map(otherFile => otherFile.toJSON()),
|
||||
ebooks: this.ebooks.map(ebook => ebook.toJSON()),
|
||||
numEbooks: (this.hasEpub || this.hasMobi || this.hasPdf) ? 1 : 0,
|
||||
numEbooks: (this.hasEpub || this.hasMobi || this.hasPdf || this.hasComic) ? 1 : 0,
|
||||
numTracks: this.tracks.length,
|
||||
tags: this.tags,
|
||||
book: this.bookToJSON(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const globals = {
|
||||
SupportedImageTypes: ['png', 'jpg', 'jpeg', 'webp'],
|
||||
SupportedAudioTypes: ['m4b', 'mp3', 'm4a', 'flac', 'opus', 'mp4'],
|
||||
SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3']
|
||||
SupportedEbookTypes: ['epub', 'pdf', 'mobi', 'azw3', 'cbr', 'cbz']
|
||||
}
|
||||
|
||||
module.exports = globals
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue