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 video persistence

Christian Feicbb690f07a9c
diff --git a/lib/repository.js b/lib/repository.js
index bc27df4..9a09868 100644
--- a/lib/repository.js
+++ b/lib/repository.js
@@ -3,7 +3,7 @@ import fs from 'fs'
export default class Repository {
constructor() {
this.channels = []
- this.videos = {}
+ this.videos = []
this.paths = {
videos: './data/videos.json',
channels: './data/channels.json',
diff --git a/lib/server.js b/lib/server.js
index 9062b95..7c07a4b 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -218,5 +218,5 @@ function patchVideo(video, repo) {
const savedVideo = repo.getVideo(video.id)
if (!savedVideo) return video
Object.assign(savedVideo, video)
- return video
+ return savedVideo
}
\ No newline at end of file