mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-02-23 22:50:46 +00:00
Update status model, use scope over deprecated visibility attribute
This commit is contained in:
parent
7225c1f3af
commit
f70826e18c
5 changed files with 8 additions and 8 deletions
|
@ -1446,7 +1446,7 @@ class ApiV1Controller extends Controller
|
||||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
|
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
|
||||||
->with('profile', 'hashtags', 'mentions')
|
->with('profile', 'hashtags', 'mentions')
|
||||||
->where('id', $dir, $id)
|
->where('id', $dir, $id)
|
||||||
->whereVisibility('public')
|
->whereScope('public')
|
||||||
->latest()
|
->latest()
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get();
|
->get();
|
||||||
|
@ -1473,7 +1473,7 @@ class ApiV1Controller extends Controller
|
||||||
)->whereNull('uri')
|
)->whereNull('uri')
|
||||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
|
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
|
||||||
->with('profile', 'hashtags', 'mentions')
|
->with('profile', 'hashtags', 'mentions')
|
||||||
->whereVisibility('public')
|
->whereScope('public')
|
||||||
->latest()
|
->latest()
|
||||||
->simplePaginate($limit);
|
->simplePaginate($limit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,14 +181,14 @@ class DiscoverController extends Controller
|
||||||
$ttl = now()->addHours(2);
|
$ttl = now()->addHours(2);
|
||||||
$res = Cache::remember($key, $ttl, function() use($range) {
|
$res = Cache::remember($key, $ttl, function() use($range) {
|
||||||
if($range == '-1') {
|
if($range == '-1') {
|
||||||
$res = Status::whereVisibility('public')
|
$res = Status::whereScope('public')
|
||||||
->whereType('photo')
|
->whereType('photo')
|
||||||
->whereIsNsfw(false)
|
->whereIsNsfw(false)
|
||||||
->orderBy('likes_count','desc')
|
->orderBy('likes_count','desc')
|
||||||
->take(12)
|
->take(12)
|
||||||
->get();
|
->get();
|
||||||
} else {
|
} else {
|
||||||
$res = Status::whereVisibility('public')
|
$res = Status::whereScope('public')
|
||||||
->whereType('photo')
|
->whereType('photo')
|
||||||
->whereIsNsfw(false)
|
->whereIsNsfw(false)
|
||||||
->orderBy('likes_count','desc')
|
->orderBy('likes_count','desc')
|
||||||
|
|
|
@ -304,7 +304,7 @@ class PublicApiController extends Controller
|
||||||
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
|
||||||
->whereNotIn('profile_id', $filtered)
|
->whereNotIn('profile_id', $filtered)
|
||||||
->whereLocal(true)
|
->whereLocal(true)
|
||||||
->whereVisibility('public')
|
->whereScope('public')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get();
|
->get();
|
||||||
|
@ -332,7 +332,7 @@ class PublicApiController extends Controller
|
||||||
->whereNotIn('profile_id', $filtered)
|
->whereNotIn('profile_id', $filtered)
|
||||||
->with('profile', 'hashtags', 'mentions')
|
->with('profile', 'hashtags', 'mentions')
|
||||||
->whereLocal(true)
|
->whereLocal(true)
|
||||||
->whereVisibility('public')
|
->whereScope('public')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->simplePaginate($limit);
|
->simplePaginate($limit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ProfileOutbox extends Fractal\TransformerAbstract
|
||||||
$statuses = $profile
|
$statuses = $profile
|
||||||
->statuses()
|
->statuses()
|
||||||
->with('media')
|
->with('media')
|
||||||
->whereVisibility('public')
|
->whereScope('public')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->paginate(10);
|
->paginate(10);
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Outbox {
|
||||||
|
|
||||||
$timeline = $profile
|
$timeline = $profile
|
||||||
->statuses()
|
->statuses()
|
||||||
->whereVisibility('public')
|
->whereScope('public')
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->take(10)
|
->take(10)
|
||||||
->get();
|
->get();
|
||||||
|
|
Loading…
Reference in a new issue