Skip to content
Snippets Groups Projects
Commit 2ecd8d01 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Some renamings to use less over-specific names

Refers to #20
parent 171a0c1f
Branches
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ namespace ATxCommon ...@@ -18,7 +18,7 @@ namespace ATxCommon
private static readonly Logger Log = LogManager.GetCurrentClassLogger(); private static readonly Logger Log = LogManager.GetCurrentClassLogger();
private readonly Dictionary<string, List<DirectoryDetails>> _expiredUserDirs; private readonly Dictionary<string, List<DirectoryDetails>> _expiredDirs;
private readonly List<DriveToCheck> _drives; private readonly List<DriveToCheck> _drives;
private readonly int _gracePeriod; private readonly int _gracePeriod;
...@@ -34,17 +34,17 @@ namespace ATxCommon ...@@ -34,17 +34,17 @@ namespace ATxCommon
_gracePeriod = config.GracePeriod; _gracePeriod = config.GracePeriod;
_gracePeriodHuman = config.HumanGracePeriod; _gracePeriodHuman = config.HumanGracePeriod;
_graceLocation = new DirectoryInfo(config.DonePath); _graceLocation = new DirectoryInfo(config.DonePath);
_expiredUserDirs = new Dictionary<string, List<DirectoryDetails>>(); _expiredDirs = new Dictionary<string, List<DirectoryDetails>>();
Update(); Update();
} }
/// <summary> /// <summary>
/// Number of expired directories in the grace location. /// Number of expired directories in the grace location.
/// </summary> /// </summary>
public int ExpiredUserDirsCount { public int ExpiredDirsCount {
get { get {
Update(); Update();
return _expiredUserDirs.Count; return _expiredDirs.Count;
} }
} }
...@@ -66,10 +66,10 @@ namespace ATxCommon ...@@ -66,10 +66,10 @@ namespace ATxCommon
/// <summary> /// <summary>
/// Get a dictionary of expired directories from the grace location. /// Get a dictionary of expired directories from the grace location.
/// </summary> /// </summary>
public Dictionary<string, List<DirectoryDetails>> ExpiredUserDirs { public Dictionary<string, List<DirectoryDetails>> ExpiredDirs {
get { get {
Update(); Update();
return _expiredUserDirs; return _expiredDirs;
} }
} }
...@@ -84,12 +84,12 @@ namespace ATxCommon ...@@ -84,12 +84,12 @@ namespace ATxCommon
$"threshold: {_gracePeriod} days ({_gracePeriodHuman}) ------\n\n" + $"threshold: {_gracePeriod} days ({_gracePeriodHuman}) ------\n\n" +
$" - location: [{_graceLocation}]\n"; $" - location: [{_graceLocation}]\n";
if (_expiredUserDirs.Count == 0) if (_expiredDirs.Count == 0)
return summary + " -- NO EXPIRED folders in grace location! --"; return summary + " -- NO EXPIRED folders in grace location! --";
foreach (var dir in _expiredUserDirs.Keys) { foreach (var dir in _expiredDirs.Keys) {
summary += "\n - directory '" + dir + "'\n"; summary += "\n - directory '" + dir + "'\n";
foreach (var subdir in _expiredUserDirs[dir]) { foreach (var subdir in _expiredDirs[dir]) {
summary += $" - {subdir.Dir.Name} " + summary += $" - {subdir.Dir.Name} " +
$"[age: {subdir.HumanAgeFromName}, " + $"[age: {subdir.HumanAgeFromName}, " +
$"size: {subdir.HumanSize}]\n"; $"size: {subdir.HumanSize}]\n";
...@@ -147,8 +147,8 @@ namespace ATxCommon ...@@ -147,8 +147,8 @@ namespace ATxCommon
expired.Add(dirDetails); expired.Add(dirDetails);
} }
if (expired.Count > 0) if (expired.Count > 0)
_expiredUserDirs.Add(userdir.Name, expired);
_expiredDirs.Add(userdir.Name, expired);
} }
foreach (var drive in _drives) { foreach (var drive in _drives) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment