mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Don't repeatedly re-render cells
This commit is contained in:
parent
9b6b406a53
commit
e0d1e3b03f
8 changed files with 86 additions and 73 deletions
|
@ -54,7 +54,6 @@ class ArtistIndexBanner extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
artistName,
|
artistName,
|
||||||
monitored,
|
monitored,
|
||||||
|
@ -102,7 +101,7 @@ class ArtistIndexBanner extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container} style={style}>
|
<div className={styles.container}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.bannerContainer}>
|
<div className={styles.bannerContainer}>
|
||||||
<Label className={styles.controls}>
|
<Label className={styles.controls}>
|
||||||
|
@ -234,7 +233,6 @@ class ArtistIndexBanner extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtistIndexBanner.propTypes = {
|
ArtistIndexBanner.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
artistName: PropTypes.string.isRequired,
|
artistName: PropTypes.string.isRequired,
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
|
|
|
@ -219,8 +219,12 @@ class ArtistIndexBanners extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ArtistIndexItemConnector
|
<div
|
||||||
|
style={style}
|
||||||
key={key}
|
key={key}
|
||||||
|
>
|
||||||
|
<ArtistIndexItemConnector
|
||||||
|
key={artist.id}
|
||||||
component={ArtistIndexBanner}
|
component={ArtistIndexBanner}
|
||||||
sortKey={sortKey}
|
sortKey={sortKey}
|
||||||
bannerWidth={bannerWidth}
|
bannerWidth={bannerWidth}
|
||||||
|
@ -232,11 +236,11 @@ class ArtistIndexBanners extends Component {
|
||||||
showRelativeDates={showRelativeDates}
|
showRelativeDates={showRelativeDates}
|
||||||
shortDateFormat={shortDateFormat}
|
shortDateFormat={shortDateFormat}
|
||||||
timeFormat={timeFormat}
|
timeFormat={timeFormat}
|
||||||
style={style}
|
|
||||||
artistId={artist.id}
|
artistId={artist.id}
|
||||||
qualityProfileId={artist.qualityProfileId}
|
qualityProfileId={artist.qualityProfileId}
|
||||||
metadataProfileId={artist.metadataProfileId}
|
metadataProfileId={artist.metadataProfileId}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,6 +300,7 @@ class ArtistIndexBanners extends Component {
|
||||||
overscanRowCount={2}
|
overscanRowCount={2}
|
||||||
cellRenderer={this.cellRenderer}
|
cellRenderer={this.cellRenderer}
|
||||||
onSectionRendered={this.onSectionRendered}
|
onSectionRendered={this.onSectionRendered}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,6 @@ class ArtistIndexOverview extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
artistName,
|
artistName,
|
||||||
overview,
|
overview,
|
||||||
|
@ -122,7 +121,7 @@ class ArtistIndexOverview extends Component {
|
||||||
const overviewHeight = contentHeight - titleRowHeight;
|
const overviewHeight = contentHeight - titleRowHeight;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container} style={style}>
|
<div className={styles.container}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.poster}>
|
<div className={styles.poster}>
|
||||||
<div className={styles.posterContainer}>
|
<div className={styles.posterContainer}>
|
||||||
|
@ -245,7 +244,6 @@ class ArtistIndexOverview extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtistIndexOverview.propTypes = {
|
ArtistIndexOverview.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
artistName: PropTypes.string.isRequired,
|
artistName: PropTypes.string.isRequired,
|
||||||
overview: PropTypes.string.isRequired,
|
overview: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -185,8 +185,12 @@ class ArtistIndexOverviews extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ArtistIndexItemConnector
|
<div
|
||||||
key={key}
|
key={key}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<ArtistIndexItemConnector
|
||||||
|
key={artist.id}
|
||||||
component={ArtistIndexOverview}
|
component={ArtistIndexOverview}
|
||||||
sortKey={sortKey}
|
sortKey={sortKey}
|
||||||
posterWidth={posterWidth}
|
posterWidth={posterWidth}
|
||||||
|
@ -198,11 +202,11 @@ class ArtistIndexOverviews extends Component {
|
||||||
longDateFormat={longDateFormat}
|
longDateFormat={longDateFormat}
|
||||||
timeFormat={timeFormat}
|
timeFormat={timeFormat}
|
||||||
isSmallScreen={isSmallScreen}
|
isSmallScreen={isSmallScreen}
|
||||||
style={style}
|
|
||||||
artistId={artist.id}
|
artistId={artist.id}
|
||||||
qualityProfileId={artist.qualityProfileId}
|
qualityProfileId={artist.qualityProfileId}
|
||||||
metadataProfileId={artist.metadataProfileId}
|
metadataProfileId={artist.metadataProfileId}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +262,7 @@ class ArtistIndexOverviews extends Component {
|
||||||
overscanRowCount={2}
|
overscanRowCount={2}
|
||||||
cellRenderer={this.cellRenderer}
|
cellRenderer={this.cellRenderer}
|
||||||
onSectionRendered={this.onSectionRendered}
|
onSectionRendered={this.onSectionRendered}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@ class ArtistIndexPoster extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
artistName,
|
artistName,
|
||||||
monitored,
|
monitored,
|
||||||
|
@ -116,7 +115,7 @@ class ArtistIndexPoster extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container} style={style}>
|
<div className={styles.container}>
|
||||||
<div className={styles.content}>
|
<div className={styles.content}>
|
||||||
<div className={styles.posterContainer}>
|
<div className={styles.posterContainer}>
|
||||||
<Label className={styles.controls}>
|
<Label className={styles.controls}>
|
||||||
|
@ -257,7 +256,6 @@ class ArtistIndexPoster extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtistIndexPoster.propTypes = {
|
ArtistIndexPoster.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
artistName: PropTypes.string.isRequired,
|
artistName: PropTypes.string.isRequired,
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
|
|
|
@ -212,15 +212,20 @@ class ArtistIndexPosters extends Component {
|
||||||
showQualityProfile
|
showQualityProfile
|
||||||
} = posterOptions;
|
} = posterOptions;
|
||||||
|
|
||||||
const artist = items[rowIndex * columnCount + columnIndex];
|
const artistIdx = rowIndex * columnCount + columnIndex;
|
||||||
|
const artist = items[artistIdx];
|
||||||
|
|
||||||
if (!artist) {
|
if (!artist) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ArtistIndexItemConnector
|
<div
|
||||||
key={key}
|
key={key}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<ArtistIndexItemConnector
|
||||||
|
key={artist.id}
|
||||||
component={ArtistIndexPoster}
|
component={ArtistIndexPoster}
|
||||||
sortKey={sortKey}
|
sortKey={sortKey}
|
||||||
posterWidth={posterWidth}
|
posterWidth={posterWidth}
|
||||||
|
@ -232,11 +237,11 @@ class ArtistIndexPosters extends Component {
|
||||||
showRelativeDates={showRelativeDates}
|
showRelativeDates={showRelativeDates}
|
||||||
shortDateFormat={shortDateFormat}
|
shortDateFormat={shortDateFormat}
|
||||||
timeFormat={timeFormat}
|
timeFormat={timeFormat}
|
||||||
style={style}
|
|
||||||
artistId={artist.id}
|
artistId={artist.id}
|
||||||
qualityProfileId={artist.qualityProfileId}
|
qualityProfileId={artist.qualityProfileId}
|
||||||
metadataProfileId={artist.metadataProfileId}
|
metadataProfileId={artist.metadataProfileId}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,6 +301,7 @@ class ArtistIndexPosters extends Component {
|
||||||
overscanRowCount={2}
|
overscanRowCount={2}
|
||||||
cellRenderer={this.cellRenderer}
|
cellRenderer={this.cellRenderer}
|
||||||
onSectionRendered={this.onSectionRendered}
|
onSectionRendered={this.onSectionRendered}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,6 @@ import Link from 'Components/Link/Link';
|
||||||
import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
|
import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
|
||||||
import ProgressBar from 'Components/ProgressBar';
|
import ProgressBar from 'Components/ProgressBar';
|
||||||
import TagListConnector from 'Components/TagListConnector';
|
import TagListConnector from 'Components/TagListConnector';
|
||||||
// import CheckInput from 'Components/Form/CheckInput';
|
|
||||||
import VirtualTableRow from 'Components/Table/VirtualTableRow';
|
|
||||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
||||||
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
||||||
import ArtistNameLink from 'Artist/ArtistNameLink';
|
import ArtistNameLink from 'Artist/ArtistNameLink';
|
||||||
|
@ -79,7 +77,6 @@ class ArtistIndexRow extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
style,
|
|
||||||
id,
|
id,
|
||||||
monitored,
|
monitored,
|
||||||
status,
|
status,
|
||||||
|
@ -121,7 +118,7 @@ class ArtistIndexRow extends Component {
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VirtualTableRow style={style}>
|
<>
|
||||||
{
|
{
|
||||||
columns.map((column) => {
|
columns.map((column) => {
|
||||||
const {
|
const {
|
||||||
|
@ -436,13 +433,12 @@ class ArtistIndexRow extends Component {
|
||||||
artistId={id}
|
artistId={id}
|
||||||
onModalClose={this.onDeleteArtistModalClose}
|
onModalClose={this.onDeleteArtistModalClose}
|
||||||
/>
|
/>
|
||||||
</VirtualTableRow>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtistIndexRow.propTypes = {
|
ArtistIndexRow.propTypes = {
|
||||||
style: PropTypes.object.isRequired,
|
|
||||||
id: PropTypes.number.isRequired,
|
id: PropTypes.number.isRequired,
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import React, { Component } from 'react';
|
||||||
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
import getIndexOfFirstCharacter from 'Utilities/Array/getIndexOfFirstCharacter';
|
||||||
import { sortDirections } from 'Helpers/Props';
|
import { sortDirections } from 'Helpers/Props';
|
||||||
import VirtualTable from 'Components/Table/VirtualTable';
|
import VirtualTable from 'Components/Table/VirtualTable';
|
||||||
|
import VirtualTableRow from 'Components/Table/VirtualTableRow';
|
||||||
import ArtistIndexItemConnector from 'Artist/Index/ArtistIndexItemConnector';
|
import ArtistIndexItemConnector from 'Artist/Index/ArtistIndexItemConnector';
|
||||||
import ArtistIndexHeaderConnector from './ArtistIndexHeaderConnector';
|
import ArtistIndexHeaderConnector from './ArtistIndexHeaderConnector';
|
||||||
import ArtistIndexRow from './ArtistIndexRow';
|
import ArtistIndexRow from './ArtistIndexRow';
|
||||||
|
@ -50,8 +51,12 @@ class ArtistIndexTable extends Component {
|
||||||
const artist = items[rowIndex];
|
const artist = items[rowIndex];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ArtistIndexItemConnector
|
<VirtualTableRow
|
||||||
key={key}
|
key={key}
|
||||||
|
style={style}
|
||||||
|
>
|
||||||
|
<ArtistIndexItemConnector
|
||||||
|
key={artist.id}
|
||||||
component={ArtistIndexRow}
|
component={ArtistIndexRow}
|
||||||
style={style}
|
style={style}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
@ -60,6 +65,7 @@ class ArtistIndexTable extends Component {
|
||||||
metadataProfileId={artist.metadataProfileId}
|
metadataProfileId={artist.metadataProfileId}
|
||||||
showBanners={showBanners}
|
showBanners={showBanners}
|
||||||
/>
|
/>
|
||||||
|
</VirtualTableRow>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +114,7 @@ class ArtistIndexTable extends Component {
|
||||||
sortDirection={sortDirection}
|
sortDirection={sortDirection}
|
||||||
onRender={onRender}
|
onRender={onRender}
|
||||||
onScroll={onScroll}
|
onScroll={onScroll}
|
||||||
|
isScrollingOptOut={true}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue