mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Deprecate mixed media albums
This commit is contained in:
parent
aa1f74efbc
commit
1b20ebd46d
3 changed files with 11 additions and 8 deletions
|
@ -290,6 +290,12 @@ class InternalApiController extends Controller
|
||||||
array_push($mimes, $m->mime);
|
array_push($mimes, $m->mime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mediaType = StatusController::mimeTypeCheck($mimes);
|
||||||
|
|
||||||
|
if(in_array($mediaType, ['photo', 'video', 'photo:album']) == false) {
|
||||||
|
abort(400, __('exception.compose.invalid.album'));
|
||||||
|
}
|
||||||
|
|
||||||
if($place && is_array($place)) {
|
if($place && is_array($place)) {
|
||||||
$status->place_id = $place['id'];
|
$status->place_id = $place['id'];
|
||||||
}
|
}
|
||||||
|
@ -317,7 +323,7 @@ class InternalApiController extends Controller
|
||||||
$status->is_nsfw = $cw;
|
$status->is_nsfw = $cw;
|
||||||
$status->visibility = $visibility;
|
$status->visibility = $visibility;
|
||||||
$status->scope = $visibility;
|
$status->scope = $visibility;
|
||||||
$status->type = StatusController::mimeTypeCheck($mimes);
|
$status->type = $mediaType;
|
||||||
$status->save();
|
$status->save();
|
||||||
|
|
||||||
NewStatusPipeline::dispatch($status);
|
NewStatusPipeline::dispatch($status);
|
||||||
|
|
|
@ -453,12 +453,8 @@ export default {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
window.location.href = data;
|
window.location.href = data;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
let res = err.response.data;
|
let msg = err.response.data.message ? err.response.data.message : 'An unexpected error occured.'
|
||||||
if(res.message == 'Too Many Attempts.') {
|
swal('Oops, something went wrong!', msg, 'error');
|
||||||
swal('You\'re posting too much!', 'We only allow 50 posts per hour or 100 per day. If you\'ve reached that limit, please try again later. If you think this is an error, please contact an administrator.', 'error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error');
|
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -744,7 +744,8 @@ export default {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
window.location.href = data;
|
window.location.href = data;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error');
|
let msg = err.response.data.message ? err.response.data.message : 'An unexpected error occured.'
|
||||||
|
swal('Oops, something went wrong!', msg, 'error');
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue