mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2025-12-06 08:14:07 +00:00
localnum clarity
This commit is contained in:
parent
032a83b331
commit
1cc15fb6f4
@ -509,14 +509,15 @@ const _populateSingleLinkCore: (opts: _TrackFilterArgs) => _PopulateFilter = ({
|
|||||||
to,
|
to,
|
||||||
}) => {
|
}) => {
|
||||||
const fromTrackURIs = from.map((track) => track.uri);
|
const fromTrackURIs = from.map((track) => track.uri);
|
||||||
let toTrackURIs = to
|
let missingTrackObjs = to.filter(
|
||||||
.filter((track) => !track.is_local) // API doesn't support adding local files to playlists yet
|
(trackObj) => !fromTrackURIs.includes(trackObj.uri) // only ones missing from the 'from' playlist
|
||||||
.filter((track) => !fromTrackURIs.includes(track.uri)) // only ones missing from the 'from' playlist
|
);
|
||||||
.map((track) => track.uri);
|
// API doesn't support adding local files to playlists yet
|
||||||
|
|
||||||
return {
|
return {
|
||||||
missing: toTrackURIs,
|
missing: missingTrackObjs
|
||||||
localNum: to.filter((track) => track.is_local).length,
|
.filter((track) => !track.is_local)
|
||||||
|
.map((track) => track.uri),
|
||||||
|
localNum: missingTrackObjs.filter((track) => track.is_local).length,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user