mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-04 22:16:28 +01:00
Do no delete if darabase update fails
This commit is contained in:
1 parent
177b945c60
commit
dc0afcce79
2 files changed
+8
-6
No files matched your search
@@ -799,15 +799,15 @@ class PodcastController {
|
||||
removedEpisodes.push(episode)
|
||||
}
|
||||
|
||||
if (hardDelete) {
|
||||
await removeEpisodeAudioFiles(removedEpisodes)
|
||||
}
|
||||
|
||||
const removedEpisodeIds = removedEpisodes.map((ep) => ep.id)
|
||||
await Database.playlistModel.removeMediaItemsFromPlaylists(removedEpisodeIds)
|
||||
await deleteEpisodesInTransaction(removedEpisodeIds, matchedByLibraryItem)
|
||||
libraryItemsPodcastFilters.clearCountCache('podcastEpisode', 'afterDestroy')
|
||||
|
||||
if (hardDelete) {
|
||||
await removeEpisodeAudioFiles(removedEpisodes)
|
||||
}
|
||||
|
||||
for (const [libraryItem, episodesToRemove] of matchedByLibraryItem) {
|
||||
Logger.info(`[PodcastController] Batch deleted ${episodesToRemove.length} episode(s) from podcast "${libraryItem.media.title}"`)
|
||||
SocketAuthority.libraryItemEmitter('item_updated', libraryItem)
|
||||
|
||||
Reference in new issue
Block a user