mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 01:35:08 +02:00
Remove deprecated /s/ and /ebook/ api routes
This commit is contained in:
parent
18cb394884
commit
5b0d105e21
5 changed files with 4 additions and 102 deletions
|
@ -1,6 +1,3 @@
|
|||
const Path = require('path')
|
||||
const { encodeUriPath } = require('../../utils/fileUtils')
|
||||
|
||||
class AudioTrack {
|
||||
constructor() {
|
||||
this.index = null
|
||||
|
@ -22,7 +19,7 @@ class AudioTrack {
|
|||
contentUrl: this.contentUrl,
|
||||
mimeType: this.mimeType,
|
||||
codec: this.codec,
|
||||
metadata: this.metadata ? this.metadata.toJSON() : null
|
||||
metadata: this.metadata?.toJSON() || null
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,8 +28,8 @@ class AudioTrack {
|
|||
this.startOffset = startOffset
|
||||
this.duration = audioFile.duration
|
||||
this.title = audioFile.metadata.filename || ''
|
||||
// TODO: Switch to /api/items/:id/file/:fileid
|
||||
this.contentUrl = Path.join(`${global.RouterBasePath}/s/item/${itemId}`, encodeUriPath(audioFile.metadata.relPath))
|
||||
|
||||
this.contentUrl = `${global.RouterBasePath}/api/items/${itemId}/file/${audioFile.ino}`
|
||||
this.mimeType = audioFile.mimeType
|
||||
this.codec = audioFile.codec || null
|
||||
this.metadata = audioFile.metadata.clone()
|
||||
|
|
|
@ -28,8 +28,7 @@ class VideoTrack {
|
|||
this.index = videoFile.index
|
||||
this.duration = videoFile.duration
|
||||
this.title = videoFile.metadata.filename || ''
|
||||
// TODO: Switch to /api/items/:id/file/:fileid
|
||||
this.contentUrl = Path.join(`${global.RouterBasePath}/s/item/${itemId}`, encodeUriPath(videoFile.metadata.relPath))
|
||||
this.contentUrl = Path.join(`${global.RouterBasePath}/api/items/${itemId}/file/${videoFile.ino}`, encodeUriPath(videoFile.metadata.relPath))
|
||||
this.mimeType = videoFile.mimeType
|
||||
this.codec = videoFile.codec
|
||||
this.metadata = videoFile.metadata.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue