mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Fixed a bug where the last modiefied Date would be in UTC
This commit is contained in:
@@ -21,7 +21,6 @@ namespace HaDocument
|
||||
private static ILibrary _library;
|
||||
|
||||
public static ILibrary Create(IHaDocumentOptions Settings) {
|
||||
Console.WriteLine("PARSING");
|
||||
SettingsValidator.Validate(Settings);
|
||||
_settings = Settings;
|
||||
_createReader();
|
||||
|
||||
@@ -13,6 +13,11 @@ public class XMLProvider : IXMLProvider {
|
||||
_fileProvider = provider;
|
||||
_Roots = xmlservice.GetRootsDictionary();
|
||||
_Files = _ScanFiles();
|
||||
|
||||
if (_Files != null)
|
||||
foreach(var category in _Files)
|
||||
if (category.Value != null)
|
||||
xmlservice.AutoUse(category.Value);
|
||||
}
|
||||
|
||||
public FileList? GetFiles(string prefix)
|
||||
@@ -41,7 +46,7 @@ public class XMLProvider : IXMLProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
doc.SetFile(info);
|
||||
doc.File = info;
|
||||
|
||||
if (_Files == null) _Files = new Dictionary<string, FileList?>();
|
||||
if (!_Files.ContainsKey(doc.Prefix)) _Files.Add(doc.Prefix, new FileList(doc.XMLRoot));
|
||||
|
||||
@@ -8,6 +8,8 @@ using HaWeb.XMLParser;
|
||||
public class XMLRootDocument {
|
||||
private XElement? _Element;
|
||||
private string? _filename;
|
||||
|
||||
[JsonIgnore]
|
||||
public IXMLRoot XMLRoot { get; private set; }
|
||||
|
||||
[JsonIgnore]
|
||||
@@ -29,7 +31,7 @@ public class XMLRootDocument {
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public IFileInfo? File { get; private set; }
|
||||
public IFileInfo? File { get; set; }
|
||||
public string Prefix { get; private set; }
|
||||
public DateTime Date { get; private set; }
|
||||
|
||||
@@ -40,7 +42,10 @@ public class XMLRootDocument {
|
||||
public XMLRootDocument(IXMLRoot xmlRoot, IFileInfo file) {
|
||||
XMLRoot = xmlRoot;
|
||||
Prefix = xmlRoot.Prefix;
|
||||
SetFile(file);
|
||||
File = file;
|
||||
Date = file.LastModified.LocalDateTime;
|
||||
_filename = file.Name;
|
||||
_GenerateFieldsFromFilename(file.Name);
|
||||
}
|
||||
|
||||
// Entry point for XML upload reading
|
||||
@@ -52,12 +57,6 @@ public class XMLRootDocument {
|
||||
_Element = element;
|
||||
}
|
||||
|
||||
public void SetFile(IFileInfo file) {
|
||||
File = file;
|
||||
Date = file.LastModified.DateTime;
|
||||
_GenerateFieldsFromFilename(file.Name);
|
||||
}
|
||||
|
||||
private string _CreateFilename() {
|
||||
var filename = _removeInvalidChars(Prefix) + "_";
|
||||
if (!String.IsNullOrWhiteSpace(IdentificationString.Item1)) {
|
||||
|
||||
Reference in New Issue
Block a user