浏览代码

Update ap helpers, fix album order bug by setting media order

Daniel Supernault 2 年之前
父节点
当前提交
871f798cc9
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/Util/ActivityPub/Helpers.php

+ 2 - 1
app/Util/ActivityPub/Helpers.php

@@ -665,7 +665,7 @@ class Helpers {
 		$storagePath = MediaPathService::get($user, 2);
 		$allowed = explode(',', config_cache('pixelfed.media_types'));
 
-		foreach($attachments as $media) {
+		foreach($attachments as $key => $media) {
 			$type = $media['mediaType'];
 			$url = $media['url'];
 			$valid = self::validateUrl($url);
@@ -685,6 +685,7 @@ class Helpers {
 			$media->media_path = $url;
 			$media->remote_url = $url;
 			$media->caption = $caption;
+			$media->order = $key + 1;
 			if($license) {
 				$media->license = $license;
 			}