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

This commit is contained in:
Daniel Supernault 2023-03-23 01:00:58 -06:00
parent 00aa5cf30f
commit 871f798cc9
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}