Merge pull request #1373 from pixelfed/frontend-ui-refactor

Frontend ui refactor
pull/1392/head
daniel 6 years ago committed by GitHub
commit 7eb7c764d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,7 +42,7 @@ class VideoThumbnail implements ShouldQueue
$name = last($path); $name = last($path);
try { try {
$t = explode('.', $name); $t = explode('.', $name);
$t = $t[0].'_thumb.png'; $t = $t[0].'_thumb.jpeg';
$i = count($path) - 1; $i = count($path) - 1;
$path[$i] = $t; $path[$i] = $t;
$save = implode('/', $path); $save = implode('/', $path);

@ -30,7 +30,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
'moved' => null, 'moved' => null,
'fields' => null, 'fields' => null,
'bot' => null, 'bot' => null,
'website' => null, 'website' => $profile->website,
'software' => 'pixelfed', 'software' => 'pixelfed',
'is_admin' => (bool) $is_admin 'is_admin' => (bool) $is_admin
]; ];

@ -319,7 +319,7 @@ class Helpers {
$status->scope = $scope; $status->scope = $scope;
$status->visibility = $scope; $status->visibility = $scope;
$status->save(); $status->save();
// self::importNoteAttachment($res, $status); self::importNoteAttachment($res, $status);
return $status; return $status;
}); });
@ -330,8 +330,6 @@ class Helpers {
public static function importNoteAttachment($data, Status $status) public static function importNoteAttachment($data, Status $status)
{ {
return;
if(self::verifyAttachments($data) == false) { if(self::verifyAttachments($data) == false) {
return; return;
} }
@ -348,28 +346,28 @@ class Helpers {
if(in_array($type, $allowed) == false || $valid == false) { if(in_array($type, $allowed) == false || $valid == false) {
continue; continue;
} }
// $info = pathinfo($url); $info = pathinfo($url);
// // pleroma attachment fix // pleroma attachment fix
// $url = str_replace(' ', '%20', $url); $url = str_replace(' ', '%20', $url);
// $img = file_get_contents($url, false, stream_context_create(['ssl' => ["verify_peer"=>true,"verify_peer_name"=>true]])); $img = file_get_contents($url, false, stream_context_create(['ssl' => ["verify_peer"=>true,"verify_peer_name"=>true]]));
// $file = '/tmp/'.str_random(32); $file = '/tmp/pxmi-'.str_random(32);
// file_put_contents($file, $img); file_put_contents($file, $img);
// $fdata = new File($file); $fdata = new File($file);
// $path = Storage::putFile($storagePath, $fdata, 'public'); $path = Storage::putFile($storagePath, $fdata, 'public');
// $media = new Media(); $media = new Media();
// $media->status_id = $status->id; $media->status_id = $status->id;
// $media->profile_id = $status->profile_id; $media->profile_id = $status->profile_id;
// $media->user_id = null; $media->user_id = null;
// $media->media_path = $path; $media->media_path = $path;
// $media->size = $fdata->getSize(); $media->size = $fdata->getSize();
// $media->mime = $fdata->getMimeType(); $media->mime = $fdata->getMimeType();
// $media->save(); $media->save();
// ImageThumbnail::dispatch($media); ImageThumbnail::dispatch($media);
// ImageOptimize::dispatch($media); ImageOptimize::dispatch($media);
// unlink($file); unlink($file);
} }
return; return;
} }

@ -728,8 +728,10 @@ export default {
type: 'status', type: 'status',
item: this.status.id item: this.status.id
}).then(res => { }).then(res => {
setTimeout(function() {
swal('Success', 'You have successfully deleted this post', 'success'); swal('Success', 'You have successfully deleted this post', 'success');
window.location.href = '/'; window.location.href = '/';
}, 2000);
}).catch(err => { }).catch(err => {
swal('Error', 'Something went wrong. Please try again later.', 'error'); swal('Error', 'Something went wrong. Please try again later.', 'error');
}); });

Loading…
Cancel
Save