mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-02-01 12:08:30 +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);
|
ProfileStatusService::delete($status->profile_id, $status->id);
|
||||||
|
|
||||||
if($status->uri == null) {
|
if($status->uri == null) {
|
||||||
|
ImportPost::whereProfileId($status->profile_id)->whereStatusId($status->id)->delete();
|
||||||
ImportService::clearImportedFiles($status->profile_id);
|
ImportService::clearImportedFiles($status->profile_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,9 +97,12 @@ class ImportService
|
||||||
return Cache::remember($key, 21600, function() use($profileId) {
|
return Cache::remember($key, 21600, function() use($profileId) {
|
||||||
return ImportPost::whereProfileId($profileId)
|
return ImportPost::whereProfileId($profileId)
|
||||||
->get()
|
->get()
|
||||||
|
->filter(function($ip) {
|
||||||
|
return StatusService::get($ip->status_id);
|
||||||
|
})
|
||||||
->map(function($ip) {
|
->map(function($ip) {
|
||||||
return collect($ip->media)->map(function($m) { return $m['uri']; });
|
return collect($ip->media)->map(function($m) { return $m['uri']; });
|
||||||
})->flatten();
|
})->values()->flatten();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue