By Gotcha26 - contact@julien-moreau.fr
The auto-update system allows the PiwigoPublish Lightroom plugin to check for new versions via the GitHub Releases API and notify users when updates are available.
- Automatic check on startup: Silent check when Lightroom loads (once per day)
- Manual check: Button in Plugin Manager to check on demand
- Multi-format versioning: Supports both date-based and SemVer formats
- Cross-format comparison: Can compare versions even when switching versioning schemes
- User-friendly notifications: Dialog with changelog and download link
| Format | Example | Use Case |
|---|---|---|
| Date-based | 20260121.3 or v20260121.3 |
Current format, revision incremented daily |
| SemVer | 1.2.3 or v1.2.3 |
Industry standard, for future migration |
The system automatically detects which format is used and applies the appropriate comparison logic.
When the local and remote versions use different formats, the system falls back to comparing the GitHub release publish date (published_at metadata) against the build date embedded in the local version.
This ensures seamless updates even if the versioning scheme changes in the future.
In UpdateChecker.lua, the following constants can be adjusted:
UpdateChecker.GITHUB_OWNER = "Piwigo" -- GitHub organization/user
UpdateChecker.GITHUB_REPO = "PiwigoPublish-lrc-plugin" -- Repository name
UpdateChecker.CHECK_INTERVAL_DAYS = 1 -- Days between automatic checksA new "Plugin Updates" section appears in File > Plug-in Manager > Piwigo Publisher:
- Current version display
- Update status indicator
- "Check for Updates" button
- "Visit GitHub Repository" button
When an update is available, users see:
- Current vs. new version comparison
- Changelog excerpt (first 500 characters)
- "Download" button → opens GitHub release page
- "Later" button → dismisses until next check
-
Update
VERSIONinInfo.lua:VERSION = { major=20260122, minor=1, revision=0 },
-
Commit and push changes
-
Create a GitHub Release:
- Tag:
v20260122.1(orv1.0.0for SemVer) - Title: Version number or descriptive title
- Description: Changelog in Markdown format
- Tag:
-
The plugin will automatically detect the new release
GET https://api.github.com/repos/{owner}/{repo}/releases/latest
| Field | Purpose |
|---|---|
tag_name |
Version identifier |
published_at |
Release date (ISO 8601) for cross-format comparison |
body |
Changelog content (Markdown) |
html_url |
Download page URL |
| Key | Purpose |
|---|---|
lastUpdateCheck |
Timestamp of last check |
latestVersion |
Cached latest version string |
latestVersionUrl |
Cached download URL |
pluginBuildDate |
Build date for SemVer installations |
| Function | Description |
|---|---|
parseVersion(versionStr) |
Converts version string to comparable number |
parseGitHubDate(dateStr) |
Parses ISO 8601 date to timestamp |
getInstalledVersionDate() |
Extracts build date from installed version |
shouldCheckForUpdates() |
Checks if interval has elapsed |
checkForUpdates(silent) |
Main update check logic |
openDownloadPage(url) |
Opens browser to download page |
getUpdateStatus() |
Returns status string for UI |
- Migration to SemVer: The system is ready for a versioning scheme change without breaking update detection
- Pre-release support: Could be extended to check for beta/RC releases via
prereleaseflag - Auto-download: Could be enhanced to download and extract updates automatically (requires additional permissions)
| File | Changes |
|---|---|
UpdateChecker.lua |
New file - update checking logic |
Init.lua |
Added require and startup check |
PluginInfoDialogSections.lua |
Added "Plugin Updates" UI section |
Info.lua |
VERSION table (existing, used as source of truth) |