mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update RemoteFollow job
This commit is contained in:
parent
f0455b0454
commit
5b55165acd
1 changed files with 4 additions and 2 deletions
|
@ -56,7 +56,7 @@ class RemoteFollowImportRecent implements ShouldQueue
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$outbox = $this->fetchOutbox();
|
// $outbox = $this->fetchOutbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function fetchOutbox($url = false)
|
public function fetchOutbox($url = false)
|
||||||
|
@ -216,7 +216,7 @@ class RemoteFollowImportRecent implements ShouldQueue
|
||||||
$info = pathinfo($url);
|
$info = pathinfo($url);
|
||||||
$url = str_replace(' ', '%20', $url);
|
$url = str_replace(' ', '%20', $url);
|
||||||
$img = file_get_contents($url);
|
$img = file_get_contents($url);
|
||||||
$file = '/tmp/'.str_random(12).$info['basename'];
|
$file = '/tmp/'.str_random(64);
|
||||||
file_put_contents($file, $img);
|
file_put_contents($file, $img);
|
||||||
$path = Storage::putFile($storagePath, new File($file), 'public');
|
$path = Storage::putFile($storagePath, new File($file), 'public');
|
||||||
|
|
||||||
|
@ -230,6 +230,8 @@ class RemoteFollowImportRecent implements ShouldQueue
|
||||||
$media->save();
|
$media->save();
|
||||||
|
|
||||||
ImageThumbnail::dispatch($media);
|
ImageThumbnail::dispatch($media);
|
||||||
|
|
||||||
|
@unlink($file);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
Loading…
Reference in a new issue