Publish Service: Move URL and API Key to Lightroom Publishing Manager
Closed this issue · 4 comments
In the current version, the URL and API key are entered in the Plugin Manager. Therefore you can only publish to one instance of Immich and one user.
It would be good to have these settings in the Lightroom Publishing Manager instead. Therefore you could create multiple Publish Services for Immich (right clicking on the Immich Publisher in Lightroom and choose "Create another Publish Service via Immich Publisher".
I am not that good in Lua, but I guess this section has to be moved from ExportDialogSections.lua
to ExportServiceProvider.lua
:
function ExportDialogSections.sectionsForBottomOfDialog(_, propertyTable)
local f = LrView.osFactory()
local bind = LrView.bind
local share = LrView.share
local result = {
{
title = "Immich Server URL",
f:row {
f:static_text {
title = "URL:",
alignment = 'right',
width = share 'labelWidth'
},
f:edit_field {
value = prefs.url,
truncation = 'middle',
immediate = false,
width_in_chars = 40,
-- fill_horizontal = 1,
-- validate = function (v, url)
-- sanitizedURL = propertyTable.immich:sanityCheckAndFixURL()
-- if sanitizedURL == url then
-- return true, url, ''
-- elseif not (sanitizedURL == nil) then
-- LrDialogs.message('Entered URL was autocorrected to ' .. sanitizedURL)
-- return true, sanitizedURL, ''
-- end
-- return false, url, 'Entered URL not valid.\nShould look like https://demo.immich:app'
-- end,
enabled = false, -- Configuration moved to PluginInfo
},
},
f:row {
f:static_text {
title = "API Key:",
alignment = 'right',
width = share 'labelWidth',
},
f:password_field {
value = prefs.apiKey,
truncation = 'middle',
immediate = true,
width_in_chars = 40,
-- fill_horizontal = 1,
enabled = false, -- Configuration moved to PluginInfo
},
},
},
}
I was aware of that, but I thought that probably nobody has more than one Immich instance.
Do you have multiple instances? Can you elaborate your use case?
I have multiple use cases ;-)
Currently I am using 2 immich instances, one for "production" (which is used by my wife and me) and one for testing (my playground). I want to publish to both instances.
Another use case is multiple users: in Lightroom I have collections which are the whole family, I have collections which are only for me or my wife. I want to be able to publish them to different users (means different API keys).
Third use case (this I had in the past and plan to setup again): Having a local instance of immich with all photos, and a remote instance (which is accessible from the internet) which contains only a subset of pictures.
Ok, will do this, but in slightly different way.
Configuration will sta in Module Manager with the possibility to configure more than one connection, so that connections are available both in publish and export.
Cool - thanks!