2 Commits

Author SHA1 Message Date
9b61eceb80 Updated to Phares 8.0.118.14751 for Shared and Metadata 2025-07-20 08:28:52 -07:00
97797fc440 disk-info-helper
selenium-helper (Not fully tested)

sync-helper (Not fully tested)
2025-06-23 11:16:17 -07:00
4 changed files with 18 additions and 18 deletions

View File

@ -31,7 +31,7 @@
<PackageReference Include="System.Drawing.Common" Version="8.0.16" />
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.5" />
<PackageReference Include="Phares.AA.Shared" Version="8.0.114.12235" />
<PackageReference Include="Phares.AA.Metadata" Version="8.0.114.12235" />
<PackageReference Include="Phares.Shared" Version="8.0.118.14751" />
<PackageReference Include="Phares.Metadata" Version="8.0.118.14751" />
</ItemGroup>
</Project>

View File

@ -7,10 +7,10 @@ using System.Drawing.Imaging;
using System.IO.Compression;
using System.Runtime.InteropServices;
using System.Text.Json;
using View_by_Distance.Metadata.Models;
using View_by_Distance.Metadata.Models.Stateless;
using View_by_Distance.Shared.Models;
using View_by_Distance.Shared.Models.Stateless;
using Phares.Metadata.Models;
using Phares.Metadata.Models.Stateless;
using Phares.Shared.Models;
using Phares.Shared.Models.Stateless;
namespace File_Watcher.Helpers;
@ -20,11 +20,12 @@ internal static partial class DeterministicHashCodeHelper
private class Windows : IWindows, IDisposable
{
public long Ticks { get; init; }
public int? CurrentTick => _ProgressBar?.CurrentTick;
private ProgressBar? _ProgressBar;
private readonly ProgressBarOptions _ProgressBarOptions;
public int CurrentTick { get; internal set; }
public Windows() =>
_ProgressBarOptions = new() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true };
@ -164,7 +165,7 @@ internal static partial class DeterministicHashCodeHelper
string sourceDirectory;
List<string> check = [];
string archiveEntryFile;
long ticks = DateTime.Now.Ticks;
Windows windows = new();
ReadOnlyCollection<FirstPass> collection;
string rootDirectory = Path.GetFullPath(appSettings.ResultSettings.RootDirectory);
if (!Directory.Exists(rootDirectory))
@ -187,7 +188,7 @@ internal static partial class DeterministicHashCodeHelper
archiveEntryFile = Path.Combine(sourceDirectory, zipArchiveEntry.Name);
zipArchiveEntry.ExtractToFile(archiveEntryFile);
}
collection = WindowsWork(logger, appSettings, ticks, sourceDirectory);
collection = WindowsWork(windows, logger, appSettings, sourceDirectory);
if (check.Count == collection.Count)
{
json = JsonSerializer.Serialize(collection.ToList(), FirstPassCollectionSourceGenerationContext.Default.ListFirstPass);
@ -198,12 +199,11 @@ internal static partial class DeterministicHashCodeHelper
return true;
}
private static ReadOnlyCollection<FirstPass> WindowsWork(ILogger<Worker>? logger, AppSettings appSettings, long ticks, string sourceDirectory)
private static ReadOnlyCollection<FirstPass> WindowsWork(IWindows windows, ILogger<Worker>? logger, AppSettings appSettings, string sourceDirectory)
{
ReadOnlyCollection<FirstPass> results;
Windows windows = new();
IWindows windowsInterface = windows;
logger?.LogInformation("{Ticks} {RootDirectory}", ticks, sourceDirectory);
logger?.LogInformation("{Ticks} {RootDirectory}", windows.Ticks, sourceDirectory);
A_Metadata metadata = new(appSettings.ResultSettings, appSettings.MetadataSettings);
int appSettingsMaxDegreeOfParallelism = appSettings.DeterministicHashCodeConfiguration.MaxDegreeOfParallelism;
ReadOnlyCollection<string> files = Directory.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories).AsReadOnly();
@ -299,7 +299,7 @@ internal static partial class DeterministicHashCodeHelper
return result;
}
private static ReadOnlyCollection<FirstPass> WindowsAsynchronousWork(AppSettings appSettings, Windows windows, ReadOnlyCollection<string> files, A_Metadata metadata, int appSettingsMaxDegreeOfParallelism)
private static ReadOnlyCollection<FirstPass> WindowsAsynchronousWork(AppSettings appSettings, IWindows windows, ReadOnlyCollection<string> files, A_Metadata metadata, int appSettingsMaxDegreeOfParallelism)
{
List<FirstPass> results = [];
FirstPass firstPass;

View File

@ -182,7 +182,7 @@ internal static partial class DiskInfoHelper
ReadOnlyCollection<string> normalized = GetNormalized(appSettings, logger, devices);
string text = string.Join(Environment.NewLine, normalized);
string markdown = string.Concat("# ",
Environment.MachineName.ToUpper(),
Environment.MachineName.ToLower(),
Environment.NewLine,
Environment.NewLine,
"## Normalized",
@ -214,7 +214,7 @@ internal static partial class DiskInfoHelper
Environment.NewLine,
"```",
Environment.NewLine);
WriteAllText(Path.Combine(appSettings.DiskInfoConfiguration.Destination, $"{Environment.MachineName.ToUpper()}.md"), markdown);
WriteAllText(Path.Combine(appSettings.DiskInfoConfiguration.Destination, $"{Environment.MachineName.ToLower()}.md"), markdown);
return true;
}
@ -320,7 +320,7 @@ internal static partial class DiskInfoHelper
networkAdapter = standardOutput;
else if (segments[0] == "Win32_Processor")
processor = standardOutput;
WriteAllText(Path.Combine(appSettings.DiskInfoConfiguration.Destination, $"{Environment.MachineName.ToUpper()}-{segments[0]}-{date}.json"), standardOutput);
WriteAllText(Path.Combine(appSettings.DiskInfoConfiguration.Destination, $"{Environment.MachineName.ToLower()}-{segments[0]}-{date}.json"), standardOutput);
}
}
}

View File

@ -1,6 +1,6 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using View_by_Distance.Shared.Models;
using Phares.Shared.Models;
namespace File_Watcher.Models;