diff --git a/client/assets/fonts.css b/client/assets/fonts.css index 75e4ae61..42a2ca4a 100644 --- a/client/assets/fonts.css +++ b/client/assets/fonts.css @@ -11,7 +11,6 @@ font-weight: normal; font-style: normal; line-height: 1; - font-size: 1.5rem; letter-spacing: normal; text-transform: none; display: inline-block; @@ -21,12 +20,7 @@ -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; } -.material-icons.text-icon { - font-size: 1.15rem; -} -.material-icons.text-base { - font-size: 1rem; -} + @font-face { font-family: 'Gentium Book Basic'; diff --git a/client/components/app/Reader.vue b/client/components/app/Reader.vue deleted file mode 100644 index 98c91d63..00000000 --- a/client/components/app/Reader.vue +++ /dev/null @@ -1,361 +0,0 @@ - - - - - \ No newline at end of file diff --git a/client/components/app/ComicReader.vue b/client/components/readers/ComicReader.vue similarity index 57% rename from client/components/app/ComicReader.vue rename to client/components/readers/ComicReader.vue index e514b854..39fb7404 100644 --- a/client/components/app/ComicReader.vue +++ b/client/components/readers/ComicReader.vue @@ -1,29 +1,42 @@ diff --git a/client/package.json b/client/package.json index b9307743..7f936969 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "1.4.11", + "version": "1.4.12", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/client/pages/audiobook/_id/index.vue b/client/pages/audiobook/_id/index.vue index 4c7f33ca..051dc90e 100644 --- a/client/pages/audiobook/_id/index.vue +++ b/client/pages/audiobook/_id/index.vue @@ -24,11 +24,6 @@

{{ seriesText }} -
Narrated By @@ -81,10 +76,6 @@ warning_amber

Book has no audio tracks but has valid ebook files. The e-reader is experimental and can be turned on in config.

-
- warning_amber -

Book has valid ebook files, but the experimental e-reader currently only supports epub files.

-

Your Progress: {{ Math.round(progressPercent * 100) }}%

@@ -152,8 +143,6 @@
- - @@ -321,14 +310,10 @@ export default { ebooks() { return this.audiobook.ebooks }, - showEpubAlert() { - return this.ebooks.length && !this.numEbooks && !this.tracks.length - }, showExperimentalReadAlert() { return !this.tracks.length && this.ebooks.length && !this.showExperimentalFeatures }, numEbooks() { - // Number of currently supported for reading ebooks, not all ebooks return this.audiobook.numEbooks }, userToken() { diff --git a/client/plugins/axios.js b/client/plugins/axios.js index f6f7c548..88468b2a 100644 --- a/client/plugins/axios.js +++ b/client/plugins/axios.js @@ -1,5 +1,9 @@ export default function ({ $axios, store }) { $axios.onRequest(config => { + if (!config.url) { + console.error('Axios request invalid config', config) + return + } if (config.url.startsWith('http:') || config.url.startsWith('https:')) { return } diff --git a/client/plugins/init.client.js b/client/plugins/init.client.js index bc3df5cb..924b13b0 100644 --- a/client/plugins/init.client.js +++ b/client/plugins/init.client.js @@ -127,6 +127,19 @@ Vue.prototype.$sanitizeFilename = (input, replacement = '') => { return sanitized } + +function xmlToJson(xml) { + const json = {}; + for (const res of xml.matchAll(/(?:<(\w*)(?:\s[^>]*)*>)((?:(?!<\1).)*)(?:<\/\1>)|<(\w*)(?:\s*)*\/>/gm)) { + const key = res[1] || res[3]; + const value = res[2] && xmlToJson(res[2]); + json[key] = ((value && Object.keys(value).length) ? value : res[2]) || null; + + } + return json; +} +Vue.prototype.$xmlToJson = xmlToJson + const encode = (text) => encodeURIComponent(Buffer.from(text).toString('base64')) Vue.prototype.$encode = encode const decode = (text) => Buffer.from(decodeURIComponent(text), 'base64').toString() diff --git a/package.json b/package.json index 6ebb9b8b..8861e419 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf", - "version": "1.4.11", + "version": "1.4.12", "description": "Self-hosted audiobook server for managing and playing audiobooks", "main": "index.js", "scripts": { diff --git a/server/objects/Audiobook.js b/server/objects/Audiobook.js index f1948a64..0f41a9ec 100644 --- a/server/objects/Audiobook.js +++ b/server/objects/Audiobook.js @@ -127,22 +127,6 @@ class Audiobook { return this.otherFiles.filter(file => file.filetype === 'ebook') } - get hasEpub() { - return this.ebooks.find(file => file.ext === '.epub') - } - - get hasMobi() { - return this.ebooks.find(file => file.ext === '.mobi' || file.ext === '.azw3') - } - - get hasPdf() { - 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) } @@ -214,7 +198,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 || this.hasComic) ? 1 : 0, + numEbooks: this.ebooks.length, numTracks: this.tracks.length, chapters: this.chapters || [], isMissing: !!this.isMissing, @@ -241,7 +225,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 || this.hasComic) ? 1 : 0, + numEbooks: this.ebooks.length, numTracks: this.tracks.length, tags: this.tags, book: this.bookToJSON(), diff --git a/server/utils/index.js b/server/utils/index.js index 781fdcde..317b4492 100644 --- a/server/utils/index.js +++ b/server/utils/index.js @@ -29,26 +29,6 @@ const levenshteinDistance = (str1, str2, caseSensitive = false) => { } module.exports.levenshteinDistance = levenshteinDistance -const cleanString = (str) => { - if (!str) return '' - - // Now supporting all utf-8 characters, can remove this method in future - - // replace accented characters: https://stackoverflow.com/a/49901740/7431543 - // str = str.normalize('NFD').replace(/[\u0300-\u036f]/g, "") - - // const availableChars = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" - // const cleanChar = (char) => availableChars.indexOf(char) < 0 ? '?' : char - - // var cleaned = '' - // for (let i = 0; i < str.length; i++) { - // cleaned += cleanChar(str[i]) - // } - - return cleaned.trim() -} -module.exports.cleanString = cleanString - module.exports.isObject = (val) => { return val !== null && typeof val === 'object' }