New: Size column for albums

Closes #3292
pull/4546/head
Bogdan 3 months ago
parent a9b16d298f
commit d8066ec172

@ -175,7 +175,7 @@ class AlbumDetailsMedium extends Component {
</Table> :
<div className={styles.noTracks}>
No tracks in this medium
{translate('NoTracksInThisMedium')}
</div>
}
<div className={styles.collapseButtonContainer}>

@ -10,6 +10,7 @@
width: 42px;
}
.size,
.status {
composes: cell from '~Components/Table/Cells/TableRowCell.css';

@ -2,6 +2,7 @@
// Please do not change this file!
interface CssExports {
'monitored': string;
'size': string;
'status': string;
'title': string;
}

@ -10,6 +10,7 @@ import TableRowCell from 'Components/Table/Cells/TableRowCell';
import TableRow from 'Components/Table/TableRow';
import { kinds, sizes } from 'Helpers/Props';
import formatTimeSpan from 'Utilities/Date/formatTimeSpan';
import formatBytes from 'Utilities/Number/formatBytes';
import translate from 'Utilities/String/translate';
import styles from './AlbumRow.css';
@ -87,7 +88,8 @@ class AlbumRow extends Component {
const {
trackCount = 0,
trackFileCount = 0,
totalTrackCount = 0
totalTrackCount = 0,
sizeOnDisk = 0
} = statistics;
return (
@ -196,6 +198,17 @@ class AlbumRow extends Component {
);
}
if (name === 'size') {
return (
<TableRowCell
key={name}
className={styles.size}
>
{!!sizeOnDisk && formatBytes(sizeOnDisk)}
</TableRowCell>
);
}
if (name === 'status') {
return (
<TableRowCell

@ -196,7 +196,7 @@ class ArtistDetailsSeason extends Component {
trackFileCount,
monitoredAlbumCount,
hasMonitoredAlbums,
sizeOnDisk
sizeOnDisk = 0
} = getAlbumStatistics(items);
const {

@ -36,6 +36,11 @@ export const defaultState = {
sortPredicates: {
rating: function(item) {
return item.ratings.value;
},
size: function(item) {
const { statistics = {} } = item;
return statistics.sizeOnDisk || 0;
}
},
@ -81,6 +86,12 @@ export const defaultState = {
isSortable: true,
isVisible: false
},
{
name: 'size',
label: () => translate('Size'),
isSortable: true,
isVisible: false
},
{
name: 'rating',
label: () => translate('Rating'),

@ -725,6 +725,7 @@
"NoMissingItems": "No missing items",
"NoResultsFound": "No results found",
"NoTagsHaveBeenAddedYet": "No tags have been added yet",
"NoTracksInThisMedium": "No tracks in this medium",
"NoUpdatesAreAvailable": "No updates are available",
"None": "None",
"NoneData": "No albums will be monitored",

Loading…
Cancel
Save