mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Merge 2f515cc207 into 9c33446449
This commit is contained in:
commit
597b44c2c0
13 changed files with 232 additions and 36 deletions
|
|
@ -5,6 +5,7 @@ class AudioTrack {
|
|||
this.duration = null
|
||||
this.title = null
|
||||
this.contentUrl = null
|
||||
this.transcriptUrl = null
|
||||
this.mimeType = null
|
||||
this.codec = null
|
||||
this.metadata = null
|
||||
|
|
@ -17,6 +18,7 @@ class AudioTrack {
|
|||
duration: this.duration,
|
||||
title: this.title,
|
||||
contentUrl: this.contentUrl,
|
||||
transcriptUrl: this.transcriptUrl,
|
||||
mimeType: this.mimeType,
|
||||
codec: this.codec,
|
||||
metadata: this.metadata?.toJSON() || null
|
||||
|
|
@ -30,6 +32,7 @@ class AudioTrack {
|
|||
this.title = audioFile.metadata.filename || ''
|
||||
|
||||
this.contentUrl = `${global.RouterBasePath}/api/items/${itemId}/file/${audioFile.ino}`
|
||||
this.transcriptUrl = `${global.RouterBasePath}/api/items/${itemId}/file/${audioFile.ino}/transcript`
|
||||
this.mimeType = audioFile.mimeType
|
||||
this.codec = audioFile.codec || null
|
||||
this.metadata = audioFile.metadata.clone()
|
||||
|
|
@ -44,4 +47,4 @@ class AudioTrack {
|
|||
this.mimeType = 'application/vnd.apple.mpegurl'
|
||||
}
|
||||
}
|
||||
module.exports = AudioTrack
|
||||
module.exports = AudioTrack
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class LibraryFile {
|
|||
if (globals.SupportedVideoTypes.includes(this.metadata.format)) return 'video'
|
||||
if (globals.TextFileTypes.includes(this.metadata.format)) return 'text'
|
||||
if (globals.MetadataFileTypes.includes(this.metadata.format)) return 'metadata'
|
||||
if (globals.SubtitleFileTypes.includes(this.metadata.format)) return 'subtitle'
|
||||
return 'unknown'
|
||||
}
|
||||
|
||||
|
|
@ -75,4 +76,4 @@ class LibraryFile {
|
|||
this.updatedAt = Date.now()
|
||||
}
|
||||
}
|
||||
module.exports = LibraryFile
|
||||
module.exports = LibraryFile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue