From ea62f8747d835a27b36f5a19de0ebcf6fce908cd Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 10 Oct 2021 13:58:44 -0300 Subject: only load ~/Music if no other sources provided --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'index.js') diff --git a/index.js b/index.js index 444d579..b320812 100755 --- a/index.js +++ b/index.js @@ -29,6 +29,7 @@ const { const { promisify } = require('util') const fs = require('fs') +const os = require('os') const readFile = promisify(fs.readFile) const writeFile = promisify(fs.writeFile) @@ -123,6 +124,16 @@ async function main() { root.renderNow() }) + if (playlistSources.length === 0) { + playlistSources.push({ + name: 'My ~/Music Library', + comment: ( + '(Add tracks and folders to ~/Music to make them show up here,' + + ' or pass mtui your own playlist.json file!)'), + source: ['crawl-local', os.homedir() + '/Music'] + }) + } + const loadPlaylists = async () => { for (const source of playlistSources) { await appElement.loadPlaylistOrSource(source, true) -- cgit 1.3.0-6-gf8a5