big refactoring. get rid of static properties and coupled architecture. prepare system for integration tests

This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-11-17 13:14:05 +02:00
parent 22529c26ec
commit e7ea5a8ded
38 changed files with 808 additions and 157 deletions
@@ -0,0 +1,29 @@
using System.IO;
using Azaion.Common.Database;
using Azaion.Common.DTO;
namespace Azaion.Common.Services;
public class AnnotationPathResolver : IAnnotationPathResolver
{
private readonly string _labelsDir;
private readonly string _imagesDir;
private readonly string _thumbDir;
public AnnotationPathResolver(DirectoriesConfig config)
{
_labelsDir = config.LabelsDirectory;
_imagesDir = config.ImagesDirectory;
_thumbDir = config.ThumbnailsDirectory;
}
public string GetImagePath(Annotation annotation) =>
Path.Combine(_imagesDir, $"{annotation.Name}{annotation.ImageExtension}");
public string GetLabelPath(Annotation annotation) =>
Path.Combine(_labelsDir, $"{annotation.Name}.txt");
public string GetThumbPath(Annotation annotation) =>
Path.Combine(_thumbDir, $"{annotation.Name}{Constants.THUMBNAIL_PREFIX}.jpg");
}