MCPcopy
hub / github.com/spicetify/cli / addToStorage

Method addToStorage

Extensions/bookmark.js:78–87  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

76 }
77
78 addToStorage(data) {
79 data.id = `${data.uri}-${new Date().getTime()}`;
80
81 /** @type {Object[]} */
82 const storage = this.getStorage();
83 storage.unshift(data);
84
85 LocalStorage.set(STORAGE_KEY, JSON.stringify(storage));
86 this.apply();
87 }
88
89 removeFromStorage(id) {
90 const storage = this.getStorage().filter((item) => item.id !== id);

Callers 4

storeThisPageFunction · 0.80
storeTrackFunction · 0.80
storeTrackWithTimeFunction · 0.80
bookmark.jsFile · 0.80

Calls 2

getStorageMethod · 0.95
applyMethod · 0.95

Tested by

no test coverage detected