diff --git a/index.js b/index.js index 4955331..ad668ae 100644 --- a/index.js +++ b/index.js @@ -119,8 +119,12 @@ async function thing() { await fs.mkdir(`${os.homedir()}/Music/${album}`, { recursive: true }); } catch (err) { } - if (!(await fs.exists(path))) { + try { + await fs.access(path); + console.log("Path already exists..?"); + } catch (err) { console.log(`Encoding to: ${path}`); + if (image) { await exec(`ffmpeg -i "${file}" -i "${image}" -map 0:0 -map 1:0 -id3v2_version 4 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" "${path}"`); } else {