summaryrefslogtreecommitdiff
path: root/internal/render/render.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 22:48:55 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 22:48:55 +0200
commitf73decedab916d336247d4ea43ead2b7f7da1e83 (patch)
tree507a7c0708bc09b6bc93728953a1196c6d67439d /internal/render/render.go
parentbcdd60c51b35750e76cc13f7251ccd3f3d018bc8 (diff)
downloadlectio-f73decedab916d336247d4ea43ead2b7f7da1e83.tar.gz
lectio-f73decedab916d336247d4ea43ead2b7f7da1e83.zip
cli,tui,web: share traditional+offline pl-drop via render.EffectiveVersions; -v/--version any position
Diffstat (limited to 'internal/render/render.go')
-rw-r--r--internal/render/render.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/render/render.go b/internal/render/render.go
index 6bccc65..265ed18 100644
--- a/internal/render/render.go
+++ b/internal/render/render.go
@@ -225,6 +225,19 @@ func OfflineVersions(versions []string) []string {
return out
}
+// EffectiveVersions is the version set actually loadable for a request: "pl"
+// (the niedziela.pl modern scrape) is dropped -- substituting "wuj" if it was
+// the only Polish column, via OfflineVersions -- whenever the scrape is
+// unavailable: offline (never fetch) OR the traditional lectionary
+// (missalemeum, which has no niedziela.pl scrape). Shared by cli, tui and web
+// so all three binaries treat traditional/offline versions identically.
+func EffectiveVersions(versions []string, lectionary string, offline bool) []string {
+ if offline || lectionary == "traditional" {
+ return OfflineVersions(versions)
+ }
+ return versions
+}
+
// Compare lays the versions of one reading section out as parallel columns,
// side by side, wrapped to fit width. Ports render_compare. lang selects the
// column-header label language (see GatherVersion).