From f04358a71cd9ac5d0b39e3be2de9f15337e72bf6 Mon Sep 17 00:00:00 2001 From: Filip Borum Poulsen Date: Thu, 21 Mar 2024 22:50:33 +0100 Subject: [PATCH] FIX --- index.js | 4 ++-- video-player.service | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index d1f333c..1da7721 100644 --- a/index.js +++ b/index.js @@ -91,7 +91,7 @@ function startVideo(path) { }); } -// fs.mkdirSync('/video', { recursive: true }); +fs.mkdirSync('/video', { recursive: true }); app.post('/play', (req, res) => { if (process) { @@ -125,7 +125,7 @@ app.post('/upload', function (req, res) { // The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file const uploadPath = path.join(__dirname, '/public/videos/'); - req.files.file.mv(uploadPath + req.files.file.name, function (err) { + req.files.file.mv(uploadPath + "video.mp4", function (err) { if (err) { return res.status(500); } diff --git a/video-player.service b/video-player.service index 74b3198..1a55348 100644 --- a/video-player.service +++ b/video-player.service @@ -2,17 +2,13 @@ Description=Video Player After=multi-user.target -StartLimitIntervalSec=500 -StartLimitBurst=50 - [Service] WorkingDirectory=/home/steady/video-player ExecStart=node /home/steady/video-player/index.js Environment=DISPLAY=:0 User=1000 Group=1000 -Restart=on-failure -RestartSec=5s +Restart=always [Install] WantedBy=multi-user.target \ No newline at end of file