mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 18:24:46 +02:00
Podcast episode player fixes, episode table ui updates
This commit is contained in:
parent
0e665e2091
commit
12027b9a76
13 changed files with 47 additions and 22 deletions
|
@ -62,6 +62,7 @@ class PodcastController {
|
|||
|
||||
// Download and save cover image
|
||||
if (payload.media.metadata.imageUrl) {
|
||||
// TODO: Scan cover image to library files
|
||||
var coverResponse = await this.coverManager.downloadCoverFromUrl(libraryItem, payload.media.metadata.imageUrl)
|
||||
if (coverResponse) {
|
||||
if (coverResponse.error) {
|
||||
|
|
|
@ -84,9 +84,11 @@ class PodcastManager {
|
|||
Logger.error(`[PodcastManager] Podcast Episode finished but library item was not found ${this.currentDownload.libraryItem.id}`)
|
||||
return false
|
||||
}
|
||||
|
||||
var podcastEpisode = this.currentDownload.podcastEpisode
|
||||
podcastEpisode.audioFile = audioFile
|
||||
libraryItem.media.addPodcastEpisode(podcastEpisode)
|
||||
libraryItem.libraryFiles.push(libraryFile)
|
||||
libraryItem.updatedAt = Date.now()
|
||||
await this.db.updateLibraryItem(libraryItem)
|
||||
this.emitter('item_updated', libraryItem.toJSONExpanded())
|
||||
|
|
|
@ -24,7 +24,7 @@ class PodcastEpisodeDownload {
|
|||
}
|
||||
|
||||
get targetRelPath() {
|
||||
return Path.join(this.libraryItem.relPath, this.targetFilename)
|
||||
return this.targetFilename
|
||||
}
|
||||
|
||||
setData(podcastEpisode, libraryItem) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const Path = require('path')
|
||||
|
||||
const { encodeUriPath } = require('../../utils/index')
|
||||
class AudioTrack {
|
||||
constructor() {
|
||||
this.index = null
|
||||
|
@ -26,7 +26,7 @@ class AudioTrack {
|
|||
this.startOffset = startOffset
|
||||
this.duration = audioFile.duration
|
||||
this.title = audioFile.metadata.filename || ''
|
||||
this.contentUrl = Path.join(`/s/item/${itemId}`, audioFile.metadata.relPath)
|
||||
this.contentUrl = Path.join(`/s/item/${itemId}`, encodeUriPath(audioFile.metadata.relPath))
|
||||
this.mimeType = audioFile.mimeType
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
const Logger = require('../../Logger')
|
||||
const PodcastEpisode = require('../entities/PodcastEpisode')
|
||||
const PodcastMetadata = require('../metadata/PodcastMetadata')
|
||||
const { areEquivalent, copyValue } = require('../../utils/index')
|
||||
|
|
|
@ -18,6 +18,7 @@ class StaticRouter {
|
|||
|
||||
var remainingPath = req.params['0']
|
||||
var fullPath = Path.join(item.path, remainingPath)
|
||||
console.log('fullpath', fullPath)
|
||||
res.sendFile(fullPath)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -117,4 +117,8 @@ module.exports.copyValue = (val) => {
|
|||
}
|
||||
return final
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.encodeUriPath = (path) => {
|
||||
return path.replace(/\\/g, '/').replace(/%/g, '%25').replace(/#/g, '%23')
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue