mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Möglichkeit zur Angabe eines zeitraumes für die angezeigten Briefe
This commit is contained in:
@@ -10,6 +10,7 @@ namespace HaDocument.Interfaces {
|
||||
ImmutableDictionary<string, Tradition> Traditions { get; }
|
||||
ImmutableDictionary<string, Person> Persons { get; }
|
||||
ImmutableDictionary<string, Meta> Metas { get; }
|
||||
ImmutableDictionary<string, Meta> ExcludedMetas { get; }
|
||||
ImmutableDictionary<string, Marginal> Marginals { get; }
|
||||
ImmutableDictionary<string, Location> Locations { get; }
|
||||
ImmutableDictionary<string, Letter> Letters { get; }
|
||||
@@ -27,6 +28,7 @@ namespace HaDocument.Interfaces {
|
||||
Lookup<string, Editreason> EditreasonsByLetter { get; }
|
||||
ImmutableSortedSet<Meta> MetasByDate { get; }
|
||||
ILookup<int, Meta> MetasByYear { get; }
|
||||
ILookup<int, Meta> ExcludedMetasByYear { get; }
|
||||
ImmutableDictionary<string, Comment> SubCommentsByID { get; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ namespace HaDocument.Models
|
||||
public Dictionary<string, Tradition> Traditions;
|
||||
public Dictionary<string, Person> Persons;
|
||||
public Dictionary<string, Meta> Metas;
|
||||
public Dictionary<string, Meta> ExcludedMetas;
|
||||
public Dictionary<string, Marginal> Marginals;
|
||||
public Dictionary<string, Location> Locations;
|
||||
public Dictionary<string, Letter> Letters;
|
||||
@@ -55,6 +56,7 @@ namespace HaDocument.Models
|
||||
Traditions,
|
||||
Persons,
|
||||
Metas,
|
||||
ExcludedMetas,
|
||||
Marginals,
|
||||
Locations,
|
||||
Letters,
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace HaDocument.Models
|
||||
public ImmutableDictionary<string, Tradition> Traditions { get; }
|
||||
public ImmutableDictionary<string, Person> Persons { get; }
|
||||
public ImmutableDictionary<string, Meta> Metas { get; }
|
||||
public ImmutableDictionary<string, Meta> ExcludedMetas { get; }
|
||||
public ImmutableDictionary<string, Marginal> Marginals { get; }
|
||||
public ImmutableDictionary<string, Location> Locations { get; }
|
||||
public ImmutableDictionary<string, Letter> Letters { get; }
|
||||
@@ -42,12 +43,14 @@ namespace HaDocument.Models
|
||||
public ImmutableSortedSet<Meta> MetasByDate { get; }
|
||||
// Auswählen von Briefen nach dem Jahr, sortiert nach Datum
|
||||
public ILookup<int, Meta> MetasByYear { get; }
|
||||
public ILookup<int, Meta> ExcludedMetasByYear { get; }
|
||||
|
||||
|
||||
public Library(
|
||||
Dictionary<string, Tradition> traditions,
|
||||
Dictionary<string, Person> persons,
|
||||
Dictionary<string, Meta> meta,
|
||||
Dictionary<string, Meta> excludedMeta,
|
||||
Dictionary<string, Marginal> marginals,
|
||||
Dictionary<string, Location> locations,
|
||||
Dictionary<string, Letter> letters,
|
||||
@@ -72,6 +75,7 @@ namespace HaDocument.Models
|
||||
Editreasons = ImmutableDictionary.ToImmutableDictionary(editReasons);
|
||||
Comments = ImmutableDictionary.ToImmutableDictionary(comments);
|
||||
Apps = ImmutableDictionary.ToImmutableDictionary(apps);
|
||||
ExcludedMetas = ImmutableDictionary.ToImmutableDictionary(excludedMeta);
|
||||
|
||||
var backbuilder = ImmutableDictionary.CreateBuilder<string, ImmutableList<Backlink>>();
|
||||
foreach (var entry in backlinks)
|
||||
@@ -95,6 +99,7 @@ namespace HaDocument.Models
|
||||
EditreasonsByLetter = (Lookup<string, Editreason>)Editreasons.Values.ToLookup(x => x.Letter);
|
||||
MetasByDate = Metas.Values.ToImmutableSortedSet<Meta>(new DefaultComparer());
|
||||
MetasByYear = Metas.Values.ToLookup(x => x.Sort.Year);
|
||||
ExcludedMetasByYear = ExcludedMetas.Values.ToLookup(x => x.Sort.Year);
|
||||
|
||||
var tempbuilder = ImmutableDictionary.CreateBuilder<string, Comment>();
|
||||
foreach (var comm in Comments)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace HaDocument.Reactors {
|
||||
class MetaReactor : Reactor {
|
||||
|
||||
internal Dictionary<string, Meta> CreatedInstances { get; }
|
||||
|
||||
internal Dictionary<string, Meta> ExcludedInstances { get; }
|
||||
private string[] _availableVolumes;
|
||||
private (int, int) _availableYearRange;
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace HaDocument.Reactors {
|
||||
_availableYearRange = availableYearRange;
|
||||
lib.Metas = new Dictionary<string, Meta>();
|
||||
CreatedInstances = lib.Metas;
|
||||
lib.ExcludedMetas = new Dictionary<string, Meta>();
|
||||
ExcludedInstances = lib.ExcludedMetas;
|
||||
reader.OpenTag += Listen;
|
||||
}
|
||||
|
||||
@@ -150,13 +152,8 @@ namespace HaDocument.Reactors {
|
||||
}
|
||||
|
||||
private void Add() {
|
||||
if (
|
||||
_availableVolumes.Contains(Volume) ||
|
||||
(Sort.Year >= _availableYearRange.Item1 && Sort.Year <= _availableYearRange.Item2) ||
|
||||
(_availableVolumes == null && _availableYearRange.Item1 == 0 && _availableYearRange.Item2 == 0)
|
||||
) {
|
||||
var ZHInfo = !inZH ? null : new ZHInfo(AltLineNumbering, dateChanged, Volume, Page);
|
||||
var meta = new Meta(
|
||||
var ZHInfo = !inZH ? null : new ZHInfo(AltLineNumbering, dateChanged, Volume, Page);
|
||||
var meta = new Meta(
|
||||
Index,
|
||||
Autopsic,
|
||||
Date,
|
||||
@@ -170,8 +167,16 @@ namespace HaDocument.Reactors {
|
||||
Receivers,
|
||||
ZHInfo
|
||||
);
|
||||
if (
|
||||
_availableVolumes.Contains(Volume) ||
|
||||
(Sort.Year >= _availableYearRange.Item1 && Sort.Year <= _availableYearRange.Item2) ||
|
||||
(_availableVolumes == null && _availableYearRange.Item1 == 0 && _availableYearRange.Item2 == 0)
|
||||
) {
|
||||
CreatedInstances.TryAdd(meta.Index, meta);
|
||||
}
|
||||
else {
|
||||
ExcludedInstances.TryAdd(meta.Index, meta);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Reset() {
|
||||
|
||||
Reference in New Issue
Block a user