mirror of
https://github.com/Readarr/Readarr
synced 2025-12-12 19:35:10 +01:00
20 lines
436 B
JavaScript
20 lines
436 B
JavaScript
import _ from 'lodash';
|
|
import { createSelector } from 'reselect';
|
|
|
|
function createQueueItemSelector() {
|
|
return createSelector(
|
|
(state, { albumId }) => albumId,
|
|
(state) => state.queue.details,
|
|
(albumId, details) => {
|
|
if (!albumId) {
|
|
return null;
|
|
}
|
|
|
|
return _.find(details.items, (item) => {
|
|
return item.album.id === albumId;
|
|
});
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createQueueItemSelector;
|