mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update RemoteFollowImportRecent, use MediaPathService
This commit is contained in:
parent
3628b4625c
commit
5162c0704a
1 changed files with 2 additions and 4 deletions
|
@ -17,6 +17,7 @@ use Log;
|
||||||
use Storage;
|
use Storage;
|
||||||
use Zttp\Zttp;
|
use Zttp\Zttp;
|
||||||
use App\Util\ActivityPub\Helpers;
|
use App\Util\ActivityPub\Helpers;
|
||||||
|
use App\Services\MediaPathService;
|
||||||
|
|
||||||
class RemoteFollowImportRecent implements ShouldQueue
|
class RemoteFollowImportRecent implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
@ -45,7 +46,6 @@ class RemoteFollowImportRecent implements ShouldQueue
|
||||||
'image/jpg',
|
'image/jpg',
|
||||||
'image/jpeg',
|
'image/jpeg',
|
||||||
'image/png',
|
'image/png',
|
||||||
'image/gif',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,9 +208,7 @@ class RemoteFollowImportRecent implements ShouldQueue
|
||||||
public function importMedia($url, $mime, $status)
|
public function importMedia($url, $mime, $status)
|
||||||
{
|
{
|
||||||
$user = $this->profile;
|
$user = $this->profile;
|
||||||
$monthHash = hash('sha1', date('Y').date('m'));
|
$storagePath = MediaPathService::get($user, 2);
|
||||||
$userHash = hash('sha1', $user->id.(string) $user->created_at);
|
|
||||||
$storagePath = "public/m/{$monthHash}/{$userHash}";
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$info = pathinfo($url);
|
$info = pathinfo($url);
|
||||||
|
|
Loading…
Reference in a new issue