New: Album Studio is now part of artists list

(cherry picked from commit bdcfef80d627e777d7932c54cda04cbe7c656ffc)

Load albums for album details on mouse hover
This commit is contained in:
Mark McDowall 2023-01-26 20:26:12 -08:00 committed by Bogdan
commit 72267d3cb4
25 changed files with 591 additions and 18 deletions

View file

@ -358,7 +358,8 @@ export const actionHandlers = handleThunks({
artistIds,
monitor,
monitored,
monitorNewItems
monitorNewItems,
shouldFetchAlbumsAfterUpdate = false
} = payload;
const artists = [];
@ -390,7 +391,9 @@ export const actionHandlers = handleThunks({
}).request;
promise.done((data) => {
dispatch(fetchAlbums({ artistId: artistIds[0] }));
if (shouldFetchAlbumsAfterUpdate) {
dispatch(fetchAlbums({ artistId: artistIds[0] }));
}
dispatch(set({
section,

View file

@ -0,0 +1,27 @@
import { createSelector } from 'reselect';
import AppState from 'App/State/AppState';
import Artist from 'Artist/Artist';
import { createArtistSelectorForHook } from './createArtistSelector';
function createArtistAlbumsSelector(artistId: number) {
return createSelector(
(state: AppState) => state.albums,
createArtistSelectorForHook(artistId),
(albums, artist = {} as Artist) => {
const { isFetching, isPopulated, error, items } = albums;
const filteredAlbums = items.filter(
(album) => album.artist.artistMetadataId === artist.artistMetadataId
);
return {
isFetching,
isPopulated,
error,
items: filteredAlbums,
};
}
);
}
export default createArtistAlbumsSelector;