mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update ImportService, filter deleted posts from getImportedPosts endpoint
This commit is contained in:
parent
d6d60a8574
commit
10dd348c28
2 changed files with 5 additions and 1 deletions
|
@ -59,6 +59,7 @@ class StatusObserver
|
|||
ProfileStatusService::delete($status->profile_id, $status->id);
|
||||
|
||||
if($status->uri == null) {
|
||||
ImportPost::whereProfileId($status->profile_id)->whereStatusId($status->id)->delete();
|
||||
ImportService::clearImportedFiles($status->profile_id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,9 +97,12 @@ class ImportService
|
|||
return Cache::remember($key, 21600, function() use($profileId) {
|
||||
return ImportPost::whereProfileId($profileId)
|
||||
->get()
|
||||
->filter(function($ip) {
|
||||
return StatusService::get($ip->status_id);
|
||||
})
|
||||
->map(function($ip) {
|
||||
return collect($ip->media)->map(function($m) { return $m['uri']; });
|
||||
})->flatten();
|
||||
})->values()->flatten();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue