Skip to content

Releases: krichel89/LrMediaWiki2

LrMediaWiki2 2.0.39

Choose a tag to compare

@krichel89 krichel89 released this 30 Jul 10:31

Version 2.0.39 (July 2026)

The helper now logs what it is asked. Until now the bridge log held only
the startup line, which made "the request was rejected" indistinguishable from
"the request never arrived". Two rounds of debugging hung on exactly that gap.

Every request is logged with method, path, status and size, plus an explicit
line when a result is accepted from the page and another when it is handed to
Lightroom. Successful, uneventful /sync calls stay silent - they arrive once
a second and would bury everything else within the hour. Every non-200 is
logged, including the 403s from a missing token.

The wrapper needed for this passes Flush through. Without that the
Server-Sent-Events stream would have gone dead, because /events depends on
the response writer being an http.Flusher and an ordinary wrapper hides that.
The functional test counts stream events and would have caught it.

No behaviour changed otherwise.

LrMediaWiki2 2.0.37

Choose a tag to compare

@krichel89 krichel89 released this 30 Jul 10:05

Version 2.0.37 (July 2026)

The background bridge. The browser editor can now stay open and follow the
photo selection in Lightroom. A small helper (bridge/sdcbridge.go, one Go
file, standard library only) serves the editor page from
http://127.0.0.1:PORT/. Because the page then has a real origin, it can use
fetch and Server-Sent-Events without CORS and without the Private-Network
block that killed the earlier loopback attempt from a file:// page.

Lightroom never listens. Once a second it calls POST /sync, which pushes the
current photo's data when the selection changed, collects any pending result in
the same response, and doubles as the heartbeat. Both directions are outgoing
LrHttp calls, which are long proven in this plugin; LrSocket is not used at
all.

New files: MediaWikiSdcBridge.lua (Lightroom side), ToolSdcBridge.lua
(switch it on and off), MediaWikiSdcData.lua. The last one is a genuine
de-duplication: the payload building and result applying logic used to exist
twice, once in ToolEditSdcWeb.lua and once in the bridge, so a change to the
data model could land in only one of them. Both routes now share one module.
schemaVersion is unchanged.

The file route stays. Anyone who does not run the helper keeps the download
mechanism from 2.0.31 exactly as it was. The bridge is off until switched on.

Safety. The helper binds to 127.0.0.1 only, never to all interfaces. Every
request must carry a session token that Lightroom generates fresh on each
start; the comparison is constant-time. The Host header must name a loopback
address, which defeats DNS rebinding from a hostile page. There is no SDK hook
for unloading a plug-in, so the helper terminates itself after three minutes
without a heartbeat and removes its port file.

A result is never written to the wrong photo. If the user moved on in
Lightroom between opening the page and pressing save, the photo key no longer
matches and nothing is written; a dialog says so.

Architecture selection without guessing. Both macOS builds ship. Rather
than detecting the CPU (there is no documented SDK call, and shelling out to
uname -m would be another unverifiable moving part), the launcher simply
tries the arm64 build first with a short timeout and moves on to the x86_64
build if no port file appears. A build the machine cannot run therefore costs a
few seconds once instead of failing outright.

Not signed. The shipped binaries carry no signature or notarisation, so
macOS will ask once on first launch and Windows SmartScreen may warn. That has
to be sorted out before wider distribution.

The binaries are not versioned. mediawiki.lrdevplugin/bin/ is ignored;
the Go source is in the repository and ./baue-bruecke.sh produces the three
builds before packing. Git cannot delta-compress binaries, so committing them
would add roughly five megabytes of new objects per platform per release to a
history that can never be trimmed without rewriting every hash. A notarised
binary is also not byte-identical to the built one, so a committed binary would
only look like provenance.

Fixed while we were in there: .gitignore never worked. Every rule was
wrapped in double quotes (".DS_Store" and so on). Git treats quotes as
literal characters, so the file matched nothing and .DS_Store had been
shipping inside the release ZIPs. The rules are now unquoted and verified
against git check-ignore.

LrMediaWiki2 2.0.36

Choose a tag to compare

@krichel89 krichel89 released this 29 Jul 18:48

