From 8d53eda57625312c0d28cefe687db527404f2cbd Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 9 Nov 2021 16:23:24 +0100 Subject: [PATCH] (cp 8ef50d8) 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, + ), + ); } /**