diff --git a/frontend/src/System/Backup/BackupRow.js b/frontend/src/System/Backup/BackupRow.js index 268981996..c538303b7 100644 --- a/frontend/src/System/Backup/BackupRow.js +++ b/frontend/src/System/Backup/BackupRow.js @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; +import formatBytes from 'Utilities/Number/formatBytes'; import { icons, kinds } from 'Helpers/Props'; import Icon from 'Components/Icon'; import IconButton from 'Components/Link/IconButton'; @@ -64,6 +65,7 @@ class BackupRow extends Component { type, name, path, + size, time } = this.props; @@ -103,6 +105,10 @@ class BackupRow extends Component { + + {formatBytes(size)} + + @@ -146,8 +152,9 @@ BackupRow.propTypes = { type: PropTypes.string.isRequired, name: PropTypes.string.isRequired, path: PropTypes.string.isRequired, + size: PropTypes.number.isRequired, time: PropTypes.string.isRequired, onDeleteBackupPress: PropTypes.func.isRequired }; -export default BackupRow; +export default BackupRow; \ No newline at end of file diff --git a/frontend/src/System/Backup/Backups.js b/frontend/src/System/Backup/Backups.js index 424f8740b..59b277c7c 100644 --- a/frontend/src/System/Backup/Backups.js +++ b/frontend/src/System/Backup/Backups.js @@ -22,6 +22,11 @@ const columns = [ label: 'Name', isVisible: true }, + { + name: 'size', + label: 'Size', + isVisible: true + }, { name: 'time', label: 'Time', @@ -122,6 +127,7 @@ class Backups extends Component { type, name, path, + size, time } = item; @@ -132,6 +138,7 @@ class Backups extends Component { type={type} name={name} path={path} + size={size} time={time} onDeleteBackupPress={onDeleteBackupPress} /> @@ -163,4 +170,4 @@ Backups.propTypes = { onDeleteBackupPress: PropTypes.func.isRequired }; -export default Backups; +export default Backups; \ No newline at end of file diff --git a/src/NzbDrone.Core/Backup/Backup.cs b/src/NzbDrone.Core/Backup/Backup.cs index 5d148648e..4c6200436 100644 --- a/src/NzbDrone.Core/Backup/Backup.cs +++ b/src/NzbDrone.Core/Backup/Backup.cs @@ -6,6 +6,7 @@ namespace NzbDrone.Core.Backup { public string Name { get; set; } public BackupType Type { get; set; } + public long Size { get; set; } public DateTime Time { get; set; } } } diff --git a/src/NzbDrone.Core/Backup/BackupService.cs b/src/NzbDrone.Core/Backup/BackupService.cs index b43b21818..b9033c1e5 100644 --- a/src/NzbDrone.Core/Backup/BackupService.cs +++ b/src/NzbDrone.Core/Backup/BackupService.cs @@ -107,6 +107,7 @@ namespace NzbDrone.Core.Backup { Name = Path.GetFileName(b), Type = backupType, + Size = _diskProvider.GetFileSize(b), Time = _diskProvider.FileGetLastWrite(b) })); } diff --git a/src/Sonarr.Api.V3/System/Backup/BackupModule.cs b/src/Sonarr.Api.V3/System/Backup/BackupModule.cs index 94f3e90fd..f6d84bc90 100644 --- a/src/Sonarr.Api.V3/System/Backup/BackupModule.cs +++ b/src/Sonarr.Api.V3/System/Backup/BackupModule.cs @@ -44,6 +44,7 @@ namespace Sonarr.Api.V3.System.Backup Name = b.Name, Path = $"/backup/{b.Type.ToString().ToLower()}/{b.Name}", Type = b.Type, + Size = b.Size, Time = b.Time }) .OrderByDescending(b => b.Time) diff --git a/src/Sonarr.Api.V3/System/Backup/BackupResource.cs b/src/Sonarr.Api.V3/System/Backup/BackupResource.cs index 86b23c4da..25ff1f2bf 100644 --- a/src/Sonarr.Api.V3/System/Backup/BackupResource.cs +++ b/src/Sonarr.Api.V3/System/Backup/BackupResource.cs @@ -9,6 +9,7 @@ namespace Sonarr.Api.V3.System.Backup public string Name { get; set; } public string Path { get; set; } public BackupType Type { get; set; } + public long Size { get; set; } public DateTime Time { get; set; } } }