From bf0a68349b69fb5b8bd50b7e38ad6a88540e431a Mon Sep 17 00:00:00 2001 From: Florrie Date: Mon, 19 Mar 2018 23:03:00 -0300 Subject: Move redundant things into processSmartPlaylist --- src/general-util.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/general-util.js') diff --git a/src/general-util.js b/src/general-util.js index 278eea6..b37f516 100644 --- a/src/general-util.js +++ b/src/general-util.js @@ -100,25 +100,17 @@ module.exports.makePlaylistOptions = function() { // Takes an actual playlist object and sets it up as the source and active // playlist. - const openedPlaylist = updatePlaylistFormat(importedPlaylist) - - // We also want to de-smart-ify (stupidify? - simplify?) the playlist. - const processedPlaylist = await processSmartPlaylist(openedPlaylist) - - // ..And finally, we have to update the playlist format again, since - // processSmartPlaylist might have added new (un-updated) items: - const finalPlaylist = updatePlaylistFormat(processedPlaylist, true) - // We also pass true so that the playlist-format-updater knows that this - // is the source playlist. - - sourcePlaylist = finalPlaylist + // We want to de-smart-ify (stupidify? - simplify?) the playlist. + // This also automatically updates the playlist format for us, which is + // handy. + sourcePlaylist = await processSmartPlaylist(importedPlaylist) // The active playlist is a clone of the source playlist; after all it's // quite possible we'll be messing with the value of the active playlist, // and we don't want to reflect those changes in the source playlist. activePlaylist = clone(sourcePlaylist) - await processArgv(processedPlaylist.options, optionFunctions) + await processArgv(sourcePlaylist.options, optionFunctions) } const requiresOpenPlaylist = async function() { -- cgit 1.3.0-6-gf8a5