Merge pull request #1768 from pixelfed/staging

Update ApiControllers, fix missing share/like counts
This commit is contained in:
daniel 2019-10-06 21:42:33 -06:00 committed by GitHub
commit 3bc31e26a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -312,6 +312,8 @@ class ApiV1Controller extends Controller
'scope', 'scope',
'local', 'local',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->whereProfileId($profile->id) )->whereProfileId($profile->id)
@ -335,6 +337,8 @@ class ApiV1Controller extends Controller
'scope', 'scope',
'local', 'local',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->whereProfileId($profile->id) )->whereProfileId($profile->id)
@ -1224,6 +1228,8 @@ class ApiV1Controller extends Controller
'scope', 'scope',
'local', 'local',
'reply_count', 'reply_count',
'likes_count',
'reblogs_count',
'comments_disabled', 'comments_disabled',
'place_id', 'place_id',
'created_at', 'created_at',
@ -1251,6 +1257,8 @@ class ApiV1Controller extends Controller
'local', 'local',
'reply_count', 'reply_count',
'comments_disabled', 'comments_disabled',
'likes_count',
'reblogs_count',
'place_id', 'place_id',
'created_at', 'created_at',
'updated_at' 'updated_at'
@ -1319,6 +1327,8 @@ class ApiV1Controller extends Controller
'reply_count', 'reply_count',
'comments_disabled', 'comments_disabled',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->whereNull('uri') )->whereNull('uri')
@ -1345,6 +1355,8 @@ class ApiV1Controller extends Controller
'reply_count', 'reply_count',
'comments_disabled', 'comments_disabled',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->whereNull('uri') )->whereNull('uri')

View file

@ -275,6 +275,8 @@ class PublicApiController extends Controller
'reply_count', 'reply_count',
'comments_disabled', 'comments_disabled',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->where('id', $dir, $id) )->where('id', $dir, $id)
@ -304,6 +306,8 @@ class PublicApiController extends Controller
'comments_disabled', 'comments_disabled',
'created_at', 'created_at',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'updated_at' 'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album']) )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
->with('profile', 'hashtags', 'mentions') ->with('profile', 'hashtags', 'mentions')
@ -384,6 +388,8 @@ class PublicApiController extends Controller
'reply_count', 'reply_count',
'comments_disabled', 'comments_disabled',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album']) )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
@ -411,6 +417,8 @@ class PublicApiController extends Controller
'reply_count', 'reply_count',
'comments_disabled', 'comments_disabled',
'place_id', 'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at' 'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album']) )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album'])
@ -626,7 +634,6 @@ class PublicApiController extends Controller
} }
} }
$dir = $min_id ? '>' : '<'; $dir = $min_id ? '>' : '<';
$id = $min_id ?? $max_id; $id = $min_id ?? $max_id;
$timeline = Status::select( $timeline = Status::select(