Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

less filtering of videos based on date and count

Christian Fei9a86a571974e
diff --git a/lib/repository.js b/lib/repository.js
index 694ceb9..d885992 100644
--- a/lib/repository.js
+++ b/lib/repository.js
@@ -33,9 +33,8 @@ export default class Repository {
}
getVideos () {
return this.videos
- // .filter(v => !v.ignored)
.sort((a, b) => +new Date(b.publishedAt) - +new Date(a.publishedAt))
- .filter((_, i) => i < 100)
+ // .filter((_, i) => i < 100)
}
getVideo(id) {
return this.videos.find(v => v.id === id)
diff --git a/lib/youtube.js b/lib/youtube.js
index 2c2e697..baa31fb 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -71,7 +71,7 @@ export async function getVideosFor(channelName) {
return videoContents
.map(toInternalVideo)
.filter(Boolean)
- .filter(v => v.publishedAt > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000))
+ .filter(v => v.publishedAt > new Date(Date.now() - 31 * 24 * 60 * 60 * 1000))
.filter((_,i) => i < 10)
} catch (error) {
console.error('Error fetching latest video:', error.message)