Release 0.4.5 with metadata tools and responsive layers

This commit is contained in:
livio committed 2026-09-25 21:10:19 +02:00
1 parent 00053e4d5f
commit f480ce23ca
8 files changed
+253 -17

No files matched your search

+1 -1
View File
@@ -85,7 +85,7 @@ public sealed class MapExportService
{
var root = new XElement("gpx",
new XAttribute("version", "1.1"),
new XAttribute("creator", "LME Mappe Catastali 0.4.4"),
new XAttribute("creator", "LME Mappe Catastali 0.4.5"),
new XAttribute(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance"),
new XElement("metadata", new XElement("name", name)));
foreach (var feature in features.EnumerateArray())
+30
View File
@@ -147,6 +147,36 @@ public sealed class ProjectStorageService
finally { _gate.Release(); }
}
public async Task<MapProjectSummary> RenameAsync(string projectId, string name)
{
var normalizedName = NormalizeName(name);
await _gate.WaitAsync();
try
{
var files = await ReadProjectFilesAsync();
var project = files.FirstOrDefault(item => item.Document.Id == projectId)
?? throw new FileNotFoundException("Il progetto selezionato non esiste piu'.");
if (project.Document.AccessMode == "readonly")
{
throw new InvalidOperationException("Il progetto e' in sola lettura. Duplicalo per modificarlo.");
}
if (files.Any(item => item.Document.Id != projectId
&& string.Equals(item.Document.Name, normalizedName, StringComparison.CurrentCultureIgnoreCase)))
{
throw new InvalidOperationException($"Esiste gia' un progetto chiamato '{normalizedName}'.");
}
project.Document.Name = normalizedName;
project.Document.UpdatedAt = DateTimeOffset.UtcNow;
await File.WriteAllTextAsync(
project.Path,
JsonSerializer.Serialize(project.Document, _jsonOptions),
new UTF8Encoding(false));
return project.Document.ToSummary();
}
finally { _gate.Release(); }
}
public async Task UpdateOrganizationAsync(string projectId, string? folder = null, bool? isArchived = null)
{
await _gate.WaitAsync();