Fixed ZHLookup

This commit is contained in:
schnulller
2022-06-19 00:18:02 +02:00
parent 4ef0e260e0
commit cfd1b5fd59
3 changed files with 10 additions and 3 deletions

View File

@@ -38,7 +38,14 @@ public class SucheController : Controller {
var lines = pages.ContainsKey(zhpage) ? pages[zhpage] : null; var lines = pages.ContainsKey(zhpage) ? pages[zhpage] : null;
if (lines == null) return _error404(); if (lines == null) return _error404();
var letters = lines.Aggregate(new HashSet<string>(), (x, y) => { x.Add(y.Value); return x; }); var letters = lines.Aggregate(new HashSet<string>(), (x, y) => { x.Add(y.Value); return x; });
if (letters != null && letters.Any() && letters.Count == 1) return RedirectToAction("Index", "Briefe", new { id = letters.First() }); if (letters != null && letters.Any() && letters.Count == 1) {
string? autopsic = null;
if (lib.Metas.ContainsKey(letters.First())) {
autopsic = lib.Metas[letters.First()].Autopsic;
}
if (autopsic == null) return _error404();
return RedirectToAction("Index", "Briefe", new { id = autopsic });
}
if (letters != null && letters.Any()) { if (letters != null && letters.Any()) {
var metas = lib.Metas.Where(x => letters.Contains(x.Key)).Select(x => x.Value); var metas = lib.Metas.Where(x => letters.Contains(x.Key)).Select(x => x.Value);
if (metas == null) return _error404(); if (metas == null) return _error404();

View File

@@ -40,7 +40,7 @@
} }
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill { .ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill {
@apply text-sm rounded px-1.5 ml-2 py-0.5 leading-none caps-allpetite tracking-wide whitespace-nowrap @apply text-xs rounded px-1.5 ml-2 py-0.5 leading-none tracking-wide whitespace-nowrap
} }
.ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross { .ha-letterhead .ha-metadata .ha-metadataupperrow .ha-pill .ha-cross {

File diff suppressed because one or more lines are too long