mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 18:47:15 -07:00
Small changes
This commit is contained in:
parent
c57f33151b
commit
6067a4743e
5 changed files with 427 additions and 12 deletions
|
@ -26,6 +26,7 @@
|
|||
#endregion
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using NLog;
|
||||
|
||||
|
@ -130,7 +131,18 @@ namespace PlexRequests.Services.Jobs
|
|||
private bool DoWeNeedToBackup(string backupPath)
|
||||
{
|
||||
var files = Directory.GetFiles(backupPath);
|
||||
//TODO Get the latest file and if it's within an hour of DateTime.Now then don't bother backing up.
|
||||
var last = files.LastOrDefault();
|
||||
if (!string.IsNullOrEmpty(last))
|
||||
{
|
||||
var dt = ParseName(Path.GetFileName(last));
|
||||
if (dt < DateTime.Now.AddHours(-1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// We don't have a backup
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue