From 81d4076ec6c6d6215608a88d176abffd479bc451 Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Sat, 18 Apr 2020 13:14:40 +0300 Subject: [PATCH] Fix: duplicate album name in collections --- src/generate.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/generate.js b/src/generate.js index f99230e..f5fede5 100644 --- a/src/generate.js +++ b/src/generate.js @@ -21,7 +21,10 @@ const collect = (tracks, callback) => { * Returns the first defined metadata at the specified path. */ const find = (tracks, path) => - _.get(tracks.find(track => !_.isNil(_.get(track, path))), path); + _.get( + tracks.find(track => !_.isNil(_.get(track, path))), + path + ); /** * Parses a date and returns it in the form of `year-month-day`. @@ -96,9 +99,7 @@ module.exports = { const albumCollectionRoot = path.resolve(root, '_albums'); await fs.ensureDir(albumCollectionRoot); debug( - `generating release info for album '${baseName}' with ${ - tracks.length - } track(s)` + `generating release info for album '${baseName}' with ${tracks.length} track(s)` ); const albumInfo = getAlbumInfo(albumRoot, tracks); const releaseInfo = `---\n${toYaml(albumInfo)}---\n`; @@ -114,7 +115,7 @@ module.exports = { const trackInfoPath = path.resolve( trackCollectionRoot, baseName, - `${track.slug}.md` + `${track.trackSlug}.md` ); await fs.ensureFile(trackInfoPath); await fs.writeFile(trackInfoPath, `---\n${toYaml(track)}---\n`);