You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
623 B
19 lines
623 B
2 years ago
|
import { createSelector } from 'reselect';
|
||
|
import AppState from 'App/State/AppState';
|
||
|
import Artist from 'Artist/Artist';
|
||
|
import { createArtistSelectorForHook } from './createArtistSelector';
|
||
|
|
||
|
function createArtistMetadataProfileSelector(artistId: number) {
|
||
|
return createSelector(
|
||
|
(state: AppState) => state.settings.metadataProfiles.items,
|
||
|
createArtistSelectorForHook(artistId),
|
||
|
(metadataProfiles, artist = {} as Artist) => {
|
||
|
return metadataProfiles.find((profile) => {
|
||
|
return profile.id === artist.metadataProfileId;
|
||
|
});
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default createArtistMetadataProfileSelector;
|