diff options
author | Florrie <towerofnix@gmail.com> | 2018-03-19 23:03:00 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-03-19 23:03:00 -0300 |
commit | bf0a68349b69fb5b8bd50b7e38ad6a88540e431a (patch) | |
tree | c5e5e818414110f8e042b63397fc6b953f0b2bda /src/smart-playlist.js | |
parent | bf69e4afd6515954128f5d9129396c56553005e3 (diff) |
Move redundant things into processSmartPlaylist
Diffstat (limited to 'src/smart-playlist.js')
-rw-r--r-- | src/smart-playlist.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/smart-playlist.js b/src/smart-playlist.js index cbe5182..395c590 100644 --- a/src/smart-playlist.js +++ b/src/smart-playlist.js @@ -2,7 +2,7 @@ const fs = require('fs') const { getCrawlerByName } = require('./crawlers') -const { isGroup, filterTracks, sourceSymbol } = require('./playlist-utils') +const { isGroup, filterTracks, sourceSymbol, updatePlaylistFormat } = require('./playlist-utils') const { promisify } = require('util') const readFile = promisify(fs.readFile) @@ -11,6 +11,8 @@ async function processSmartPlaylist(item) { // Object.assign is used so that we keep original properties, e.g. "name" // or "apply". (It's also used so we return copies of original objects.) + item = await updatePlaylistFormat(item) + const newItem = Object.assign({}, item) if ('source' in newItem) { @@ -120,7 +122,9 @@ async function processSmartPlaylist(item) { delete newItem.filters } - return newItem + // We pass true so that the playlist-format-updater knows that this + // is going to be the source playlist, probably. + return updatePlaylistFormat(newItem, true) } async function main(opts) { |