When a record in the photos table no longer exists, the corresponding record in the photos_albums table is not flagged as missing, because the corresponding query only checks if photos.deleted_at is not NULL.
To fix the album entry counts displayed in the UI, the query must additionally check if the photos_albums.photo_uid exists in the photos table or if it is unknown e.g. after a photo has been permanently deleted with the photoprism purge command or manually with SQL.
When a record in the
photostable no longer exists, the corresponding record in thephotos_albumstable is not flagged as missing, because the corresponding query only checks ifphotos.deleted_atis notNULL.To fix the album entry counts displayed in the UI, the query must additionally check if the
photos_albums.photo_uidexists in thephotostable or if it is unknown e.g. after a photo has been permanently deleted with thephotoprism purgecommand or manually with SQL.