New: Show number of files as tooltip over size on disk

Closes #1966

Co-Authored-By: Robin Dadswell <19610103+RobinDadswell@users.noreply.github.com>
pull/3208/head
Qstick 2 years ago
parent 848d2301a6
commit 21053885da

@ -218,6 +218,11 @@ class AlbumDetails extends Component {
onSearchPress
} = this.props;
const {
trackFileCount,
sizeOnDisk
} = statistics;
const {
isOrganizeModalOpen,
isRetagModalOpen,
@ -233,6 +238,14 @@ class AlbumDetails extends Component {
let expandIcon = icons.EXPAND_INDETERMINATE;
let trackFilesCountMessage = translate('TrackFilesCountMessage');
if (trackFileCount === 1) {
trackFilesCountMessage = '1 track file';
} else if (trackFileCount > 1) {
trackFilesCountMessage = `${trackFileCount} track files`;
}
if (allExpanded) {
expandIcon = icons.COLLAPSE;
} else if (allCollapsed) {
@ -410,21 +423,32 @@ class AlbumDetails extends Component {
</span>
</Label>
<Label
className={styles.detailsLabel}
size={sizes.LARGE}
>
<Icon
name={icons.DRIVE}
size={17}
/>
<Tooltip
anchor={
<Label
className={styles.detailsLabel}
size={sizes.LARGE}
>
<Icon
name={icons.DRIVE}
size={17}
/>
<span className={styles.sizeOnDisk}>
{
formatBytes(statistics.sizeOnDisk || 0)
}
</span>
</Label>
<span className={styles.sizeOnDisk}>
{
formatBytes(sizeOnDisk || 0)
}
</span>
</Label>
}
tooltip={
<span>
{trackFilesCountMessage}
</span>
}
kind={kinds.INVERSE}
position={tooltipPositions.BOTTOM}
/>
<Label
className={styles.detailsLabel}

@ -453,22 +453,32 @@ class ArtistDetails extends Component {
</span>
</Label>
<Label
className={styles.detailsLabel}
title={trackFilesCountMessage}
size={sizes.LARGE}
>
<Icon
name={icons.DRIVE}
size={17}
/>
<Tooltip
anchor={
<Label
className={styles.detailsLabel}
size={sizes.LARGE}
>
<Icon
name={icons.DRIVE}
size={17}
/>
<span className={styles.sizeOnDisk}>
{
formatBytes(sizeOnDisk || 0)
}
</span>
</Label>
<span className={styles.sizeOnDisk}>
{
formatBytes(sizeOnDisk || 0)
}
</span>
</Label>
}
tooltip={
<span>
{trackFilesCountMessage}
</span>
}
kind={kinds.INVERSE}
position={tooltipPositions.BOTTOM}
/>
<Label
className={styles.detailsLabel}

Loading…
Cancel
Save