mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-29 01:08:56 +01:00
Update merge for m4b files, add progress event for local audiobooks
This commit is contained in:
parent
beaa1e14bb
commit
c30955f909
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audiobookshelf-client",
|
"name": "audiobookshelf-client",
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"description": "Audiobook manager and player",
|
"description": "Audiobook manager and player",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "audiobookshelf",
|
"name": "audiobookshelf",
|
||||||
"version": "1.1.3",
|
"version": "1.1.4",
|
||||||
"description": "Self-hosted audiobook server for managing and playing audiobooks.",
|
"description": "Self-hosted audiobook server for managing and playing audiobooks.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -117,6 +117,7 @@ class DownloadManager {
|
|||||||
|
|
||||||
const logLevel = process.env.NODE_ENV === 'production' ? 'error' : 'warning'
|
const logLevel = process.env.NODE_ENV === 'production' ? 'error' : 'warning'
|
||||||
var ffmpegOptions = [`-loglevel ${logLevel}`]
|
var ffmpegOptions = [`-loglevel ${logLevel}`]
|
||||||
|
var ffmpegOutputOptions = []
|
||||||
|
|
||||||
if (requiresEncode) {
|
if (requiresEncode) {
|
||||||
ffmpegOptions = ffmpegOptions.concat([
|
ffmpegOptions = ffmpegOptions.concat([
|
||||||
@ -128,6 +129,10 @@ class DownloadManager {
|
|||||||
])
|
])
|
||||||
} else {
|
} else {
|
||||||
ffmpegOptions.push('-c copy')
|
ffmpegOptions.push('-c copy')
|
||||||
|
if (download.ext === '.m4b') {
|
||||||
|
Logger.info('Concat m4b\'s use -f mp4')
|
||||||
|
ffmpegOutputOptions.push('-f mp4')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (download.includeMetadata) {
|
if (download.includeMetadata) {
|
||||||
@ -153,6 +158,7 @@ class DownloadManager {
|
|||||||
var workerData = {
|
var workerData = {
|
||||||
inputs: ffmpegInputs,
|
inputs: ffmpegInputs,
|
||||||
options: ffmpegOptions,
|
options: ffmpegOptions,
|
||||||
|
outputOptions: ffmpegOutputOptions,
|
||||||
output: download.fullPath,
|
output: download.fullPath,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,6 +205,7 @@ class Server {
|
|||||||
socket.on('open_stream', (audiobookId) => this.streamManager.openStreamSocketRequest(socket, audiobookId))
|
socket.on('open_stream', (audiobookId) => this.streamManager.openStreamSocketRequest(socket, audiobookId))
|
||||||
socket.on('close_stream', () => this.streamManager.closeStreamRequest(socket))
|
socket.on('close_stream', () => this.streamManager.closeStreamRequest(socket))
|
||||||
socket.on('stream_update', (payload) => this.streamManager.streamUpdate(socket, payload))
|
socket.on('stream_update', (payload) => this.streamManager.streamUpdate(socket, payload))
|
||||||
|
socket.on('progress_update', (payload) => this.audiobookProgressUpdate(socket.sheepClient, payload))
|
||||||
socket.on('download', (payload) => this.downloadManager.downloadSocketRequest(socket, payload))
|
socket.on('download', (payload) => this.downloadManager.downloadSocketRequest(socket, payload))
|
||||||
socket.on('test', () => {
|
socket.on('test', () => {
|
||||||
socket.emit('test_received', socket.id)
|
socket.emit('test_received', socket.id)
|
||||||
@ -230,6 +231,14 @@ class Server {
|
|||||||
res.sendStatus(200)
|
res.sendStatus(200)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
audiobookProgressUpdate(client, progressPayload) {
|
||||||
|
if (!client || !client.user) {
|
||||||
|
Logger.error('[Server] audiobookProgressUpdate invalid socket client')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
client.user.updateAudiobookProgressFromStream(progressPayload)
|
||||||
|
}
|
||||||
|
|
||||||
async authenticateSocket(socket, token) {
|
async authenticateSocket(socket, token) {
|
||||||
var user = await this.auth.verifyToken(token)
|
var user = await this.auth.verifyToken(token)
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
@ -19,6 +19,7 @@ workerData.inputs.forEach((inputData) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (workerData.options) ffmpegCommand.addOption(workerData.options)
|
if (workerData.options) ffmpegCommand.addOption(workerData.options)
|
||||||
|
if (workerData.outputOptions && workerData.outputOptions.length) ffmpegCommand.addOutputOption(workerData.outputOptions)
|
||||||
ffmpegCommand.output(workerData.output)
|
ffmpegCommand.output(workerData.output)
|
||||||
|
|
||||||
var isKilled = false
|
var isKilled = false
|
||||||
|
Loading…
Reference in New Issue
Block a user