net7.0
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>library</OutputType>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PackageId>Phares.View.by.Distance.Distance</PackageId>
|
||||
@ -34,14 +34,12 @@
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Humanizer.Core" Version="2.13.14" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.7.1" />
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="ShellProgressBar" Version="5.1.0" />
|
||||
<PackageReference Include="WindowsShortcutFactory" Version="1.0.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Text.Json" Version="6.0.0" />
|
||||
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
|
||||
<PackageReference Include="MetadataExtractor" Version="2.7.2" />
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="ShellProgressBar" Version="5.2.0" />
|
||||
<PackageReference Include="WindowsShortcutFactory" Version="1.1.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FaceRecognitionDotNet\FaceRecognitionDotNet.csproj" />
|
||||
|
@ -4,6 +4,7 @@ using View_by_Distance.FaceRecognitionDotNet;
|
||||
using View_by_Distance.Map.Models;
|
||||
using View_by_Distance.Shared.Models;
|
||||
using View_by_Distance.Shared.Models.Properties;
|
||||
using WindowsShortcutFactory;
|
||||
|
||||
namespace View_by_Distance.Distance.Models;
|
||||
|
||||
@ -354,4 +355,55 @@ public class MapLogicSupport : Shared.Models.Methods.IMapLogicSupport
|
||||
return result;
|
||||
}
|
||||
|
||||
private static bool TryToFind(string a2PeopleSingletonDirectory, string file, string path)
|
||||
{
|
||||
bool result = false;
|
||||
string? pathName = Path.GetFileName(path);
|
||||
string? group = Path.GetDirectoryName(path);
|
||||
string? groupName = Path.GetFileName(group);
|
||||
if (pathName is not null && group is not null && groupName is not null)
|
||||
{
|
||||
WindowsShortcut windowsShortcut;
|
||||
string checkDirectory = Path.Combine(a2PeopleSingletonDirectory, groupName, pathName);
|
||||
if (Directory.Exists(checkDirectory))
|
||||
{
|
||||
try
|
||||
{
|
||||
windowsShortcut = new() { Path = checkDirectory };
|
||||
windowsShortcut.Save(file);
|
||||
windowsShortcut.Dispose();
|
||||
result = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void BeforeSaveResizedImagesByPersonKeyFormatted(string[] jLinks, string a2PeopleSingletonDirectory)
|
||||
{
|
||||
string[] files;
|
||||
string checkDirectory;
|
||||
WindowsShortcut windowsShortcut;
|
||||
foreach (string directoryName in jLinks)
|
||||
{
|
||||
checkDirectory = Path.Combine(a2PeopleSingletonDirectory, directoryName);
|
||||
if (!Directory.Exists(checkDirectory))
|
||||
continue;
|
||||
files = Directory.GetFiles(checkDirectory, "*.lnk", SearchOption.TopDirectoryOnly);
|
||||
foreach (string file in files)
|
||||
{
|
||||
windowsShortcut = WindowsShortcut.Load(file);
|
||||
if (windowsShortcut.Path is null)
|
||||
continue;
|
||||
if (!Directory.Exists(windowsShortcut.Path))
|
||||
{
|
||||
if (!TryToFind(a2PeopleSingletonDirectory, file, windowsShortcut.Path))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user