aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/ajax_upload_complete.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/actions/ajax_upload_complete.php b/actions/ajax_upload_complete.php
new file mode 100644
index 000000000..4fc96061e
--- /dev/null
+++ b/actions/ajax_upload_complete.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * A batch is complete so check if this is first upload to album
+ *
+ */
+
+$album_guid = (int) get_input('album_guid');
+
+$album = get_entity($album_guid);
+if (!$album) {
+ exit;
+}
+
+if ($album->new_album == TP_NEW_ALBUM) {
+ $album->new_album = TP_OLD_ALBUM;
+
+ // we throw the notification manually here so users are not told about the new album until there
+ // is at least a few photos in it
+ object_notifications('create', 'object', $album);
+
+ add_to_river('river/object/album/create', 'create', $album->owner_guid, $album->guid);
+}
+
+exit; \ No newline at end of file