mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-26 22:56:23 -04:00
Improve series index performance during series refresh
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { createSelector } from 'reselect';
|
||||
import createDeepEqualSelector from './createDeepEqualSelector';
|
||||
import createClientSideCollectionSelector from './createClientSideCollectionSelector';
|
||||
|
||||
function createUnoptimizedSelector(uiSection) {
|
||||
return createSelector(
|
||||
createClientSideCollectionSelector('series', uiSection),
|
||||
(series) => {
|
||||
const items = series.items.map((s) => {
|
||||
const {
|
||||
id,
|
||||
sortTitle
|
||||
} = s;
|
||||
|
||||
return {
|
||||
id,
|
||||
sortTitle
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
...series,
|
||||
items
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function createSeriesClientSideCollectionItemsSelector(uiSection) {
|
||||
return createDeepEqualSelector(
|
||||
createUnoptimizedSelector(uiSection),
|
||||
(series) => series
|
||||
);
|
||||
}
|
||||
|
||||
export default createSeriesClientSideCollectionItemsSelector;
|
||||
Reference in New Issue
Block a user