darktable
darktable copied to clipboard
export module: keep last piwigo album used - again
Describe the bug
I think this bug is back: #8687 Every time I export a photo to piwigo, the selected album switches back to the first one in the list.
Steps to reproduce
- Select Album
- export
- Album switches back to first one
Expected behavior
keep the last album
Logfile | Screenshot | Screencast
No response
Commit
No response
Where did you install darktable from?
OBS
darktable version
4.4.2-1.1+70.1
What OS are you using?
Linux
What is the version of your OS?
Debian Bookworm
Describe your system?
No response
Are you using OpenCL GPU in darktable?
Yes
If yes, what is the GPU card and driver?
AMD RX7800XT / ROCm
Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip
No response
This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.
Still an issue in 4.6.0
This issue has been marked as stale due to inactivity for the last 60 days. It will be automatically closed in 300 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.
Still an issue in 4.7.0~git646.57744753-1+11388.1
I tried to understand the issue - however my knowledge of darktable's API is limited (i.e., non-existent) thus, my conclusions might be errornous.
It looks like the plugin stores the last album in the configuration and also reads it from there. Maybe something gets messed up there. I checked that this is working: If I select an album, then close darktable and open it again, the old album is selected.
However, I also noticed in the code, that the plugin tries to remove parentheses as it needs the name without the number of photos: https://github.com/darktable-org/darktable/blob/577447536bc4a4dab6a4d2d30fc86f249779910c/src/imageio/storage/piwigo.c#L654-L668
However, my Album names already contain parentheses - which might be the problem here? As I understand the code, it checks if the current char is a space and the next is a ( and inserts a null at that location. My guess it that in that case the album name is not found any more, because it contains the incorrect name! I.e., my album is named Travel to Iceland (2011), the string the function gets will look like Travel to Iceland (2011) (42)\0 and will incorrectly be trimmed to Travel to Iceland\0.
I think the fix here would be to traverse the string from the back and remove the last parentheses pair at the end?
The only weird thing is, the album I export into does not have extra parenthesis. But maybe to have one album with parentheses is enough the trigger this issue?