mirror of
https://github.com/lidarr/Lidarr
synced 2025-03-12 06:53:24 +00:00
New: Size column for tracks
This commit is contained in:
parent
1da1020a83
commit
51085482bc
5 changed files with 22 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
}
|
||||
|
||||
.duration,
|
||||
.size,
|
||||
.status {
|
||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||
|
||||
|
|
1
frontend/src/Album/Details/TrackRow.css.d.ts
vendored
1
frontend/src/Album/Details/TrackRow.css.d.ts
vendored
|
@ -5,6 +5,7 @@ interface CssExports {
|
|||
'customFormatScore': string;
|
||||
'duration': string;
|
||||
'monitored': string;
|
||||
'size': string;
|
||||
'status': string;
|
||||
'title': string;
|
||||
'trackNumber': string;
|
||||
|
|
|
@ -9,6 +9,7 @@ import { tooltipPositions } from 'Helpers/Props';
|
|||
import MediaInfoConnector from 'TrackFile/MediaInfoConnector';
|
||||
import * as mediaInfoTypes from 'TrackFile/mediaInfoTypes';
|
||||
import formatTimeSpan from 'Utilities/Date/formatTimeSpan';
|
||||
import formatBytes from 'Utilities/Number/formatBytes';
|
||||
import formatCustomFormatScore from 'Utilities/Number/formatCustomFormatScore';
|
||||
import TrackActionsCell from './TrackActionsCell';
|
||||
import styles from './TrackRow.css';
|
||||
|
@ -28,6 +29,7 @@ class TrackRow extends Component {
|
|||
title,
|
||||
duration,
|
||||
trackFilePath,
|
||||
trackFileSize,
|
||||
customFormats,
|
||||
customFormatScore,
|
||||
columns,
|
||||
|
@ -145,6 +147,17 @@ class TrackRow extends Component {
|
|||
);
|
||||
}
|
||||
|
||||
if (name === 'size') {
|
||||
return (
|
||||
<TableRowCell
|
||||
key={name}
|
||||
className={styles.size}
|
||||
>
|
||||
{!!trackFileSize && formatBytes(trackFileSize)}
|
||||
</TableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'status') {
|
||||
return (
|
||||
<TableRowCell
|
||||
|
@ -192,6 +205,7 @@ TrackRow.propTypes = {
|
|||
duration: PropTypes.number.isRequired,
|
||||
isSaving: PropTypes.bool,
|
||||
trackFilePath: PropTypes.string,
|
||||
trackFileSize: PropTypes.number,
|
||||
customFormats: PropTypes.arrayOf(PropTypes.object),
|
||||
customFormatScore: PropTypes.number.isRequired,
|
||||
mediaInfo: PropTypes.object,
|
||||
|
|
|
@ -11,6 +11,7 @@ function createMapStateToProps() {
|
|||
(id, trackFile) => {
|
||||
return {
|
||||
trackFilePath: trackFile ? trackFile.path : null,
|
||||
trackFileSize: trackFile ? trackFile.size : null,
|
||||
customFormats: trackFile ? trackFile.customFormats : [],
|
||||
customFormatScore: trackFile ? trackFile.customFormatScore : 0
|
||||
};
|
||||
|
|
|
@ -58,6 +58,11 @@ export const defaultState = {
|
|||
label: () => translate('AudioInfo'),
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'size',
|
||||
label: () => translate('Size'),
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'customFormats',
|
||||
label: 'Formats',
|
||||
|
|
Loading…
Add table
Reference in a new issue