diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue
index 8c680462..4bf8cfbb 100644
--- a/client/components/app/BookShelfCategorized.vue
+++ b/client/components/app/BookShelfCategorized.vue
@@ -217,6 +217,16 @@ export default {
})
}
+ if (this.results.episodes?.length) {
+ shelves.push({
+ id: 'episodes',
+ label: 'Episodes',
+ labelStringKey: 'LabelEpisodes',
+ type: 'episode',
+ entities: this.results.episodes.map((res) => res.libraryItem)
+ })
+ }
+
if (this.results.series?.length) {
shelves.push({
id: 'series',
diff --git a/client/components/cards/EpisodeSearchCard.vue b/client/components/cards/EpisodeSearchCard.vue
index e69de29b..8be6a3a3 100644
--- a/client/components/cards/EpisodeSearchCard.vue
+++ b/client/components/cards/EpisodeSearchCard.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
{{ episodeTitle }}
+
{{ podcastTitle }}
+
+
+
+
+
+
+
diff --git a/client/components/controls/GlobalSearch.vue b/client/components/controls/GlobalSearch.vue
index bc9a2368..185257a3 100644
--- a/client/components/controls/GlobalSearch.vue
+++ b/client/components/controls/GlobalSearch.vue
@@ -39,6 +39,15 @@
+
{{ $strings.LabelEpisodes }}
+
+
+
+
+
+
+
+
{{ $strings.LabelAuthors }}
@@ -100,6 +109,7 @@ export default {
isFetching: false,
search: null,
podcastResults: [],
+ episodeResults: [],
bookResults: [],
authorResults: [],
seriesResults: [],
@@ -132,6 +142,7 @@ export default {
this.search = null
this.lastSearch = null
this.podcastResults = []
+ this.episodeResults = []
this.bookResults = []
this.authorResults = []
this.seriesResults = []
@@ -175,6 +186,7 @@ export default {
if (!this.isFetching) return
this.podcastResults = searchResults.podcast || []
+ this.episodeResults = searchResults.episodes || []
this.bookResults = searchResults.book || []
this.authorResults = searchResults.authors || []
this.seriesResults = searchResults.series || []
diff --git a/client/pages/library/_library/search.vue b/client/pages/library/_library/search.vue
index 653fc3de..429603bf 100644
--- a/client/pages/library/_library/search.vue
+++ b/client/pages/library/_library/search.vue
@@ -22,6 +22,7 @@ export default {
})
results = {
podcasts: results?.podcast || [],
+ episodes: results?.episodes || [],
books: results?.book || [],
authors: results?.authors || [],
series: results?.series || [],
@@ -61,6 +62,7 @@ export default {
})
this.results = {
podcasts: results?.podcast || [],
+ episodes: results?.episodes || [],
books: results?.book || [],
authors: results?.authors || [],
series: results?.series || [],
diff --git a/server/utils/queries/libraryItemsPodcastFilters.js b/server/utils/queries/libraryItemsPodcastFilters.js
index c71e0dc8..68097c1b 100644
--- a/server/utils/queries/libraryItemsPodcastFilters.js
+++ b/server/utils/queries/libraryItemsPodcastFilters.js
@@ -411,6 +411,43 @@ module.exports = {
})
}
+ // Search podcast episode title
+ const podcastEpisodes = await Database.podcastEpisodeModel.findAll({
+ where: [
+ Sequelize.literal(textSearchQuery.matchExpression('podcastEpisode.title')),
+ {
+ '$podcast.libraryItem.libraryId$': library.id
+ }
+ ],
+ replacements: userPermissionPodcastWhere.replacements,
+ include: [
+ {
+ model: Database.podcastModel,
+ where: [...userPermissionPodcastWhere.podcastWhere],
+ include: [
+ {
+ model: Database.libraryItemModel
+ }
+ ]
+ }
+ ],
+ distinct: true,
+ offset,
+ limit
+ })
+ const episodeMatches = []
+ for (const episode of podcastEpisodes) {
+ const libraryItem = episode.podcast.libraryItem
+ libraryItem.media = episode.podcast
+ libraryItem.media.podcastEpisodes = []
+ const oldPodcastEpisodeJson = episode.toOldJSONExpanded(libraryItem.id)
+ const libraryItemJson = libraryItem.toOldJSONExpanded()
+ libraryItemJson.recentEpisode = oldPodcastEpisodeJson
+ episodeMatches.push({
+ libraryItem: libraryItemJson
+ })
+ }
+
const matchJsonValue = textSearchQuery.matchExpression('json_each.value')
// Search tags
@@ -450,7 +487,8 @@ module.exports = {
return {
podcast: itemMatches,
tags: tagMatches,
- genres: genreMatches
+ genres: genreMatches,
+ episodes: episodeMatches
}
},