rw22mhhs wroteAbout the filename spacing, does the repeated thumbnail regeneration also happen when using Piwigo's core functions, for example the batch manager? As said, I had similar issues with spaces in filenames and even tried to loosen the sync_chars_regex a while ago, but that led to other issues, so I reverted it again. And regarding the files reported as missing during the metadata scan - does this also appear if you run step 1 (scan for new files) first? It would be great to know if this is limited to AlbumPilot or a general thing in Piwigo.
With regards to filenames with spaces: upon further testing, if I use Piwigo core to generate the resizes, it works, and then AlbumPilot stops trying to regenerate. So it does seem to be something with AlbumPilot.
For the metadata scan: in my test gallery, yes, even though I am running Step 1, the same few images keep appearing in (now) Step 2 (formerly Step 5). Although running Step 1 shouldn't matter since these aren't new files, they've always been in the gallery from before I started testing AlbumPilot:
2. Import metadata from image files into database (slow!)
Searching for images to update metadata...
Total images to process: 155
File missing for ID 434 (./galleries/exp_PG_test/test2.jpg) – file not found
File missing for ID 1397 (./galleries/places/conn/IMG_8501-20250616172150.JPG) – file not found
File missing for ID 361 (./galleries/places/testing2/v221_empty2-test/batch-test-02-20170612225629-20240424200424.png) – file not found
File missing for ID 1316 (./upload/2024/02/26/20240226181040-1e65cd65.heic) – file not found
Step completed: 2. Import metadata from image files into database (slow!) for 155 images.
If I use batch manager (or the individual admin pages) to sync the metadata for those image, it seems to work just fine. The images definitely exist, but like you said this is clearly some sort of weird edge case and maybe not worth pursuing (unless we can get other people to test and see if they encounter a similar problem so there's more detail to work from).
I should probably be logging issues in Github for you for this kind of stuff instead of long forum posts (and maybe once you "officially" release I can do that ;-)), but two other things:
- label consistency suggestion: for Step 3, should the "Overwrite existing poster (if available)" instead be "Overwrite existing poster (if present)" to be consistent with the wording on Step 4?
- speaking of "Overwrite existing thumbnails (if present)" on Step 4: is it expected that turning on this checkbox should effectively regenerate ALL resizes (for the selected albums)? Because on my test site, with that checkbox on, AlbumPilot doesn't regenerate any thumbnails (now that I have everything actually generated). Should it be instead re-creating all thumbnails for my 155 images?
I always wanted to stay close to Piwigo's built-in logic. So I am generally avoiding deep workarounds for things that should be handled at the system level.
Totally understand and agree!
Let me know if you think the plugin is in good shape now to be added to the official Piwigo store. I would probably do a little cleanup first. Right now the codebase is still a bit messy, but functional.
I think you're probably good for an initial "official" release. One quick code cleanup thing I noticed. In include/images.php, there are two calls to abortOnRootNoSubs in quick succession (starting on line 56). Is that a copy/paste typo? Seems like only one call should be necessary?
// If root album selected but "search in subalbums" is OFF, abort without scanning
abortOnRootNoSubs($albumId, $includeSubalbums, $log);
include_once(PHPWG_ROOT_PATH . 'include/derivative.inc.php');
include_once(PHPWG_ROOT_PATH . 'include/derivative_params.inc.php');
// If root album selected but "search in subalbums" is OFF, abort without scanning
abortOnRootNoSubs($albumId, $includeSubalbums, $log);