The built-in SDC dialog is gone. ToolEditSdc.lua has been removed and
with it both menu entries ("Edit Structured Data (SDC)"). The browser editor
is now the only SDC editor. The dialog had been kept as a no-browser
fallback, but it duplicated a growing amount of behaviour - two search
implementations, two ways of writing the same two stores - and the browser
editor has overtaken it in every respect except one (see below). Nothing
else referenced the file: it was reachable only from Info.lua, so the
removal touches no shared code and no metadata field definition.
schemaVersion is unchanged.

Known regression. The dialog had a checkbox that copied depicts to the
entire selection; the browser editor works on the active photo only and has
no equivalent. Until that is rebuilt, distributing a QID across many photos
has to be done photo by photo, or through the export dialog's batch
defaults.

Menu order. The browser editor is now the first entry in both the
Library and the File plug-in menus, so it sits at the top of the submenu.
The titles in the two menus remain identical, so a single macOS app shortcut
bound to the title still reaches it from either menu.

v2.0.12

Choose a tag to compare

@krichel89 krichel89 released this 11 Jul 15:30

Fixes: created_during/creator/copyright/license mit QID-Kommentaren wurden beim Upload verworfen; Export-Abbruch durch Zugriff auf nicht deklariertes otherFields-Feld (auch in Generate from Persons); aufgeraeumtes Synchronisierungsfenster. Vollstaendiger Aenderungsbericht: https://github.com/krichel89/LrMediaWiki2/blob/master/SDC-CHANGES.md

v2.0.11

Choose a tag to compare

@krichel89 krichel89 released this 11 Jul 14:18

Behebt den Katalogfehler beim Aktivieren des Plugins (Feld-Version von description_en/description_de). Vollstaendiger Aenderungsbericht: https://github.com/krichel89/LrMediaWiki2/blob/master/SDC-CHANGES.md

v2.0.10

Choose a tag to compare

@krichel89 krichel89 released this 11 Jul 12:41

Vollständiger Änderungsbericht: SDC-CHANGES.md

v2.0.9

Choose a tag to compare

@krichel89 krichel89 released this 10 Jul 14:53

LrMediaWiki2 – SDC-Erweiterungen (Cammello-Angleichung) + Sicherheits-/Robustheits-Fixes

Version 2.0.9 (Juli 2026)

Korrekturen nach Praxistest von 2.0.8 – Umbau auf ausschließlich in dieser
Lightroom-Installation NACHWEISLICH funktionierende Bindings:

  1. Suchergebnisse wieder sichtbar. Befund: push_buttons mit GEBUNDENEM
    Titel aktualisieren nicht (im Basis-Plugin existieren gebundene Titel nur
    auf static_text), und visible auf Zeilen-Containern wird ignoriert –
    deshalb blieben die Treffer-Buttons unsichtbar. Neu: Treffer erscheinen im
    Dropdown mit gebundenen Items (dieser Mechanismus hat in 2.0.7
    nachweislich funktioniert), der erste Treffer ist vorausgewählt, und
    „⬅ Übernehmen" (statischer Titel, bewiesen) übernimmt – der Normalfall
    bleibt also EIN Klick, wie gewünscht. Ein direkter Klick auf einen
    Listeneintrag ist im LrView-SDK nicht zuverlässig abbildbar: es gibt kein
    Listen-Control, der Auswahl-Observer war nachweislich unzuverlässig
    (2.0.7) und gebundene Button-Titel nachweislich unsichtbar (2.0.8).
  2. Leere Sprachzeilen ausgeblendet: visible ist jetzt auf den
    FELDERN der Caption-Zeilen gebunden statt (nur) auf der Zeile –
    Zeilen-Container haben laut SDK-Doku keine eigenen
    Nicht-Layout-Properties. VERIFY: Control-Level-visible ist in dieser
    Installation noch ungetestet; falls die leeren Zeilen weiterhin sichtbar
    sind, ist der Fallback, alle 12 Zeilen fest anzuzeigen und ➕ zu
    entfernen – bitte Rückmeldung.

