mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 10:51:37 +00:00
Compare commits
6 commits
a89a24e48e
...
3801ef062a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3801ef062a | ||
|
|
e4b9ac5446 | ||
|
|
9987d219f8 | ||
|
|
dc7045c562 | ||
|
|
2cc6e56bd1 | ||
|
|
8d1f460640 |
6 changed files with 9 additions and 8 deletions
|
|
@ -94,7 +94,6 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.processing = false
|
this.processing = false
|
||||||
this.$toast.success(`${this.episodes.length} episode${this.episodes.length > 1 ? 's' : ''} removed`)
|
|
||||||
this.show = false
|
this.show = false
|
||||||
this.$emit('clearSelected')
|
this.$emit('clearSelected')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ export default {
|
||||||
.$patch(`/api/podcasts/${this.libraryItem.id}/episode/${this.episodeId}`, updatePayload)
|
.$patch(`/api/podcasts/${this.libraryItem.id}/episode/${this.episodeId}`, updatePayload)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.isProcessing = false
|
this.isProcessing = false
|
||||||
this.$toast.success('Podcast episode updated')
|
this.$toast.success(this.$strings.ToastPodcastEpisodeUpdated)
|
||||||
this.$emit('selectTab', 'details')
|
this.$emit('selectTab', 'details')
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
||||||
|
|
@ -1096,6 +1096,7 @@
|
||||||
"ToastPlaylistUpdateSuccess": "Playlist updated",
|
"ToastPlaylistUpdateSuccess": "Playlist updated",
|
||||||
"ToastPodcastCreateFailed": "Failed to create podcast",
|
"ToastPodcastCreateFailed": "Failed to create podcast",
|
||||||
"ToastPodcastCreateSuccess": "Podcast created successfully",
|
"ToastPodcastCreateSuccess": "Podcast created successfully",
|
||||||
|
"ToastPodcastEpisodeUpdated": "Episode updated",
|
||||||
"ToastPodcastGetFeedFailed": "Failed to get podcast feed",
|
"ToastPodcastGetFeedFailed": "Failed to get podcast feed",
|
||||||
"ToastPodcastNoEpisodesInFeed": "No episodes found in RSS feed",
|
"ToastPodcastNoEpisodesInFeed": "No episodes found in RSS feed",
|
||||||
"ToastPodcastNoRssFeed": "Podcast does not have an RSS feed",
|
"ToastPodcastNoRssFeed": "Podcast does not have an RSS feed",
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ class Stream extends EventEmitter {
|
||||||
|
|
||||||
async generatePlaylist() {
|
async generatePlaylist() {
|
||||||
await fs.ensureDir(this.streamPath)
|
await fs.ensureDir(this.streamPath)
|
||||||
await hlsPlaylistGenerator(this.playlistPath, 'output', this.totalDuration, this.segmentLength, this.hlsSegmentType, this.userToken)
|
await hlsPlaylistGenerator(this.playlistPath, 'output', this.totalDuration, this.segmentLength, this.hlsSegmentType)
|
||||||
return this.clientPlaylistUri
|
return this.clientPlaylistUri
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ module.exports.downloadPodcastEpisode = (podcastEpisodeDownload) => {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
responseType: 'stream',
|
responseType: 'stream',
|
||||||
headers: {
|
headers: {
|
||||||
|
'Accept': '*/*',
|
||||||
'User-Agent': userAgent
|
'User-Agent': userAgent
|
||||||
},
|
},
|
||||||
timeout: global.PodcastDownloadTimeout
|
timeout: global.PodcastDownloadTimeout
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
const fs = require('../../libs/fsExtra')
|
const fs = require('../../libs/fsExtra')
|
||||||
|
|
||||||
function getPlaylistStr(segmentName, duration, segmentLength, hlsSegmentType, token) {
|
function getPlaylistStr(segmentName, duration, segmentLength, hlsSegmentType) {
|
||||||
var ext = hlsSegmentType === 'fmp4' ? 'm4s' : 'ts'
|
var ext = hlsSegmentType === 'fmp4' ? 'm4s' : 'ts'
|
||||||
|
|
||||||
var lines = [
|
var lines = [
|
||||||
|
|
@ -18,18 +18,18 @@ function getPlaylistStr(segmentName, duration, segmentLength, hlsSegmentType, to
|
||||||
var lastSegment = duration - (numSegments * segmentLength)
|
var lastSegment = duration - (numSegments * segmentLength)
|
||||||
for (let i = 0; i < numSegments; i++) {
|
for (let i = 0; i < numSegments; i++) {
|
||||||
lines.push(`#EXTINF:6,`)
|
lines.push(`#EXTINF:6,`)
|
||||||
lines.push(`${segmentName}-${i}.${ext}?token=${token}`)
|
lines.push(`${segmentName}-${i}.${ext}`)
|
||||||
}
|
}
|
||||||
if (lastSegment > 0) {
|
if (lastSegment > 0) {
|
||||||
lines.push(`#EXTINF:${lastSegment},`)
|
lines.push(`#EXTINF:${lastSegment},`)
|
||||||
lines.push(`${segmentName}-${numSegments}.${ext}?token=${token}`)
|
lines.push(`${segmentName}-${numSegments}.${ext}`)
|
||||||
}
|
}
|
||||||
lines.push('#EXT-X-ENDLIST')
|
lines.push('#EXT-X-ENDLIST')
|
||||||
return lines.join('\n')
|
return lines.join('\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
function generatePlaylist(outputPath, segmentName, duration, segmentLength, hlsSegmentType, token) {
|
function generatePlaylist(outputPath, segmentName, duration, segmentLength, hlsSegmentType) {
|
||||||
var playlistStr = getPlaylistStr(segmentName, duration, segmentLength, hlsSegmentType, token)
|
var playlistStr = getPlaylistStr(segmentName, duration, segmentLength, hlsSegmentType)
|
||||||
return fs.writeFile(outputPath, playlistStr)
|
return fs.writeFile(outputPath, playlistStr)
|
||||||
}
|
}
|
||||||
module.exports = generatePlaylist
|
module.exports = generatePlaylist
|
||||||
Loading…
Add table
Add a link
Reference in a new issue