Merge master

This commit is contained in:
advplyr 2022-02-12 11:58:06 -06:00
commit b212f1d5bb
9 changed files with 84 additions and 27 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf-client", "name": "audiobookshelf-client",
"version": "1.6.65", "version": "1.6.66",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"packages": { "packages": {

View file

@ -2,7 +2,7 @@
<div id="page-wrapper" class="page p-6 overflow-y-auto relative" :class="streamAudiobook ? 'streaming' : ''"> <div id="page-wrapper" class="page p-6 overflow-y-auto relative" :class="streamAudiobook ? 'streaming' : ''">
<app-config-side-nav :is-open.sync="sideDrawerOpen" /> <app-config-side-nav :is-open.sync="sideDrawerOpen" />
<div class="configContent" :class="`page-${currentPage}`"> <div class="configContent" :class="`page-${currentPage}`">
<div class="w-full pb-4 px-2 flex md:hidden border-b border-white border-opacity-10 mb-2"> <div v-show="isMobile" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2">
<span class="material-icons cursor-pointer" @click.stop.prevent="showMore">more_vert</span> <span class="material-icons cursor-pointer" @click.stop.prevent="showMore">more_vert</span>
<p class="pl-3 capitalize">{{ currentPage }}</p> <p class="pl-3 capitalize">{{ currentPage }}</p>
</div> </div>
@ -35,6 +35,9 @@ export default {
} }
}, },
computed: { computed: {
isMobile() {
return this.$store.state.globals.isMobile
},
streamAudiobook() { streamAudiobook() {
return this.$store.state.streamAudiobook return this.$store.state.streamAudiobook
}, },
@ -78,12 +81,12 @@ export default {
.configContent.page-library-stats { .configContent.page-library-stats {
width: 1200px; width: 1200px;
} }
@media (max-width: 1024px) { @media (max-width: 1240px) {
.configContent { .configContent {
margin-left: 176px; margin-left: 176px;
} }
} }
@media (max-width: 768px) { @media (max-width: 640px) {
.configContent { .configContent {
margin-left: 0px; margin-left: 0px;
width: 100%; width: 100%;

View file

@ -13,7 +13,7 @@ export const getters = {}
export const mutations = { export const mutations = {
updateWindowSize(state, { width, height }) { updateWindowSize(state, { width, height }) {
state.isMobile = width < 768 || height < 768 state.isMobile = width < 640 || height < 640
state.isMobileLandscape = state.isMobile && height > width state.isMobileLandscape = state.isMobile && height > width
}, },
setShowUserCollectionsModal(state, val) { setShowUserCollectionsModal(state, val) {

4
package-lock.json generated
View file

@ -1,7 +1,7 @@
{ {
"name": "audiobookshelf", "name": "audiobookshelf",
"version": "1.6.65", "version": "1.6.66",
"lockfileVersion": 2, "lockfileVersion": 1,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {

View file

@ -12,7 +12,7 @@
</p> </p>
</div> </div>
## About # About
Audiobookshelf is a self-hosted audiobook server for managing and playing your audiobooks. Audiobookshelf is a self-hosted audiobook server for managing and playing your audiobooks.
@ -34,14 +34,17 @@ iOS early beta available using Test Flight: https://testflight.apple.com/join/wi
<img alt="Library Screenshot" src="https://github.com/advplyr/audiobookshelf/raw/master/images/LibraryStream.png" /> <img alt="Library Screenshot" src="https://github.com/advplyr/audiobookshelf/raw/master/images/LibraryStream.png" />
## Organizing your audiobooks <br />
# Organizing your audiobooks
#### Directory structure and folder names are important to Audiobookshelf! #### Directory structure and folder names are important to Audiobookshelf!
See [documentation](https://audiobookshelf.org/docs) for supported directory structure, folder naming conventions, and audio file metadata usage. See [documentation](https://audiobookshelf.org/docs) for supported directory structure, folder naming conventions, and audio file metadata usage.
<br />
## Installation # Installation
** Default username is "root" with no password ** Default username is "root" with no password
@ -119,7 +122,17 @@ System Service: `/lib/systemd/system/audiobookshelf.service`
Ffmpeg static build: `/usr/lib/audiobookshelf-ffmpeg/` Ffmpeg static build: `/usr/lib/audiobookshelf-ffmpeg/`
## Reverse Proxy Set Up <br />
# Reverse Proxy Set Up
#### Important! Audiobookshelf requires a websocket connection.
### NGINX Proxy Manager
Toggle websockets support.
<img alt="NGINX Web socket" src="https://user-images.githubusercontent.com/67830747/153679106-b2a7f5b9-0702-48c6-9740-b26b401986e9.png" />
### NGINX Reverse Proxy ### NGINX Reverse Proxy
@ -191,10 +204,23 @@ For this to work you must enable at least the following mods using `a2enmod`:
[See this solution](https://forums.unraid.net/topic/112698-support-audiobookshelf/?do=findComment&comment=1049637) [See this solution](https://forums.unraid.net/topic/112698-support-audiobookshelf/?do=findComment&comment=1049637)
## Run from source ### Synology Reverse Proxy
1. Open Control Panel > Application Portal
2. Change to the Reverse Proxy tab
3. Select the proxy rule for which you want to enable Websockets and click on Edit
4. Change to the "Custom Header" tab
5. Click Create > WebSocket
6. Click Save
[from @silentArtifact](https://github.com/advplyr/audiobookshelf/issues/241#issuecomment-1036732329)
<br />
# Run from source
[See discussion](https://github.com/advplyr/audiobookshelf/discussions/259#discussioncomment-1869729) [See discussion](https://github.com/advplyr/audiobookshelf/discussions/259#discussioncomment-1869729)
## Contributing / How to Support # Contributing / How to Support
[See the incomplete "How to Support" page](https://www.audiobookshelf.org/support) [See the incomplete "How to Support" page](https://www.audiobookshelf.org/support)

View file

@ -47,6 +47,7 @@ class Book {
get _language() { return this.language || '' } get _language() { return this.language || '' }
get _isbn() { return this.isbn || '' } get _isbn() { return this.isbn || '' }
get _asin() { return this.asin || '' } get _asin() { return this.asin || '' }
get genresCommaSeparated() { return this._genres.join(', ') }
get shouldSearchForCover() { get shouldSearchForCover() {
if (this.cover) return false if (this.cover) return false

View file

@ -0,0 +1,37 @@
const fs = require('fs-extra')
const filePerms = require('./filePerms')
const package = require('../../package.json')
const Logger = require('../Logger')
const bookKeyMap = {
title: 'title',
subtitle: 'subtitle',
author: 'authorFL',
narrator: 'narratorFL',
series: 'series',
volumeNumber: 'volumeNumber',
publishYear: 'publishYear',
publisher: 'publisher',
description: 'description',
isbn: 'isbn',
asin: 'asin',
language: 'language',
genres: 'genresCommaSeparated'
}
function generate(audiobook, outputPath, uid, gid) {
var fileString = `[audiobookshelf v${package.version}]\n`
for (const key in bookKeyMap) {
const value = audiobook.book[bookKeyMap[key]] || ''
fileString += `${key}=${value}\n`
}
return fs.writeFile(outputPath, fileString).then(() => {
return filePerms(outputPath, 0o774, uid, gid).then(() => true)
}).catch((error) => {
Logger.error(`[absMetaFileGenerator] Failed to save abs file`, error)
return false
})
}
module.exports.generate = generate

View file

@ -77,9 +77,9 @@ const chmodr = (p, mode, uid, gid, cb) => {
}) })
} }
module.exports = (p, mode, uid, gid) => { module.exports = (path, mode, uid, gid) => {
return new Promise((resolve) => { return new Promise((resolve) => {
Logger.debug(`[FilePerms] Setting permission "${mode}" for uid ${uid} and gid ${gid} | "${p}"`) Logger.debug(`[FilePerms] Setting permission "${mode}" for uid ${uid} and gid ${gid} | "${path}"`)
chmodr(p, mode, uid, gid, resolve) chmodr(path, mode, uid, gid, resolve)
}) })
} }

View file

@ -51,16 +51,6 @@ function bytesPretty(bytes, decimals = 0) {
} }
module.exports.bytesPretty = bytesPretty module.exports.bytesPretty = bytesPretty
function setFileOwner(path, uid, gid) {
try {
return fs.chown(path, uid, gid).then(() => true)
} catch (err) {
console.error('Failed set file owner', err)
return false
}
}
module.exports.setFileOwner = setFileOwner
async function recurseFiles(path, relPathToReplace = null) { async function recurseFiles(path, relPathToReplace = null) {
path = path.replace(/\\/g, '/') path = path.replace(/\\/g, '/')
if (!path.endsWith('/')) path = path + '/' if (!path.endsWith('/')) path = path + '/'