Version 2.0.8 (Juli 2026)

  1. Suchergebnisse als klickbare Liste im Dialog (statt Dropdown): Nach
    0,6 s Tippruhe erscheinen bis zu 5 Treffer als Buttons direkt unter dem
    Suchfeld („Label – Beschreibung (QID)"); ein Klick übernimmt. Kein
    ✚-Button, kein Dropdown, kein Auswahl-Observer mehr – der unzuverlässige
    Klick-Observer aus 2.0.7 ist ersetzt. (Ein popup_menu lässt sich per SDK
    nicht programmatisch aufklappen; die offene Button-Liste ist das
    gewünschte Verhalten.)
  2. Kommentare jetzt sichtbar: Ein Klick auf ein Suchergebnis trägt
    Q640 # Harald Krichel ins Feld ein; die Zeile landet 1:1 als
    depicts=… im Wikitext-Feld. Im Export-Dialog sind die Defaults
    jetzt kommentiert (Q73566113 # copyrighted, Q18199165 # CC BY-SA 4.0)
    und die Lizenz-Auswahl zeigt Q18199165 # CC BY-SA 4.0 /
    Q6938433 # CC0. Der Export streift # … weiterhin vor dem Upload ab.
  3. Farbliche Hervorhebung entfernt (LrColor/text_color raus).
  4. Sprachen als freie ISO-Code-Felder: Die ersten 4 Slots sind mit
    en/de/fr/it vorbelegt; „➕ Sprache" blendet einen leeren Slot ein,
    der Code wird von Hand eingetragen (12 Slots gesamt). Geparste Captions
    in weiteren Sprachen werden automatisch auf die Slots verteilt
    (alphabetisch); bei mehr als 12 Sprachen bleiben überzählige
    caption_XX=-Zeilen verlustfrei erhalten (Überlauf-Logik, getestet).
    Ungültige Codes (< 2 Buchstaben, Leerzeichen) werden beim Speichern
    verworfen statt kaputte Labels hochzuladen.

Datei ToolEditSdc.lua wurde komplett neu geschrieben. VERIFY in Lightroom:
push_button mit GEBUNDENEM title (die Treffer-Buttons) – erstmals in diesem
Plugin verwendet; falls die Titel nicht aktualisieren, bitte melden.

Version 2.0.7 (Juli 2026)

  1. QID-Labels in zartem Blau. Per-Feld-Hintergrundfarben sind im
    Lightroom-SDK nicht möglich (background_color existiert nur auf
    scrolled_view, Min. 80 px Höhe + Scrollbalken). Stattdessen sind die
    Label-Texte der QID-Felder (Depicts, Created during) in einem dezenten
    Blau (LrColor(0.25, 0.45, 0.75)) – so sind die Wikidata-Felder
    visuell sofort erkennbar.
  2. ➕ Sprache fügt jetzt über die initialen 4 hinaus bis zu 12 Sprachen
    hinzu
    (en/de/fr/it/es/nl/pl/ru/zh/pt/ja/uk). Captions in weiteren
    Sprachen bleiben verlustfrei im Wikitext-Feld.
  3. Klick auf Suchergebnis übernimmt direkt (kein ✚-Button mehr). Ein
    Observer auf der Dropdown-Auswahl feuert automatisch; ein Guard-Flag
    verhindert, dass die programmatische Befüllung mit Suchergebnissen
    bereits einen Eintrag hinzufügt.
  4. QID-Kommentare: Ein Suchergebnis wird als Q640 # Harald Krichel
    eingetragen; bei manueller Eingabe kann man Q18199165 # CC BY-SA 4.0
    schreiben. Der Export streift den # …-Teil beim Splitten/Normalisieren
    sauber ab (Depicts-Loop, normalizeSdcQid für Batch-Felder). Kommentare
    werden in description_all gespeichert und round-trippen verlustfrei.
    Auch im Export-Dialog (Creator, Copyright, License, Created during) kann
    man jetzt Q640 # Name eintippen.

Version 2.0.6 (Juli 2026)

  1. Verteilen-Haken: Merge statt Ersetzen, standardmäßig gesetzt. Beim
    Übertragen auf die Auswahl werden fehlende QIDs ergänzt; eigene Depicts der
    Fotos bleiben erhalten. Die Duplikaterkennung greift auch über alte
    Komma-Listen (Randfall vom Test gefangen: vorher hätte Q1, Q2 + Q2 ein
    Duplikat erzeugt).
  2. Upload-Format verifiziert: Der Export erzeugt bereits eine separate
    P180-Aussage pro QID
    (per Test gegen den JSON-Aufbau bestätigt); die
    Semikolon-/Komma-Liste ist nur das Eingabeformat und wird vor dem Upload
    gesplittet. Keine Änderung nötig.
  3. Layout: QID-Feld und Suchfeld je in einer Zeile; das Ergebnis-Dropdown
    nutzt darunter die volle Breite (Depicts und Created-during).
  4. Nur noch 5 Sprachen im Caption-Dropdown (en, de, fr, it, es; 4 sichtbar,
    ➕ blendet die fünfte ein). Captions in anderen Sprachen bleiben verlustfrei
    im Wikitext-Feld und werden beim Export weiterhin publiziert.
  5. Neuer Button „⬇ Captions → Wikitext": übernimmt alle gefüllten Captions
    als {{lang|1=…}}-Blöcke an den Anfang des Wikitext-Felds (idempotent:
    identische Blöcke und doppelte Sprachen werden übersprungen); die Captions
    selbst bleiben unverändert als SDC-Labels erhalten.
  6. Umbenennung: „Description (all)" heißt jetzt überall „Wikitext"
    Set-Titel „LrMediaWiki – Wikitext", Feld-Label, Menüpunkt („🔁 Description
    fields ↔ Wikitext"), Tooltips, Übersetzung. Die Feld-ID description_all
    bleibt unverändert (kein Schema-Bump, keine Datenmigration, macOS-Kürzel
    für den SDC-Editor unberührt).

Version 2.0.5 (Juli 2026)

SDC-Editor (ToolEditSdc.lua) komplett überarbeitet:

  1. Live-Suche bei Eingabe: Suchfeld für Depicts UND Created-during – die
    Wikidata-Suche startet automatisch nach 0,6 s Tippruhe (Debounce per
    Generations-Zähler; ein neuer Tastendruck bricht die alte Abfrage ab).
    Ergebnisse erscheinen in einem Dropdown im selben Dialog (kein
    verschachtelter Modal mehr); „✚"-Button übernimmt die Auswahl.
  2. Semikolon statt Komma als Depicts-Trennzeichen (Semikolon ist
    eindeutiger in Titeln mit Komma). Der Export (MediaWikiInterface.lua)
    akzeptiert jetzt beides – Komma und Semikolon – damit bestehende
    describes=-Zeilen weiter funktionieren.
  3. Created-during mit eigener Suchzeile (Dropdown + ✚) – gleiche
    Live-Suche wie Depicts, schreibt eine einzelne QID.

Zu verifizieren in Lightroom: addObserver auf Property-Table-Felder und
items = bind(…) für dynamisch befüllte popup_menus sind Standard-SDK, aber
in diesem Plugin erstmals verwendet. Falls das Dropdown nicht aktualisiert
wird, Fallback: die Observer-Zeilen entfernen und stattdessen den alten
Button-getriebenen Ablauf beibehalten (sag Bescheid).

Version 2.0.4 (Juli 2026)

SDC-Editor leichter erreichbar: „🏷️ Edit Structured Data (SDC)" und der
Konverter stehen jetzt zusätzlich unter Bibliothek → Zusatzmoduloptionen
(LrLibraryMenuItems) – im Bibliothek-Modul ein Menü näher an der
Metadatenarbeit. Für Ein-Tasten-Zugriff auf dem Mac: Systemeinstellungen →
Tastatur → Tastaturkurzbefehle → App-Kurzbefehle → „+", App „Adobe Lightroom
Classic", als Menütitel exakt „🏷️ Edit Structured Data (SDC)" einfügen
(am besten kopieren, wegen des Emojis) und ein Kürzel vergeben. Die Titel in
beiden Menüs sind absichtlich identisch, damit das Kürzel unabhängig vom Menü
dasselbe Skript startet.

Version 2.0.3 (Juli 2026)

Wikidata-Namenssuche im SDC-Editor wieder eingebaut (war in einer früheren
Runde auf Wunsch entfernt worden): Unter dem Depicts-Feld gibt es wieder
Suchfeld + „🔍 Suchen". Die Suche nutzt wbsearchentities (öffentlich, ohne
Login, Sprache de, max. 10 Treffer); die Auswahl erfolgt in einem
Treffer-Dialog („Label – Beschreibung (QID)"), die QID wird ans Depicts-Feld
angehängt (dedupliziert, q→Q normalisiert). Zu verifizieren in Lightroom: der
Treffer-Dialog öffnet als verschachteltes Modal über dem Tool-Dialog – falls
das klemmt, Umbau auf eine Ergebnisliste im selben Dialog. Das manuelle
Depicts-Feld funktioniert unabhängig davon.

Version 2.0.2 (Juli 2026)

  1. Doppelte „Farbmarkierung beim Export" entfernt (Zusatzmodul-Manager):
    Die Zeile existierte zweimal – einmal korrekt als popup_menu mit
    übersetzbaren Farbnamen, einmal als combo_box mit rohen englischen Werten
    (und einem nil als erstem Item, das in Lua das Array kappt). Das Duplikat
    ist entfernt; die Farbnamen sind jetzt übersetzt.
  2. Farbmarkierung zusätzlich im Export-Dialog (Sektion Login/Einstellungen,
    unter dem API-Pfad). Gleiche globale Einstellung wie im Zusatzmodul-Manager
    (eine Quelle: Plug-in-Preferences; geladen in startDialog, gespeichert in
    endDialog).
  3. Set „Description (all)" auf das eine Feld reduziert (25 Zeilen hoch) –
    Captions/SDC stecken im Wikitext bzw. werden extern erstellt und
    eingefügt.
  4. Deutsche Übersetzungen ergänzt (TranslatedStrings_de.txt, ~28 neue
    Einträge): SDC-Export-Sektion, Seitenleisten-Felder inkl. Tooltips,
    Farbnamen, HTTPS-/Galerie-Meldungen, „Beschreibung (gesamt)". Nebenbei
    drei vorbestehende Formatdefekte repariert (Trailing-Komma nach dem
    schließenden Anführungszeichen in Zeilen 78/191/192 – solche Zeilen werden
    je nach Parser ignoriert). Hinweis: „Stellt dar (P180)" ggf. an die
    bevorzugte Commons-Terminologie an...
Read more

LrMediaWiki2 v2.0.0 – Complete SDC Field Support

Choose a tag to compare

@krichel89 krichel89 released this 28 Jun 18:21

[2.0.0] – 2026-06-28

Major: Structured Data (SDC) Field Support

The most significant change in v2.0: Complete support for most Wikimedia Commons Structured Data (SDC) fields directly via description_all key-value extraction.

New Features

SDC Key=Value Fields in description_all

  • Added caption_en, caption_de, caption_fr, caption_it for multilingual SDC Captions (P2096)
  • Added creator for SDC Creator (P170) – Wikidata Q-ID format
  • Added depicts for SDC Depicts (P180) – portrait/person references
  • Added copyright for SDC Copyright Status (P6216)
  • Added license for SDC License (P275)
  • Automatic extraction of all key-value pairs from description_all
  • Validation against SDC schema before upload

Single-Call API Upload

  • Refactored MediaWikiApi.lua for single-call wbeditentity uploads
  • All SDC fields are uploaded in one API request (instead of multiple calls)
  • Reduced network latency and improved reliability

Refactored Metadata Field

  • Unified description_all field replaces fragmented description/metadata fields
  • Freetext Wikitext format with structured key-value extraction
  • Supports Wikitext blocks ({{lang|...}}), templates and categories in the same field

Multilingual Caption Support

  • Automatic processing of {{en|...}}, {{de|...}}, {{fr|...}} blocks
  • Mapping to SDC Captions in multiple languages
  • Complete Wikitext content is preserved (links, formatting)

Breaking Changes

  • description_all replaces separate fields – Old separate description fields are no longer used
  • Key=Value format is case-sensitivecreator=Q640 not Creator=Q640
  • Wikidata Q-IDs requiredcreator, depicts, copyright, license require valid Q-IDs

Bug Fixes & Improvements

  • Improved error handling for invalid SDC keys
  • Better logging for key extraction during export
  • Fixed: Multilingual captions are now correctly mapped in SDC
  • Fixed: Templates and categories were partially mishandled in v1.8
  • Improved: Location template continues to be correctly prepended to description_all

Documentation

  • NEW: SDC-Workflow.md – Practical workflow examples
  • NEW: Refactoring-Details.md – Technical documentation
  • Updated: README.md with v2.0 features & SDC reference table
  • Updated: Installation.md with new metadata set explanations