mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:06:31 +00:00
queue + local sqlite WIP
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Azaion.CommonSecurity;
|
||||
using Azaion.CommonSecurity.DTO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Azaion.Common.DTO.Config;
|
||||
@@ -8,12 +10,12 @@ public class AppConfig
|
||||
{
|
||||
public ApiConfig ApiConfig { get; set; } = null!;
|
||||
|
||||
public QueueConfig QueueConfig { get; set; } = null!;
|
||||
|
||||
public DirectoriesConfig DirectoriesConfig { get; set; } = null!;
|
||||
|
||||
public AnnotationConfig AnnotationConfig { get; set; } = null!;
|
||||
|
||||
public AnnotatorWindowConfig AnnotatorWindowConfig { get; set; } = null!;
|
||||
|
||||
public AIRecognitionConfig AIRecognitionConfig { get; set; } = null!;
|
||||
|
||||
public ThumbnailConfig ThumbnailConfig { get; set; } = null!;
|
||||
@@ -30,7 +32,7 @@ public class ConfigUpdater : IConfigUpdater
|
||||
public void CheckConfig()
|
||||
{
|
||||
var exePath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)!;
|
||||
var configFilePath = Path.Combine(exePath, Constants.CONFIG_PATH);
|
||||
var configFilePath = Path.Combine(exePath, SecurityConstants.CONFIG_PATH);
|
||||
|
||||
if (File.Exists(configFilePath))
|
||||
return;
|
||||
@@ -39,9 +41,9 @@ public class ConfigUpdater : IConfigUpdater
|
||||
{
|
||||
ApiConfig = new ApiConfig
|
||||
{
|
||||
Url = Constants.DEFAULT_API_URL,
|
||||
RetryCount = Constants.DEFAULT_API_RETRY_COUNT,
|
||||
TimeoutSeconds = Constants.DEFAULT_API_TIMEOUT_SECONDS
|
||||
Url = SecurityConstants.DEFAULT_API_URL,
|
||||
RetryCount = SecurityConstants.DEFAULT_API_RETRY_COUNT,
|
||||
TimeoutSeconds = SecurityConstants.DEFAULT_API_TIMEOUT_SECONDS
|
||||
},
|
||||
|
||||
AnnotationConfig = new AnnotationConfig
|
||||
@@ -49,12 +51,11 @@ public class ConfigUpdater : IConfigUpdater
|
||||
AnnotationClasses = Constants.DefaultAnnotationClasses,
|
||||
VideoFormats = Constants.DefaultVideoFormats,
|
||||
ImageFormats = Constants.DefaultImageFormats,
|
||||
},
|
||||
|
||||
AnnotatorWindowConfig = new AnnotatorWindowConfig
|
||||
{
|
||||
LeftPanelWidth = Constants.DEFAULT_LEFT_PANEL_WIDTH,
|
||||
RightPanelWidth = Constants.DEFAULT_RIGHT_PANEL_WIDTH
|
||||
RightPanelWidth = Constants.DEFAULT_RIGHT_PANEL_WIDTH,
|
||||
|
||||
AnnotationsDbFile = Constants.DEFAULT_ANNOTATIONS_DB_FILE
|
||||
},
|
||||
|
||||
DirectoriesConfig = new DirectoriesConfig
|
||||
@@ -86,6 +87,6 @@ public class ConfigUpdater : IConfigUpdater
|
||||
|
||||
public void Save(AppConfig config)
|
||||
{
|
||||
File.WriteAllText(Constants.CONFIG_PATH, JsonConvert.SerializeObject(config, Formatting.Indented), Encoding.UTF8);
|
||||
File.WriteAllText(SecurityConstants.CONFIG_PATH, JsonConvert.SerializeObject(config, Formatting.Indented), Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user