Skip to content

Commit 46d17fc

Browse files
committed
WIP
1 parent 9ee114f commit 46d17fc

6 files changed

Lines changed: 22 additions & 12 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ You should have received a copy of the GNU General Public License along with thi
2222

2323
As a user of both Lightroom Classic and Piwigo, the ability use the powerful Publishing Service in LrC to keep my Piwigo galleries up to date is very appealing. I've been a long time user of a popular plugin that has been providing this functionality, but unfortunately since the version 15 release of LrC that has not been available.
2424

25-
This plugin is my attempt to allow me to continue publishing to Piwigo from LrC, and I have looked at the work of others for help and ideas in developing this plugin. In particular, the following should be credited:
25+
This plugin was developed to allow me to continue publishing to Piwigo from LrC, and I have looked at the work of others for help and ideas in developing this plugin. In particular, the following should be credited:
2626

2727
[All the contributers to Piwigo](https://piwigo.org/)
2828

29+
[Julien Moreau for contributing various improvements](https://julien-moreau.fr/)
30+
2931
[Jeffrey Friedl for JSON.lua](http://regex.info/blog/lua/json)
3032

3133
[Bastian Machek with his Immich Plugin](https://github.com/bmachek/lrc-immich-plugin)

piwigoPublish.lrplugin/Info.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ return {
2525
LrPluginName = "Piwigo Publisher",
2626
-- typo in PwigoPublish is noted but can't be changed without forcing all services using this plugin to be re-initialised.
2727
LrToolkitIdentifier = "fiona.boston.PwigoPublish",
28-
-- LrToolkitIdentifier = "fiona.boston.PiwigoPublish",
2928
LrMetadataProvider = 'CustomMetadata.lua',
3029
LrMetadataTagsetFactory = 'Tagset.lua',
3130
LrInitPlugin = "Init.lua",
@@ -67,5 +66,5 @@ return {
6766

6867
LrPluginInfoProvider = 'PluginInfo.lua',
6968

70-
VERSION = { major=20260122, minor=27, revision=0 },
69+
VERSION = { major=20260124, minor=28, revision=0 },
7170
}

piwigoPublish.lrplugin/Init.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ end
7575
_G.iconPath = _PLUGIN:resourceId("icons/icon_med.png")
7676

7777
-- Build version string from Info.lua VERSION table
78-
local versionInfo = _PLUGIN.VERSION or { major = 0, minor = 0, revision = 0 }
78+
--local versionInfo = _PLUGIN.VERSION or { major = 0, minor = 0, revision = 0 }
79+
-- _PLUGIN.VERSION is nil here for some reason, so hardcoding for now
80+
-- just need to ensure both places are updated together
81+
82+
_G.versionInfo = { major=20260122, minor=27, revision=0 }
83+
7984
_G.pluginVersion = string.format("%d.%d", versionInfo.major, versionInfo.minor)
8085
-- Auto-update checker
8186
_G.UpdateChecker = require "UpdateChecker"
@@ -91,5 +96,5 @@ LrTasks.startAsyncTask(function()
9196
UpdateChecker.checkForUpdates(true) -- silent = true
9297
end
9398
end)
94-
--_G.LocStrings = utils.loadStrings()
99+
95100

piwigoPublish.lrplugin/PluginInfoDialogSections.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ local function resetPluginPrefs(prefix)
3131
log:info("resetPluginPrefs \n" .. utils.serialiseVar(prefs))
3232
for k, p in prefs:pairs() do
3333
if prefix then
34-
log:info("resetting " .. utils.serialiseVar(k))
3534
if k:find(prefix, 1, true) == 1 then
3635
prefs[k] = nil
3736
end
3837
else
39-
log:info("resetting " .. utils.serialiseVar(k))
4038
prefs[k] = nil
4139
end
4240
end
@@ -63,6 +61,7 @@ function PluginInfoDialogSections.startDialog(propertyTable)
6361
else
6462
log:disable()
6563
end
64+
6665
propertyTable.debugEnabled = prefs.debugEnabled
6766
propertyTable.debugToFile = prefs.debugToFile
6867
end

piwigoPublish.lrplugin/PublishTask.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PublishTask = {}
2828
function PublishTask.processRenderedPhotos(functionContext, exportContext)
2929
-- render photos and upload to Piwigo
3030

31-
log:info("PublishTask.processRenderedPhotos")
31+
log:info("PublishTask.processRenderedPhotos - version: " .. utils.serialiseVar(_PLUGIN.VERSION))
3232
local callStatus = {}
3333
local catalog = LrApplication.activeCatalog()
3434
local exportSession = exportContext.exportSession

piwigoPublish.lrplugin/UpdateChecker.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ local LrDate = import 'LrDate'
3131
local UpdateChecker = {}
3232

3333
-- Configuration
34-
UpdateChecker.GITHUB_OWNER = "Gotcha26"
34+
UpdateChecker.GITHUB_OWNER = "Piwigo"
3535
UpdateChecker.GITHUB_REPO = "PiwigoPublish-lrc-plugin"
3636
UpdateChecker.CHECK_INTERVAL_DAYS = 1
3737

@@ -90,9 +90,12 @@ function UpdateChecker.getInstalledVersionDate()
9090
-- For date-based: extracts YYYYMMDD from "20260111.26"
9191
-- For semver: uses a stored build date or returns 0
9292

93-
local versionInfo = _PLUGIN.VERSION or { major = 0, minor = 0, revision = 0 }
93+
--local versionInfo = _PLUGIN.VERSION or { major = 0, minor = 0, revision = 0 }
94+
-- _PLUGIN.VERSION is nil here for some reason
95+
-- use _G.versionInfo set in Init.lua
96+
log:info("UpdateChecker.getInstalledVersionDate - versionInfo\n" .. utils.serialiseVar(versionInfo))
9497
local major = versionInfo.major or 0
95-
98+
log:info("UpdateChecker.getInstalledVersionDate - major: " .. tostring(major))
9699
if major >= 20000000 then
97100
-- Date-based: major IS the date
98101
return major
@@ -138,8 +141,10 @@ function UpdateChecker.checkForUpdates(silent)
138141

139142
-- Update last check timestamp
140143
prefs.lastUpdateCheck = LrDate.currentTime()
141-
144+
log:info("UpdateChecker.checkForUpdates - response\n" .. utils.serialiseVar(response))
145+
log:info("UpdateChecker.checkForUpdates - headers\n" .. utils.serialiseVar(headers))
142146
-- Handle errors
147+
143148
if not response or (headers and headers.status ~= 200) then
144149
log:info("UpdateChecker.checkForUpdates - failed to fetch release info")
145150
if not silent then

0 commit comments

Comments
 (0)