Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

docs: json files

Christian Feidc6e8f979d33
diff --git a/README.md b/README.md
index d7d30a4..cc0e098 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,7 @@ Supported by yt-dlp, and optionally your local AI model, to make your youtube ex
- No dependencies (except for `nano-spawn`, which itself has no transient deps)
- HTML/CSS only, no JS frameworks on client/server side
- Host it in your home network to playback videos on all your devices
+- Just JSON files for persistence, stupid simple management and backup
@@ -46,7 +47,7 @@ docker compose up --build -d
or (currently **wip**)
```bash
-docker run -p 3000:3000 -it christianfei/my-yt:latest
+docker run -p 3000:3000 -v /path/to/your/data/folder/for/persistence:/app/data christianfei/my-yt:latest
```
diff --git a/client/components/search-videos.js b/client/components/search-videos.js
index dd41d76..67819ba 100644
--- a/client/components/search-videos.js
+++ b/client/components/search-videos.js
@@ -23,22 +23,24 @@ class SearchVideos extends HTMLElement {
event.preventDefault()
const searchTerm = event.target.value.trim().toLowerCase()
const $status = document.querySelector('#filter-results-status')
+ const $videos = document.querySelectorAll('.video')
if (!searchTerm) {
if ($status) $status.innerText = ''
+ $videos.forEach($video => $video.style.display = '')
return console.log('no search term')
}
let filteredCount = 0
- document.querySelectorAll('.video').forEach(video => {
- const videoData = JSON.parse(video.dataset['data'])
+ $videos.forEach($video => {
+ const videoData = JSON.parse($video.dataset['data'])
if (
videoData.title.toLowerCase().includes(searchTerm)
|| videoData.summary?.toLowerCase().includes(searchTerm)
|| videoData.channelName?.toLowerCase().includes(searchTerm)
) {
- video.style.display = ''
+ $video.style.display = ''
filteredCount++
} else {
- video.style.display = 'none'
+ $video.style.display = 'none'
}
})
if ($status) {