« get me outta code hell

cloneGrouplike - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-07-06 13:08:14 -0300
committerFlorrie <towerofnix@gmail.com>2018-07-06 13:08:14 -0300
commit75a7b9d21af673e2acfed0acf1768e5d76d6c89a (patch)
tree434c3a751b5b4b2b0dce79c412c196718309a3c8 /ui.js
parent288597ec9ae419c8dc2737a985de3f72a61ad247 (diff)
cloneGrouplike
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui.js b/ui.js
index e876904..28977fa 100644
--- a/ui.js
+++ b/ui.js
@@ -1,7 +1,7 @@
 const { getAllCrawlersForArg } = require('./crawlers')
 const { getDownloaderFor } = require('./downloaders')
 const { getPlayer } = require('./players')
-const { parentSymbol, isGroup, isTrack, getItemPath, getItemPathString, flattenGrouplike, updateGroupFormat } = require('./playlist-utils')
+const { parentSymbol, isGroup, isTrack, getItemPath, getItemPathString, flattenGrouplike, cloneGrouplike } = require('./playlist-utils')
 const { shuffleArray } = require('./general-util')
 const processSmartPlaylist = require('./smart-playlist')
 const UndoManager = require('./undo-manager')
@@ -182,8 +182,8 @@ class AppElement extends FocusElement {
               // TODO: More "proper" way of cloning a grouplike. (The purpose of updateGroupFormat
               // here is to make the parentSymbols be properly set, as well as to create a set of
               // totally new objects, so none of the pasted groups already appear somewhere else;
-              // or rather, not as the same objects.)
-              parent.items.splice(index, 0, ...updateGroupFormat(this.markGrouplike).items.map(
+              // or rather, not as the same objects.) (..Done!..)
+              parent.items.splice(index, 0, ...cloneGrouplike(this.markGrouplike).items.map(
                 item => Object.assign({}, item, {[parentSymbol]: parent})
               ))
               updateListingsFor(parent)