New: Add backup size information

Closes #957

(cherry picked from commit 78aeda1a2cc217c367c5c3c6fd281c101b28413c)
This commit is contained in:
Zack Eckersley Pallett
2022-02-21 20:11:12 +00:00
committed by Qstick
parent 1b83459927
commit 18189d086b
6 changed files with 18 additions and 0 deletions

View File

@@ -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; }
}
}

View File

@@ -109,6 +109,7 @@ namespace NzbDrone.Core.Backup
{
Name = Path.GetFileName(b),
Type = backupType,
Size = _diskProvider.GetFileSize(b),
Time = _diskProvider.FileGetLastWrite(b)
}));
}

View File

@@ -42,6 +42,7 @@ namespace Prowlarr.Api.V1.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)

View File

@@ -9,6 +9,7 @@ namespace Prowlarr.Api.V1.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; }
}
}