From f73decedab916d336247d4ea43ead2b7f7da1e83 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 23 Jul 2026 22:48:55 +0200 Subject: cli,tui,web: share traditional+offline pl-drop via render.EffectiveVersions; -v/--version any position --- internal/render/render.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/render/render.go') 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). -- cgit v1.3