Initial transcription support

This commit is contained in:
mfcar 2024-05-04 11:00:30 +01:00
parent 410801347c
commit b37a863c0a
No known key found for this signature in database
10 changed files with 227 additions and 63 deletions

View file

@ -1,5 +1,6 @@
<template> <template>
<div v-if="streamLibraryItem" id="mediaPlayerContainer" class="w-full fixed bottom-0 left-0 right-0 h-48 lg:h-40 z-50 bg-primary px-2 lg:px-4 pb-1 lg:pb-4 pt-2"> <div v-if="streamLibraryItem" id="mediaPlayerContainer" class="w-full fixed bottom-0 left-0 right-0 z-50 bg-primary px-2 lg:px-4 pb-1 lg:pb-4 pt-2"
:class="[showTranscriptionUi ? 'h-64' : 'h-48', showTranscriptionUi ? 'lg:h-64' : 'lg:h-40']">
<div id="videoDock" /> <div id="videoDock" />
<div class="absolute left-2 top-2 lg:left-4 cursor-pointer"> <div class="absolute left-2 top-2 lg:left-4 cursor-pointer">
<covers-book-cover expand-on-click :library-item="streamLibraryItem" :width="bookCoverWidth" :book-cover-aspect-ratio="coverAspectRatio" /> <covers-book-cover expand-on-click :library-item="streamLibraryItem" :width="bookCoverWidth" :book-cover-aspect-ratio="coverAspectRatio" />
@ -41,6 +42,7 @@
:sleep-timer-set="sleepTimerSet" :sleep-timer-set="sleepTimerSet"
:sleep-timer-remaining="sleepTimerRemaining" :sleep-timer-remaining="sleepTimerRemaining"
:is-podcast="isPodcast" :is-podcast="isPodcast"
:transcription-enabled="showTranscriptionUi"
@playPause="playPause" @playPause="playPause"
@jumpForward="jumpForward" @jumpForward="jumpForward"
@jumpBackward="jumpBackward" @jumpBackward="jumpBackward"
@ -51,8 +53,11 @@
@showBookmarks="showBookmarks" @showBookmarks="showBookmarks"
@showSleepTimer="showSleepTimerModal = true" @showSleepTimer="showSleepTimerModal = true"
@showPlayerQueueItems="showPlayerQueueItemsModal = true" @showPlayerQueueItems="showPlayerQueueItemsModal = true"
@showTranscription="showTranscriptionUi = !showTranscriptionUi"
/> />
<transcription-ui v-if="showTranscriptionUi"></transcription-ui>
<modals-bookmarks-modal v-model="showBookmarksModal" :bookmarks="bookmarks" :current-time="bookmarkCurrentTime" :library-item-id="libraryItemId" @select="selectBookmark" /> <modals-bookmarks-modal v-model="showBookmarksModal" :bookmarks="bookmarks" :current-time="bookmarkCurrentTime" :library-item-id="libraryItemId" @select="selectBookmark" />
<modals-sleep-timer-modal v-model="showSleepTimerModal" :timer-set="sleepTimerSet" :timer-time="sleepTimerTime" :remaining="sleepTimerRemaining" @set="setSleepTimer" @cancel="cancelSleepTimer" @increment="incrementSleepTimer" @decrement="decrementSleepTimer" /> <modals-sleep-timer-modal v-model="showSleepTimerModal" :timer-set="sleepTimerSet" :timer-time="sleepTimerTime" :remaining="sleepTimerRemaining" @set="setSleepTimer" @cancel="cancelSleepTimer" @increment="incrementSleepTimer" @decrement="decrementSleepTimer" />
@ -63,8 +68,10 @@
<script> <script>
import PlayerHandler from '@/players/PlayerHandler' import PlayerHandler from '@/players/PlayerHandler'
import TranscriptionUi from "@/components/player/TranscriptionUi.vue";
export default { export default {
components: {TranscriptionUi},
data() { data() {
return { return {
playerHandler: new PlayerHandler(this), playerHandler: new PlayerHandler(this),
@ -76,6 +83,7 @@ export default {
currentTime: 0, currentTime: 0,
showSleepTimerModal: false, showSleepTimerModal: false,
showPlayerQueueItemsModal: false, showPlayerQueueItemsModal: false,
showTranscriptionUi: false,
sleepTimerSet: false, sleepTimerSet: false,
sleepTimerTime: 0, sleepTimerTime: 0,
sleepTimerRemaining: 0, sleepTimerRemaining: 0,
@ -86,6 +94,17 @@ export default {
coverAspectRatio: 1 coverAspectRatio: 1
} }
}, },
watch: {
'playerHandler.playerState': function (newVal, oldVal) {
// Refresh the transcription UI when the player is changed
if (newVal === 'LOADED') {
this.showTranscriptionUi = false;
this.$nextTick(() => {
this.showTranscriptionUi = true;
});
}
},
},
computed: { computed: {
isSquareCover() { isSquareCover() {
return this.coverAspectRatio === 1 return this.coverAspectRatio === 1

View file

@ -36,6 +36,13 @@
</button> </button>
</ui-tooltip> </ui-tooltip>
<ui-tooltip direction="top" :text="$strings.LabelViewTranscription">
<button :aria-label="$strings.LabelViewTranscription" class="outline-none text-gray-300 mx-1 lg:mx-2 hover:text-white" @mousedown.prevent @mouseup.prevent @click.stop="$emit('showTranscription')">
<span v-if="!transcriptionEnabled" class="material-icons text-2xl">subtitles</span>
<span v-else class="material-icons text-2xl text-warning">subtitles</span>
</button>
</ui-tooltip>
<ui-tooltip v-if="chapters.length" direction="top" :text="useChapterTrack ? $strings.LabelUseFullTrack : $strings.LabelUseChapterTrack"> <ui-tooltip v-if="chapters.length" direction="top" :text="useChapterTrack ? $strings.LabelUseFullTrack : $strings.LabelUseChapterTrack">
<button :aria-label="useChapterTrack ? $strings.LabelUseFullTrack : $strings.LabelUseChapterTrack" class="text-gray-300 mx-1 lg:mx-2 hover:text-white" @mousedown.prevent @mouseup.prevent @click.stop="setUseChapterTrack"> <button :aria-label="useChapterTrack ? $strings.LabelUseFullTrack : $strings.LabelUseChapterTrack" class="text-gray-300 mx-1 lg:mx-2 hover:text-white" @mousedown.prevent @mouseup.prevent @click.stop="setUseChapterTrack">
<span class="material-icons text-2xl sm:text-3xl transform transition-transform" :class="useChapterTrack ? 'rotate-180' : ''">timelapse</span> <span class="material-icons text-2xl sm:text-3xl transform transition-transform" :class="useChapterTrack ? 'rotate-180' : ''">timelapse</span>
@ -78,7 +85,8 @@ export default {
}, },
sleepTimerSet: Boolean, sleepTimerSet: Boolean,
sleepTimerRemaining: Number, sleepTimerRemaining: Number,
isPodcast: Boolean isPodcast: Boolean,
transcriptionEnabled: Boolean
}, },
data() { data() {
return { return {
@ -368,4 +376,4 @@ export default {
left: 100%; left: 100%;
} }
} }
</style> </style>

View file

@ -0,0 +1,29 @@
<template>
<div :class="{ 'text-warning': isActive }">
<div v-html="cue.text"></div>
</div>
</template>
<script>
export default {
props: {
cue: VTTCue
},
data() {
return {
isActive: false
};
},
created() {
this.cue.onenter = () => (this.isActive = true);
this.cue.onexit = () => (this.isActive = false);
},
watch: {
isActive(newVal) {
if (newVal) {
this.$el.scrollIntoView({behavior: 'smooth'});
}
}
}
};
</script>

View file

@ -0,0 +1,40 @@
<template>
<div id="transcription-panel">
<transcription-line
v-for="(cue, index) in cues"
:key="index"
:cue="cue"
ref="transcriptionLine + index"
></transcription-line>
</div>
</template>
<script>
import TranscriptionLine from "./TranscriptionLine.vue";
export default {
components: {
TranscriptionLine
},
data() {
return {
cues: [],
};
},
mounted() {
this.init()
},
methods: {
init() {
const trackElement = document.getElementById("transcription-track");
this.cues = trackElement.track.cues;
},
},
};
</script>
<style>
#transcription-panel {
max-height: 75px;
overflow-y: auto;
}
</style>

View file

@ -1,32 +1,43 @@
export default class AudioTrack { export default class AudioTrack {
constructor(track, userToken) { constructor(track, userToken) {
this.index = track.index || 0 this.index = track.index || 0
this.startOffset = track.startOffset || 0 // Total time of all previous tracks this.startOffset = track.startOffset || 0 // Total time of all previous tracks
this.duration = track.duration || 0 this.duration = track.duration || 0
this.title = track.title || '' this.title = track.title || ''
this.contentUrl = track.contentUrl || null this.contentUrl = track.contentUrl || null
this.mimeType = track.mimeType this.transcriptUrl = track.transcriptUrl || null
this.metadata = track.metadata || {} this.mimeType = track.mimeType
this.metadata = track.metadata || {}
this.userToken = userToken this.userToken = userToken
}
get fullContentUrl() {
if (!this.contentUrl || this.contentUrl.startsWith('http')) return this.contentUrl
if (process.env.NODE_ENV === 'development') {
return `${process.env.serverUrl}${this.contentUrl}?token=${this.userToken}`
}
return `${window.location.origin}${this.contentUrl}?token=${this.userToken}`
}
get relativeContentUrl() {
if (!this.contentUrl || this.contentUrl.startsWith('http')) return this.contentUrl
if (process.env.NODE_ENV === 'development') {
return `${process.env.serverUrl}${this.contentUrl}?token=${this.userToken}`
} }
return this.contentUrl + `?token=${this.userToken}` get fullContentUrl() {
} if (!this.contentUrl || this.contentUrl.startsWith('http')) return this.contentUrl
}
if (process.env.NODE_ENV === 'development') {
return `${process.env.serverUrl}${this.contentUrl}?token=${this.userToken}`
}
return `${window.location.origin}${this.contentUrl}?token=${this.userToken}`
}
get relativeContentUrl() {
if (!this.contentUrl || this.contentUrl.startsWith('http')) return this.contentUrl
if (process.env.NODE_ENV === 'development') {
return `${process.env.serverUrl}${this.contentUrl}?token=${this.userToken}`
}
return this.contentUrl + `?token=${this.userToken}`
}
get relativeTranscriptionUrl() {
if (!this.transcriptUrl || this.transcriptUrl.startsWith('http')) return this.transcriptUrl
if (process.env.NODE_ENV === 'development') {
return `${process.env.serverUrl}${this.transcriptUrl}?token=${this.userToken}`
}
return this.transcriptUrl + `?token=${this.userToken}`
}
}

View file

@ -35,6 +35,8 @@ export default class LocalAudioPlayer extends EventEmitter {
var audioEl = document.createElement('audio') var audioEl = document.createElement('audio')
audioEl.id = 'audio-player' audioEl.id = 'audio-player'
audioEl.style.display = 'none' audioEl.style.display = 'none'
audioEl.crossOrigin = 'anonymous'
document.body.appendChild(audioEl) document.body.appendChild(audioEl)
this.player = audioEl this.player = audioEl
@ -135,6 +137,18 @@ export default class LocalAudioPlayer extends EventEmitter {
this.usingNativeplayer = true this.usingNativeplayer = true
this.player.src = this.currentTrack.relativeContentUrl this.player.src = this.currentTrack.relativeContentUrl
this.player.currentTime = this.startTime this.player.currentTime = this.startTime
if (document.getElementById('transcription-track')) {
document.getElementById('transcription-track').remove()
}
const trackElement = document.createElement("track");
trackElement.id = "transcription-track";
trackElement.kind = "subtitles";
trackElement.label = "Transcription";
trackElement.default = true;
trackElement.src = this.currentTrack.relativeTranscriptionUrl;
this.player.appendChild(trackElement);
return return
} }
@ -168,7 +182,7 @@ export default class LocalAudioPlayer extends EventEmitter {
this.hlsInstance.attachMedia(this.player) this.hlsInstance.attachMedia(this.player)
this.hlsInstance.on(Hls.Events.MEDIA_ATTACHED, () => { this.hlsInstance.on(Hls.Events.MEDIA_ATTACHED, () => {
this.hlsInstance.loadSource(this.currentTrack.relativeContentUrl) this.hlsInstance.loadSource(this.currentTrack.relativeContentUrl)
this.hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => { this.hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => {
console.log('[HLS] Manifest Parsed') console.log('[HLS] Manifest Parsed')
@ -206,6 +220,19 @@ export default class LocalAudioPlayer extends EventEmitter {
this.trackStartTime = Math.max(0, this.startTime - (this.currentTrack.startOffset || 0)) this.trackStartTime = Math.max(0, this.startTime - (this.currentTrack.startOffset || 0))
this.player.src = this.currentTrack.relativeContentUrl this.player.src = this.currentTrack.relativeContentUrl
console.log(`[LocalPlayer] Loading track src ${this.currentTrack.relativeContentUrl}`) console.log(`[LocalPlayer] Loading track src ${this.currentTrack.relativeContentUrl}`)
if (document.getElementById('transcription-track')) {
document.getElementById('transcription-track').remove()
}
const trackElement = document.createElement("track");
trackElement.id = "transcription-track";
trackElement.kind = "subtitles";
trackElement.label = "Transcription";
trackElement.default = true;
trackElement.src = this.currentTrack.relativeTranscriptionUrl;
this.player.appendChild(trackElement);
this.player.load() this.player.load()
} }
@ -338,4 +365,4 @@ export default class LocalAudioPlayer extends EventEmitter {
var last = bufferedRanges[bufferedRanges.length - 1] var last = bufferedRanges[bufferedRanges.length - 1]
return last.end return last.end
} }
} }

View file

@ -562,6 +562,7 @@
"LabelViewBookmarks": "View bookmarks", "LabelViewBookmarks": "View bookmarks",
"LabelViewChapters": "View chapters", "LabelViewChapters": "View chapters",
"LabelViewQueue": "View player queue", "LabelViewQueue": "View player queue",
"LabelViewTranscription": "View transcription",
"LabelVolume": "Volume", "LabelVolume": "Volume",
"LabelWeekdaysToRun": "Weekdays to run", "LabelWeekdaysToRun": "Weekdays to run",
"LabelYearReviewHide": "Hide Year in Review", "LabelYearReviewHide": "Hide Year in Review",
@ -779,4 +780,4 @@
"ToastSocketFailedToConnect": "Socket failed to connect", "ToastSocketFailedToConnect": "Socket failed to connect",
"ToastUserDeleteFailed": "Failed to delete user", "ToastUserDeleteFailed": "Failed to delete user",
"ToastUserDeleteSuccess": "User deleted" "ToastUserDeleteSuccess": "User deleted"
} }

View file

@ -22,9 +22,9 @@ class LibraryItemController {
* Optional query params: * Optional query params:
* ?include=progress,rssfeed,downloads * ?include=progress,rssfeed,downloads
* ?expanded=1 * ?expanded=1
* *
* @param {import('express').Request} req * @param {import('express').Request} req
* @param {import('express').Response} res * @param {import('express').Response} res
*/ */
async findOne(req, res) { async findOne(req, res) {
const includeEntities = (req.query.include || '').split(',') const includeEntities = (req.query.include || '').split(',')
@ -88,9 +88,9 @@ class LibraryItemController {
/** /**
* GET: /api/items/:id/download * GET: /api/items/:id/download
* Download library item. Zip file if multiple files. * Download library item. Zip file if multiple files.
* *
* @param {import('express').Request} req * @param {import('express').Request} req
* @param {import('express').Response} res * @param {import('express').Response} res
*/ */
download(req, res) { download(req, res) {
if (!req.user.canDownload) { if (!req.user.canDownload) {
@ -120,9 +120,9 @@ class LibraryItemController {
/** /**
* PATCH: /items/:id/media * PATCH: /items/:id/media
* Update media for a library item. Will create new authors & series when necessary * Update media for a library item. Will create new authors & series when necessary
* *
* @param {import('express').Request} req * @param {import('express').Request} req
* @param {import('express').Response} res * @param {import('express').Response} res
*/ */
async updateMedia(req, res) { async updateMedia(req, res) {
const libraryItem = req.libraryItem const libraryItem = req.libraryItem
@ -252,9 +252,9 @@ class LibraryItemController {
/** /**
* GET: api/items/:id/cover * GET: api/items/:id/cover
* *
* @param {import('express').Request} req * @param {import('express').Request} req
* @param {import('express').Response} res * @param {import('express').Response} res
*/ */
async getCover(req, res) { async getCover(req, res) {
const { query: { width, height, format, raw } } = req const { query: { width, height, format, raw } } = req
@ -593,9 +593,9 @@ class LibraryItemController {
/** /**
* GET api/items/:id/ffprobe/:fileid * GET api/items/:id/ffprobe/:fileid
* FFProbe JSON result from audio file * FFProbe JSON result from audio file
* *
* @param {express.Request} req * @param {express.Request} req
* @param {express.Response} res * @param {express.Response} res
*/ */
async getFFprobeData(req, res) { async getFFprobeData(req, res) {
if (!req.user.isAdminOrUp) { if (!req.user.isAdminOrUp) {
@ -619,9 +619,9 @@ class LibraryItemController {
/** /**
* GET api/items/:id/file/:fileid * GET api/items/:id/file/:fileid
* *
* @param {express.Request} req * @param {express.Request} req
* @param {express.Response} res * @param {express.Response} res
*/ */
async getLibraryFile(req, res) { async getLibraryFile(req, res) {
const libraryFile = req.libraryFile const libraryFile = req.libraryFile
@ -641,10 +641,35 @@ class LibraryItemController {
} }
/** /**
* DELETE api/items/:id/file/:fileid * GET api/items/:id/file/:fileid/transcript
* *
* @param {express.Request} req * @param {express.Request} req
* @param {express.Response} res * @param {express.Response} res
*/
async getTranscriptionFile(req, res) {
const libraryFile = req.libraryFile
const baseName = Path.basename(libraryFile.metadata.path, Path.extname(libraryFile.metadata.path));
const vttFilePath = Path.join(Path.dirname(libraryFile.metadata.path), `${baseName}.vtt`);
if (global.XAccel) {
const encodedURI = encodeUriPath(global.XAccel + vttFilePath)
Logger.debug(`Use X-Accel to serve static file ${encodedURI}`)
return res.status(204).header({ 'X-Accel-Redirect': encodedURI }).send()
}
// Set the correct mimetype for .vtt files
res.setHeader('Content-Type', 'text/vtt');
res.sendFile(vttFilePath);
}
/**
* DELETE api/items/:id/file/:fileid
*
* @param {express.Request} req
* @param {express.Response} res
*/ */
async deleteLibraryFile(req, res) { async deleteLibraryFile(req, res) {
const libraryFile = req.libraryFile const libraryFile = req.libraryFile
@ -672,7 +697,7 @@ class LibraryItemController {
* GET api/items/:id/file/:fileid/download * GET api/items/:id/file/:fileid/download
* Same as GET api/items/:id/file/:fileid but allows logging and restricting downloads * Same as GET api/items/:id/file/:fileid but allows logging and restricting downloads
* @param {express.Request} req * @param {express.Request} req
* @param {express.Response} res * @param {express.Response} res
*/ */
async downloadLibraryFile(req, res) { async downloadLibraryFile(req, res) {
const libraryFile = req.libraryFile const libraryFile = req.libraryFile
@ -704,9 +729,9 @@ class LibraryItemController {
* fileid is the inode value stored in LibraryFile.ino or EBookFile.ino * fileid is the inode value stored in LibraryFile.ino or EBookFile.ino
* fileid is only required when reading a supplementary ebook * fileid is only required when reading a supplementary ebook
* when no fileid is passed in the primary ebook will be returned * when no fileid is passed in the primary ebook will be returned
* *
* @param {express.Request} req * @param {express.Request} req
* @param {express.Response} res * @param {express.Response} res
*/ */
async getEBookFile(req, res) { async getEBookFile(req, res) {
let ebookFile = null let ebookFile = null
@ -740,9 +765,9 @@ class LibraryItemController {
* toggle the status of an ebook file. * toggle the status of an ebook file.
* if an ebook file is the primary ebook, then it will be changed to supplementary * if an ebook file is the primary ebook, then it will be changed to supplementary
* if an ebook file is supplementary, then it will be changed to primary * if an ebook file is supplementary, then it will be changed to primary
* *
* @param {express.Request} req * @param {express.Request} req
* @param {express.Response} res * @param {express.Response} res
*/ */
async updateEbookFileStatus(req, res) { async updateEbookFileStatus(req, res) {
const ebookLibraryFile = req.libraryItem.libraryFiles.find(lf => lf.ino === req.params.fileid) const ebookLibraryFile = req.libraryItem.libraryFiles.find(lf => lf.ino === req.params.fileid)
@ -797,4 +822,4 @@ class LibraryItemController {
next() next()
} }
} }
module.exports = new LibraryItemController() module.exports = new LibraryItemController()

View file

@ -5,6 +5,7 @@ class AudioTrack {
this.duration = null this.duration = null
this.title = null this.title = null
this.contentUrl = null this.contentUrl = null
this.transcriptUrl = null
this.mimeType = null this.mimeType = null
this.codec = null this.codec = null
this.metadata = null this.metadata = null
@ -17,6 +18,7 @@ class AudioTrack {
duration: this.duration, duration: this.duration,
title: this.title, title: this.title,
contentUrl: this.contentUrl, contentUrl: this.contentUrl,
transcriptUrl: this.transcriptUrl,
mimeType: this.mimeType, mimeType: this.mimeType,
codec: this.codec, codec: this.codec,
metadata: this.metadata?.toJSON() || null metadata: this.metadata?.toJSON() || null
@ -30,6 +32,7 @@ class AudioTrack {
this.title = audioFile.metadata.filename || '' this.title = audioFile.metadata.filename || ''
this.contentUrl = `${global.RouterBasePath}/api/items/${itemId}/file/${audioFile.ino}` 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.mimeType = audioFile.mimeType
this.codec = audioFile.codec || null this.codec = audioFile.codec || null
this.metadata = audioFile.metadata.clone() this.metadata = audioFile.metadata.clone()
@ -44,4 +47,4 @@ class AudioTrack {
this.mimeType = 'application/vnd.apple.mpegurl' this.mimeType = 'application/vnd.apple.mpegurl'
} }
} }
module.exports = AudioTrack module.exports = AudioTrack

View file

@ -116,6 +116,7 @@ class ApiRouter {
this.router.post('/items/:id/chapters', LibraryItemController.middleware.bind(this), LibraryItemController.updateMediaChapters.bind(this)) this.router.post('/items/:id/chapters', LibraryItemController.middleware.bind(this), LibraryItemController.updateMediaChapters.bind(this))
this.router.get('/items/:id/ffprobe/:fileid', LibraryItemController.middleware.bind(this), LibraryItemController.getFFprobeData.bind(this)) this.router.get('/items/:id/ffprobe/:fileid', LibraryItemController.middleware.bind(this), LibraryItemController.getFFprobeData.bind(this))
this.router.get('/items/:id/file/:fileid', LibraryItemController.middleware.bind(this), LibraryItemController.getLibraryFile.bind(this)) this.router.get('/items/:id/file/:fileid', LibraryItemController.middleware.bind(this), LibraryItemController.getLibraryFile.bind(this))
this.router.get('/items/:id/file/:fileid/transcript', LibraryItemController.middleware.bind(this), LibraryItemController.getTranscriptionFile.bind(this))
this.router.delete('/items/:id/file/:fileid', LibraryItemController.middleware.bind(this), LibraryItemController.deleteLibraryFile.bind(this)) this.router.delete('/items/:id/file/:fileid', LibraryItemController.middleware.bind(this), LibraryItemController.deleteLibraryFile.bind(this))
this.router.get('/items/:id/file/:fileid/download', LibraryItemController.middleware.bind(this), LibraryItemController.downloadLibraryFile.bind(this)) this.router.get('/items/:id/file/:fileid/download', LibraryItemController.middleware.bind(this), LibraryItemController.downloadLibraryFile.bind(this))
this.router.get('/items/:id/ebook/:fileid?', LibraryItemController.middleware.bind(this), LibraryItemController.getEBookFile.bind(this)) this.router.get('/items/:id/ebook/:fileid?', LibraryItemController.middleware.bind(this), LibraryItemController.getEBookFile.bind(this))
@ -425,9 +426,9 @@ class ApiRouter {
/** /**
* Used when a series is removed from a book * Used when a series is removed from a book
* Series is removed if it only has 1 book * Series is removed if it only has 1 book
* *
* @param {string} bookId * @param {string} bookId
* @param {string[]} seriesIds * @param {string[]} seriesIds
*/ */
async checkRemoveEmptySeries(bookId, seriesIds) { async checkRemoveEmptySeries(bookId, seriesIds) {
if (!seriesIds?.length) return if (!seriesIds?.length) return
@ -455,7 +456,7 @@ class ApiRouter {
/** /**
* Remove an empty series & close an open RSS feed * Remove an empty series & close an open RSS feed
* @param {import('../models/Series')} series * @param {import('../models/Series')} series
*/ */
async removeEmptySeries(series) { async removeEmptySeries(series) {
await this.rssFeedManager.closeFeedForEntityId(series.id) await this.rssFeedManager.closeFeedForEntityId(series.id)