From 8ef50d84e453af70c68f9313ff90a1c914d9f675 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 9 Nov 2021 16:19:32 +0100 Subject: [PATCH] fixes #1553 pwg.images.uploadCompleted details about updated album --- include/ws_functions/pwg.images.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/ws_functions/pwg.images.php b/include/ws_functions/pwg.images.php index ebdcf6795..788b31a61 100644 --- a/include/ws_functions/pwg.images.php +++ b/include/ws_functions/pwg.images.php @@ -2147,6 +2147,15 @@ function ws_images_uploadCompleted($params, $service) // $image_ids (canbe a subset or more image_ids from another upload too) $moved_from_lounge = empty_lounge(); + $query = ' +SELECT + COUNT(*) AS nb_photos + FROM '.IMAGE_CATEGORY_TABLE.' + WHERE category_id = '.$params['category_id'].' +;'; + $category_infos = pwg_db_fetch_assoc(pwg_query($query)); + $category_name = get_cat_display_name_from_id($params['category_id'], null); + trigger_notify( 'ws_images_uploadCompleted', array( @@ -2156,7 +2165,14 @@ function ws_images_uploadCompleted($params, $service) ) ); - return array('moved_from_lounge' => $moved_from_lounge); + return array( + 'moved_from_lounge' => $moved_from_lounge, + 'category' => array( + 'id' => $params['category_id'], + 'nb_photos' => $category_infos['nb_photos'], + 'label' => $category_name, + ), + ); } /**