Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

refactor: simplify video data validation in getVideosFor function

Christian Feiedae44ed3a24
diff --git a/lib/youtube.js b/lib/youtube.js
index 6ebc9d6..5e95a22 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -143,12 +143,8 @@ export async function getVideosFor (channelName) {
function toInternalVideo (v) {
if (!v || !v.richItemRenderer) return
const data = v.richItemRenderer.content.videoRenderer
- if (!data) {
- console.warn('Missing videoRenderer data:', v)
- return
- }
+ if (!data) return
- // Ensure viewCountText exists before accessing simpleText
const viewCount = data.viewCountText?.simpleText || '0 views'
return {