mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
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:
parent
de6c9589d0
commit
72267d3cb4
25 changed files with 591 additions and 18 deletions
|
@ -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,
|
||||
|
|
27
frontend/src/Store/Selectors/createArtistAlbumsSelector.ts
Normal file
27
frontend/src/Store/Selectors/createArtistAlbumsSelector.ts
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue