diff --git a/frontend/src/api/feed.ts b/frontend/src/api/feed.ts index f275f17..4c1b4bc 100644 --- a/frontend/src/api/feed.ts +++ b/frontend/src/api/feed.ts @@ -1,5 +1,5 @@ import { postJson } from './client' -import type { ListByFollowingResponse, ListLatestResponse, ListLikesCountResponse } from './types' +import type { ListByFollowingResponse, ListByPopularityResponse, ListLatestResponse, ListLikesCountResponse } from './types' export function listLatest(input: { limit: number; latest_time: number }) { return postJson('/feed/listLatest', input) @@ -14,6 +14,10 @@ export function listLikesCount(input: { limit: number; likes_count_before?: numb return postJson('/feed/listLikesCount', body) } +export function listByPopularity(input: { limit: number; as_of: number; offset: number }) { + return postJson('/feed/listByPopularity', input) +} + export function listByFollowing(input: { limit: number; latest_time: number }) { return postJson('/feed/listByFollowing', input, { authRequired: true }) } diff --git a/frontend/src/api/types.ts b/frontend/src/api/types.ts index a5af5f6..99a4766 100644 --- a/frontend/src/api/types.ts +++ b/frontend/src/api/types.ts @@ -58,6 +58,16 @@ export type ListLikesCountResponse = { has_more: boolean } +export type ListByPopularityResponse = { + video_list: FeedVideoItem[] + as_of: number + next_offset: number + has_more: boolean + next_latest_popularity?: number + next_latest_before?: string + next_latest_id_before?: number +} + export type ListByFollowingResponse = { video_list: FeedVideoItem[] next_time: number diff --git a/frontend/src/components/AppShell.vue b/frontend/src/components/AppShell.vue index d3afc95..b7d1830 100644 --- a/frontend/src/components/AppShell.vue +++ b/frontend/src/components/AppShell.vue @@ -58,6 +58,7 @@ async function goSettings() {