From 2b8a8fde1b6a10cbffb2791de9eea2e1a3c03760 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Wed, 21 Feb 2024 12:07:18 -0600 Subject: [PATCH] oops! --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 5614f26..58caa27 100644 --- a/index.js +++ b/index.js @@ -96,14 +96,14 @@ async function getVideo() { }; } -async function checkNextcloud({ url, name, channelName }, nextcloudClient) { +async function checkNextcloud({ url, name, channelName, tags }, nextcloudClient) { const fileName = pathGenerator({ url, name, channelName }); - return await nextcloudClient.exists(path.join(process.env.NEXTCLOUD_FOLDER, fileName)); + return await nextcloudClient.exists(path.join(process.env.NEXTCLOUD_FOLDER, tags.album, fileName)); } async function checkNextcloudAlbum({ tags }, nextcloudClient) { - return await nextcloudClient.exists(path.join(process.env.NEXTCLOUD_FOLDER, tags, "cover.png")); + return await nextcloudClient.exists(path.join(process.env.NEXTCLOUD_FOLDER, tags.album, "cover.png")); } async function downloadFromCobalt({ url }) { @@ -177,7 +177,7 @@ async function uploadToNextcloud({ fileStream, url, name, channelName, tags, alb if (albumCover) { const albumBufferStream = new PassThrough().end(albumCover); - + await finished(albumBufferStream.pipe(nextcloudClient.createWriteStream(path.join(process.env.NEXTCLOUD_FOLDER, tags.album, "cover.png")))); } @@ -212,7 +212,7 @@ async function main() { }) let albumCover; - if (!(await checkNextcloudAlbum({ ...video }, nextcloudClient))) { + if (!(await checkNextcloudAlbum(video, nextcloudClient))) { albumCover = await downloadAlbumCover(video); }