From 8bd075b6d97af53d3f5f43194842fb32b871659e Mon Sep 17 00:00:00 2001 From: 0x01FE Date: Tue, 22 Oct 2024 10:06:44 -0500 Subject: [PATCH] made the program read the library --- src/renderer.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer.js b/src/renderer.js index 87cd24e..1b87c47 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -7,7 +7,7 @@ console.log('test'); // const url = 'file://C:\\Users\\JISAUAY\\Documents\\misc\\sspm\\test.ogg'; // const path = 'C:\\Users\\JISAUAY\\Documents\\misc\\sspm\\ChangelingForest.mp3'; -const libPath = 'C:\\Users\\JISAUAY\\Documents\\misc\\sspm\\test-library\\' +const libPath = './test-library/' // const player = new Audio(url); @@ -17,8 +17,7 @@ const libPath = 'C:\\Users\\JISAUAY\\Documents\\misc\\sspm\\test-library\\' // console.log(info); // }; async function getLibraryFiles() { - const dirInfo = await window.api.readMusicLibrary(libPath); - console.log(dirInfo); + return await window.api.readMusicLibrary(libPath); } @@ -26,6 +25,11 @@ document.addEventListener('DOMContentLoaded', async () => { const libContentDisplay = document.getElementById('libContents'); let files = await getLibraryFiles(); + console.log(files); + + for (const file_i in files) { + libContentDisplay.innerHTML += `
${files[file_i]}
`; + } }); // fromUrl(url).then((tags) => {