feat: Add AI extraction service and related view models
- Introduced `IAiExtractionService` and its implementation `AiExtractionService` for processing images and extracting text. - Created `AiResultItem` model to hold results from AI extraction. - Added `ImageProcessingCoordinator` to manage image processing tasks and provide progress updates. - Implemented view models for AI settings, path settings, processing state, race upload settings, and visual settings to support UI binding. - Updated `Program.cs` to register new services and dependencies. - Modified project file to skip MinVer execution during local builds.
This commit is contained in:
parent
bdf503c627
commit
3c722a66df
16 changed files with 1462 additions and 628 deletions
49
imagecatalog/ViewModels/PathSettingsViewModel.cs
Normal file
49
imagecatalog/ViewModels/PathSettingsViewModel.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ImageCatalog_2.ViewModels;
|
||||
|
||||
public class PathSettingsViewModel : ViewModelBase
|
||||
{
|
||||
private string _sourcePath = string.Empty;
|
||||
public string SourcePath
|
||||
{
|
||||
get => _sourcePath;
|
||||
set
|
||||
{
|
||||
_sourcePath = value;
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private string _destinationPath = string.Empty;
|
||||
public string DestinationPath
|
||||
{
|
||||
get => _destinationPath;
|
||||
set
|
||||
{
|
||||
_destinationPath = value;
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void NormalizePaths()
|
||||
{
|
||||
SourcePath = NormalizePath(SourcePath);
|
||||
DestinationPath = NormalizePath(DestinationPath);
|
||||
}
|
||||
|
||||
public static string NormalizePath(string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
path = path.Trim().Trim('"');
|
||||
path = path.Replace('/', Path.DirectorySeparatorChar)
|
||||
.Replace('\\', Path.DirectorySeparatorChar);
|
||||
|
||||
return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue