Add buttons for deleting downloaded tracks from playlist or album

This commit is contained in:
Lei Nelissen
2022-01-02 17:46:50 +01:00
parent db1c9d8af9
commit 95a008d8af
7 changed files with 52 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
import { createSelector, EntityId } from '@reduxjs/toolkit';
import { intersection } from 'lodash';
import { AppState } from 'store';
export const selectDownloadedTracks = (trackIds: EntityId[]) => (
createSelector(
(state: AppState) => state.downloads,
({ entities, ids }) => {
return intersection(trackIds, ids)
.filter((id) => entities[id]?.isComplete);
}
)
);