2026-02-04 22:10:16 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ImageCatalog_2.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Data Transfer Object for application settings.
|
|
|
|
|
|
/// Uses attributes to control serialization behavior for both XML (legacy) and JSON (future).
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class SettingsDto
|
|
|
|
|
|
{
|
2026-02-16 19:55:37 +01:00
|
|
|
|
// New enum to represent thumbnail mode in a single property.
|
|
|
|
|
|
public enum ThumbnailOptionDto
|
|
|
|
|
|
{
|
|
|
|
|
|
None = 0,
|
|
|
|
|
|
Text = 1,
|
|
|
|
|
|
FileName = 2,
|
|
|
|
|
|
Time = 3,
|
|
|
|
|
|
FileNameAndTime = 4,
|
|
|
|
|
|
RaceTime = 5
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ThumbnailOption")]
|
|
|
|
|
|
[XmlElement("MiniatureModalita")]
|
|
|
|
|
|
public ThumbnailOptionDto ThumbnailOption { get; set; } = ThumbnailOptionDto.None;
|
|
|
|
|
|
|
2026-02-04 22:10:16 +01:00
|
|
|
|
// Paths
|
|
|
|
|
|
[JsonPropertyName("SourcePath")]
|
|
|
|
|
|
[XmlElement("DirSorgente")]
|
|
|
|
|
|
public string SourcePath { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("DestinationPath")]
|
|
|
|
|
|
[XmlElement("DirDestinazione")]
|
|
|
|
|
|
public string DestinationPath { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
// Thumbnails
|
|
|
|
|
|
[JsonPropertyName("CreateThumbnails")]
|
|
|
|
|
|
[XmlElement("MiniatureCrea")]
|
|
|
|
|
|
public bool CreateThumbnails { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ThumbnailPrefix")]
|
|
|
|
|
|
[XmlElement("MiniatureSuffisso")]
|
|
|
|
|
|
public string ThumbnailPrefix { get; set; } = "tn_";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ThumbnailHeight")]
|
|
|
|
|
|
[XmlElement("MiniatureAltezza")]
|
|
|
|
|
|
public int ThumbnailHeight { get; set; } = 350;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ThumbnailWidth")]
|
|
|
|
|
|
[XmlElement("MiniatureLarghezza")]
|
|
|
|
|
|
public int ThumbnailWidth { get; set; } = 350;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("FontSizeThumbnail")]
|
|
|
|
|
|
[XmlElement("FontDimensioneMiniatura")]
|
|
|
|
|
|
public int FontSizeThumbnail { get; set; } = 50;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("JpegQualityThumbnail")]
|
|
|
|
|
|
[XmlElement("CompressioneJpegMiniatura")]
|
|
|
|
|
|
public int JpegQualityThumbnail { get; set; } = 30;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AddTimeToThumbnails")]
|
|
|
|
|
|
[XmlElement("MiniatureAddOrario")]
|
|
|
|
|
|
public bool AddTimeToThumbnails { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ShowFileNameOnThumbnails")]
|
|
|
|
|
|
[XmlElement("NomeMiniatura")]
|
|
|
|
|
|
public bool ShowFileNameOnThumbnails { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AddTextToThumbnails")]
|
|
|
|
|
|
[XmlElement("MiniatureAddScritta")]
|
|
|
|
|
|
public bool AddTextToThumbnails { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AddRaceTimeToThumbnails")]
|
|
|
|
|
|
[XmlElement("TempoSmall")]
|
|
|
|
|
|
public bool AddRaceTimeToThumbnails { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AddNumberAndTimeToThumbnails")]
|
|
|
|
|
|
[XmlElement("NumTempoSmall")]
|
|
|
|
|
|
public bool AddNumberAndTimeToThumbnails { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
// Big photo
|
|
|
|
|
|
[JsonPropertyName("BigPhotoSuffix")]
|
|
|
|
|
|
[XmlElement("FotoCodice")]
|
|
|
|
|
|
public string BigPhotoSuffix { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("PhotoBigHeight")]
|
|
|
|
|
|
[XmlElement("FotoAltezza")]
|
|
|
|
|
|
public int PhotoBigHeight { get; set; } = 2240;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("PhotoBigWidth")]
|
|
|
|
|
|
[XmlElement("FotoLarghezza")]
|
|
|
|
|
|
public int PhotoBigWidth { get; set; } = 2240;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("KeepOriginalDimensions")]
|
|
|
|
|
|
[XmlElement("FotoDimOriginali")]
|
|
|
|
|
|
public bool KeepOriginalDimensions { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("JpegQuality")]
|
|
|
|
|
|
[XmlElement("CompressioneJpeg")]
|
|
|
|
|
|
public int JpegQuality { get; set; } = 85;
|
|
|
|
|
|
|
|
|
|
|
|
// Font
|
|
|
|
|
|
[JsonPropertyName("FontSize")]
|
|
|
|
|
|
[XmlElement("FontDimensione")]
|
|
|
|
|
|
public int FontSize { get; set; } = 20;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("FontName")]
|
|
|
|
|
|
[XmlElement("FontNome")]
|
|
|
|
|
|
public string FontName { get; set; } = "Arial";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("FontBold")]
|
|
|
|
|
|
[XmlElement("FontBold")]
|
|
|
|
|
|
public bool FontBold { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("TextColorRGB")]
|
|
|
|
|
|
[XmlElement("ColoreTestoRGB")]
|
|
|
|
|
|
public string TextColorRGB { get; set; } = "Yellow";
|
|
|
|
|
|
|
|
|
|
|
|
// Text
|
|
|
|
|
|
[JsonPropertyName("HorizontalText")]
|
|
|
|
|
|
[XmlElement("TestoTesto")]
|
|
|
|
|
|
public string HorizontalText { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("VerticalText")]
|
|
|
|
|
|
[XmlElement("TestoVerticale")]
|
|
|
|
|
|
public string VerticalText { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("TextTransparency")]
|
|
|
|
|
|
[XmlElement("TestoTrasparente")]
|
|
|
|
|
|
public int TextTransparency { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("TextMargin")]
|
|
|
|
|
|
[XmlElement("TestoMargine")]
|
|
|
|
|
|
public int TextMargin { get; set; } = 8;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("VerticalPosition")]
|
|
|
|
|
|
[XmlElement("TestoPosizione")]
|
|
|
|
|
|
public string VerticalPosition { get; set; } = "Basso";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("HorizontalAlignment")]
|
|
|
|
|
|
[XmlElement("TestoAllineamento")]
|
|
|
|
|
|
public string HorizontalAlignment { get; set; } = "Centro";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("VerticalTextSize")]
|
|
|
|
|
|
[XmlElement("GrandezzaVerticale")]
|
|
|
|
|
|
public int VerticalTextSize { get; set; } = 20;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("VerticalTextMargin")]
|
|
|
|
|
|
[XmlElement("MargineVerticale")]
|
|
|
|
|
|
public int VerticalTextMargin { get; set; } = 6;
|
|
|
|
|
|
|
|
|
|
|
|
// Logo/Watermark
|
|
|
|
|
|
[JsonPropertyName("LogoFile")]
|
|
|
|
|
|
[XmlElement("MarchioFile")]
|
|
|
|
|
|
public string LogoFile { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("LogoHeight")]
|
|
|
|
|
|
[XmlElement("MarchioAltezza")]
|
|
|
|
|
|
public int LogoHeight { get; set; } = 430;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("LogoWidth")]
|
|
|
|
|
|
[XmlElement("MarchioLarghezza")]
|
|
|
|
|
|
public int LogoWidth { get; set; } = 430;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("LogoMargin")]
|
|
|
|
|
|
[XmlElement("MarchioMargine")]
|
|
|
|
|
|
public int LogoMargin { get; set; } = 290;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("LogoHorizontalPosition")]
|
|
|
|
|
|
[XmlElement("MarchioAllOrizzontale")]
|
|
|
|
|
|
public string LogoHorizontalPosition { get; set; } = "Destra";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("LogoVerticalPosition")]
|
|
|
|
|
|
[XmlElement("MarchioAllVerticale")]
|
|
|
|
|
|
public string LogoVerticalPosition { get; set; } = "Basso";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("LogoTransparency")]
|
|
|
|
|
|
[XmlElement("MarchioTrasparenza")]
|
|
|
|
|
|
public int LogoTransparency { get; set; } = 100;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AddLogo")]
|
|
|
|
|
|
[XmlElement("MarchioAggiungi")]
|
|
|
|
|
|
public bool AddLogo { get; set; }
|
|
|
|
|
|
|
2026-02-15 11:13:23 +01:00
|
|
|
|
// Color-key transparency settings
|
|
|
|
|
|
[JsonPropertyName("TransparentColor")]
|
|
|
|
|
|
[XmlElement("ColoreTrasparente")]
|
|
|
|
|
|
public string TransparentColor { get; set; } = "#FFFFFF";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("UseTransparentColor")]
|
|
|
|
|
|
[XmlElement("UsaColoreTrasparente")]
|
|
|
|
|
|
public bool UseTransparentColor { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
|
|
// Selected image processing library (e.g., "System.Graphics" or "ImageSharp")
|
|
|
|
|
|
[JsonPropertyName("ImageLibrary")]
|
|
|
|
|
|
[XmlElement("ImageLibrary")]
|
2026-02-26 19:17:23 +01:00
|
|
|
|
public string ImageLibrary { get; set; } = "ImageSharp";
|
2026-02-15 11:13:23 +01:00
|
|
|
|
|
2026-02-04 22:10:16 +01:00
|
|
|
|
// Options
|
|
|
|
|
|
[JsonPropertyName("ForceJpeg")]
|
|
|
|
|
|
[XmlElement("GeneraleForzaJpg")]
|
|
|
|
|
|
public bool ForceJpeg { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AutomaticRotation")]
|
|
|
|
|
|
[XmlElement("GeneraleRotazioneAutomatica")]
|
|
|
|
|
|
public bool AutomaticRotation { get; set; }
|
|
|
|
|
|
|
2026-02-14 19:36:58 +01:00
|
|
|
|
[JsonPropertyName("UpdateSubdirectories")]
|
|
|
|
|
|
[XmlElement("DirSottoDirectory")]
|
|
|
|
|
|
public bool UpdateSubdirectories { get; set; }
|
|
|
|
|
|
|
2026-02-04 22:10:16 +01:00
|
|
|
|
[JsonPropertyName("AddRaceTime")]
|
|
|
|
|
|
[XmlElement("TempoGara")]
|
|
|
|
|
|
public bool AddRaceTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("AddTime")]
|
|
|
|
|
|
[XmlElement("Orario")]
|
|
|
|
|
|
public bool AddTime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("TimeLabel")]
|
|
|
|
|
|
[XmlElement("EtichettaOrario")]
|
|
|
|
|
|
public string TimeLabel { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ShowDate")]
|
|
|
|
|
|
[XmlElement("DataFoto")]
|
|
|
|
|
|
public bool ShowDate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ShowPhotoNumber")]
|
|
|
|
|
|
[XmlElement("NumeroFoto")]
|
|
|
|
|
|
public bool ShowPhotoNumber { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("OverwriteImages")]
|
|
|
|
|
|
[XmlElement("GeneraleSovrascriviFile")]
|
|
|
|
|
|
public bool OverwriteImages { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
// Folder division
|
|
|
|
|
|
[JsonPropertyName("FilesPerFolder")]
|
|
|
|
|
|
[XmlElement("DirDividiNumFile")]
|
|
|
|
|
|
public int FilesPerFolder { get; set; } = 99;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("FolderSuffix")]
|
|
|
|
|
|
[XmlElement("DirDividiSuffisso")]
|
|
|
|
|
|
public string FolderSuffix { get; set; } = "";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("CounterDigits")]
|
|
|
|
|
|
[XmlElement("DirDividiNumCifre")]
|
|
|
|
|
|
public int CounterDigits { get; set; } = 2;
|
|
|
|
|
|
|
|
|
|
|
|
// Processing
|
|
|
|
|
|
[JsonPropertyName("ChunkSize")]
|
|
|
|
|
|
[XmlElement("ChunkSize")]
|
|
|
|
|
|
public int ChunkSize { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ThreadsCount")]
|
|
|
|
|
|
[XmlElement("ThreadsCount")]
|
|
|
|
|
|
public int ThreadsCount { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
// Race date
|
|
|
|
|
|
[JsonPropertyName("RaceStartDate")]
|
|
|
|
|
|
[XmlElement("DataPartenza")]
|
|
|
|
|
|
public DateTime RaceStartDate { get; set; } = DateTime.Now;
|
2026-02-16 18:32:04 +01:00
|
|
|
|
|
|
|
|
|
|
// AI / OCR settings
|
|
|
|
|
|
[JsonPropertyName("ExtractNumbers")]
|
|
|
|
|
|
[XmlElement("AI_EstraiNumeri")]
|
|
|
|
|
|
public bool ExtractNumbers { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ModelsFolderPath")]
|
|
|
|
|
|
[XmlElement("AI_CartellaModelli")]
|
|
|
|
|
|
public string ModelsFolderPath { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("CsvOutputPath")]
|
|
|
|
|
|
[XmlElement("AI_PercorsoCsv")]
|
|
|
|
|
|
public string CsvOutputPath { get; set; }
|
2026-02-28 21:34:45 +01:00
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("FaceExecutablePath")]
|
|
|
|
|
|
[XmlElement("AI_FaceExecutablePath")]
|
|
|
|
|
|
public string FaceExecutablePath { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("FaceOutputFolderPath")]
|
|
|
|
|
|
[XmlElement("AI_FaceOutputFolderPath")]
|
|
|
|
|
|
public string FaceOutputFolderPath { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
// Race upload settings
|
|
|
|
|
|
[JsonPropertyName("ApiLogin")]
|
|
|
|
|
|
[XmlElement("RaceUpload_Login")]
|
|
|
|
|
|
public string ApiLogin { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiPassword")]
|
|
|
|
|
|
[XmlElement("RaceUpload_Password")]
|
|
|
|
|
|
public string ApiPassword { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiRaceDescription")]
|
|
|
|
|
|
[XmlElement("RaceUpload_Description")]
|
|
|
|
|
|
public string ApiRaceDescription { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiRaceTypeId")]
|
|
|
|
|
|
[XmlElement("RaceUpload_TipoGaraId")]
|
|
|
|
|
|
public string ApiRaceTypeId { get; set; } = "1";
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiRaceStartDate")]
|
|
|
|
|
|
[XmlElement("RaceUpload_StartDate")]
|
|
|
|
|
|
public DateTime ApiRaceStartDate { get; set; } = DateTime.Today;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiRaceEndDate")]
|
|
|
|
|
|
[XmlElement("RaceUpload_EndDate")]
|
|
|
|
|
|
public DateTime ApiRaceEndDate { get; set; } = DateTime.Today;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiPathBase")]
|
|
|
|
|
|
[XmlElement("RaceUpload_PathBase")]
|
|
|
|
|
|
public string ApiPathBase { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiLocalita")]
|
|
|
|
|
|
[XmlElement("RaceUpload_Localita")]
|
|
|
|
|
|
public string ApiLocalita { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiEventoInLineaIndex")]
|
|
|
|
|
|
[XmlElement("RaceUpload_EventoInLinea")]
|
|
|
|
|
|
public int ApiEventoInLineaIndex { get; set; } = 0;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiTipoIndexValue")]
|
|
|
|
|
|
[XmlElement("RaceUpload_TipoIndex")]
|
|
|
|
|
|
public int ApiTipoIndexValue { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiFreeEventIndex")]
|
|
|
|
|
|
[XmlElement("RaceUpload_FreeEvent")]
|
|
|
|
|
|
public int ApiFreeEventIndex { get; set; } = 0;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiRaceId")]
|
|
|
|
|
|
[XmlElement("RaceUpload_LastRaceId")]
|
|
|
|
|
|
public string ApiRaceId { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("ApiRemoteProcessedBasePath")]
|
|
|
|
|
|
[XmlElement("RaceUpload_RemoteProcessedBasePath")]
|
|
|
|
|
|
public string ApiRemoteProcessedBasePath { get; set; } = string.Empty;
|
2026-02-04 22:10:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|