diff --git a/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js b/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js index 4f5a944e4..ed9c0fbf1 100644 --- a/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js +++ b/src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js @@ -119,7 +119,7 @@ export default defineComponent({ if (typeof (playlist.playlistName) !== 'string') { return false } if (this.doSearchPlaylistsWithMatchingVideos) { - if (playlist.videos.some((v) => v.title.toLowerCase().includes(this.processedQuery))) { + if (playlist.videos.some((v) => v.author.toLowerCase().includes(this.processedQuery) || v.title.toLowerCase().includes(this.processedQuery))) { return true } } diff --git a/src/renderer/views/History/History.js b/src/renderer/views/History/History.js index ffa871ea2..0a494d7c5 100644 --- a/src/renderer/views/History/History.js +++ b/src/renderer/views/History/History.js @@ -93,11 +93,13 @@ export default defineComponent({ } else { const lowerCaseQuery = this.query.toLowerCase() const filteredQuery = this.historyCacheSorted.filter((video) => { - if (typeof (video.title) !== 'string' || typeof (video.author) !== 'string') { - return false - } else { - return video.title.toLowerCase().includes(lowerCaseQuery) || video.author.toLowerCase().includes(lowerCaseQuery) + if (typeof (video.title) === 'string' && video.title.toLowerCase().includes(lowerCaseQuery)) { + return true + } else if (typeof (video.author) === 'string' && video.author.toLowerCase().includes(lowerCaseQuery)) { + return true } + + return false }).sort((a, b) => { return b.timeWatched - a.timeWatched }) diff --git a/src/renderer/views/Playlist/Playlist.js b/src/renderer/views/Playlist/Playlist.js index 936f96abe..73183f381 100644 --- a/src/renderer/views/Playlist/Playlist.js +++ b/src/renderer/views/Playlist/Playlist.js @@ -142,7 +142,13 @@ export default defineComponent({ if (this.processedVideoSearchQuery === '') { return this.playlistItems } return this.playlistItems.filter((v) => { - return v.title.toLowerCase().includes(this.processedVideoSearchQuery) + if (typeof (v.title) === 'string' && v.title.toLowerCase().includes(this.processedVideoSearchQuery)) { + return true + } else if (typeof (v.author) === 'string' && v.author.toLowerCase().includes(this.processedVideoSearchQuery)) { + return true + } + + return false }) }, visiblePlaylistItems: function () { diff --git a/src/renderer/views/UserPlaylists/UserPlaylists.js b/src/renderer/views/UserPlaylists/UserPlaylists.js index e4d7f3f28..1be2a9bdc 100644 --- a/src/renderer/views/UserPlaylists/UserPlaylists.js +++ b/src/renderer/views/UserPlaylists/UserPlaylists.js @@ -223,7 +223,7 @@ export default defineComponent({ if (typeof (playlist.playlistName) !== 'string') { return false } if (this.doSearchPlaylistsWithMatchingVideos) { - if (playlist.videos.some((v) => v.title.toLowerCase().includes(this.lowerCaseQuery))) { + if (playlist.videos.some((v) => v.author.toLowerCase().includes(this.lowerCaseQuery) || v.title.toLowerCase().includes(this.lowerCaseQuery))) { return true } }