Fixed: Size on disk sorting and display

Closes #4014
This commit is contained in:
Mark McDowall 2020-10-12 16:27:21 -07:00
parent dab6242ff2
commit 4ad137f1eb
3 changed files with 8 additions and 4 deletions

View File

@ -426,7 +426,7 @@ class SeriesDetails extends Component {
<span className={styles.sizeOnDisk}> <span className={styles.sizeOnDisk}>
{ {
formatBytes(sizeOnDisk) formatBytes(sizeOnDisk || 0)
} }
</span> </span>
</Label> </Label>

View File

@ -97,7 +97,8 @@ class SeriesIndexPoster extends Component {
seasonCount, seasonCount,
episodeCount, episodeCount,
episodeFileCount, episodeFileCount,
totalEpisodeCount totalEpisodeCount,
sizeOnDisk
} = statistics; } = statistics;
const { const {
@ -226,6 +227,7 @@ class SeriesIndexPoster extends Component {
<SeriesIndexPosterInfo <SeriesIndexPosterInfo
seasonCount={seasonCount} seasonCount={seasonCount}
sizeOnDisk={sizeOnDisk}
qualityProfile={qualityProfile} qualityProfile={qualityProfile}
showQualityProfile={showQualityProfile} showQualityProfile={showQualityProfile}
showRelativeDates={showRelativeDates} showRelativeDates={showRelativeDates}

View File

@ -121,7 +121,9 @@ export const filterPredicates = {
sizeOnDisk: function(item, filterValue, type) { sizeOnDisk: function(item, filterValue, type) {
const predicate = filterTypePredicates[type]; const predicate = filterTypePredicates[type];
const sizeOnDisk = item.statistics ? item.statistics.sizeOnDisk : 0; const sizeOnDisk = item.statistics && item.statistics.sizeOnDisk ?
item.statistics.sizeOnDisk :
0;
return predicate(sizeOnDisk, filterValue); return predicate(sizeOnDisk, filterValue);
} }
@ -145,7 +147,7 @@ export const sortPredicates = {
sizeOnDisk: function(item) { sizeOnDisk: function(item) {
const { statistics = {} } = item; const { statistics = {} } = item;
return statistics.sizeOnDisk; return statistics.sizeOnDisk || 0;
} }
}; };