Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: search videos, handle videos without channelName

Christian Fei304b76f37e93
diff --git a/lib/repository.js b/lib/repository.js
index f271aa6..df68a40 100644
--- a/lib/repository.js
+++ b/lib/repository.js
@@ -92,7 +92,9 @@ export default class Repository {
if (query.filter) {
const searchTerm = query.filter.toLowerCase()
if (searchTerm.startsWith('@')) {
- videos = videos.filter(v => {
+ videos = videos
+ .filter(v => v.channelName)
+ .filter(v => {
return v.channelName.toLowerCase().includes(searchTerm.substring(1))
})
} else {