Channel features: subscribers, new-videos badges, activity-driven sync
- Store subscriber count from YouTube statistics and show it on channel page - Sync 50 videos per channel with playlistItems pagination support - Show per-channel and per-category new-videos counters (2-day window) - Replace hourly videos sync with activity trigger (2h idle) and incremental backfill (hard cap 200 per channel) - Clicking the sidebar new-videos count filters the category feed to recent videos only (new_only) - Update agent-team docs: deploy after green checks
This commit is contained in:
parent
fde9a439df
commit
e10df8dcbd
27 changed files with 1420 additions and 107 deletions
|
|
@ -58,9 +58,11 @@ export interface ChannelDto {
|
|||
description: string | null
|
||||
thumbnail_url: string | null
|
||||
uploads_playlist_id: string | null
|
||||
subscriber_count: number | null
|
||||
subscribed: boolean
|
||||
last_synced_at: string | null
|
||||
category_ids: number[]
|
||||
new_videos_count: number
|
||||
}
|
||||
|
||||
export function getChannel(channelId: number) {
|
||||
|
|
@ -96,6 +98,7 @@ export interface CategoryDto {
|
|||
slug: string
|
||||
sort_order: number
|
||||
channel_count: number
|
||||
new_videos_count: number
|
||||
}
|
||||
|
||||
export function listCategories() {
|
||||
|
|
@ -211,6 +214,8 @@ export function getFeed(
|
|||
downloaded?: boolean
|
||||
search?: string
|
||||
cursor?: string
|
||||
limit?: number
|
||||
newOnly?: boolean
|
||||
} = {},
|
||||
) {
|
||||
const qs = new URLSearchParams()
|
||||
|
|
@ -219,7 +224,9 @@ export function getFeed(
|
|||
if (params.channelId != null) qs.set('channel_id', String(params.channelId))
|
||||
if (params.downloaded) qs.set('downloaded', 'true')
|
||||
if (params.search) qs.set('search', params.search)
|
||||
if (params.newOnly) qs.set('new_only', 'true')
|
||||
if (params.cursor) qs.set('cursor', params.cursor)
|
||||
if (params.limit != null) qs.set('limit', String(params.limit))
|
||||
const suffix = qs.toString() ? `?${qs.toString()}` : ''
|
||||
return request<{ items: FeedVideoDto[]; next_cursor: string | null }>(`/api/feed${suffix}`)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue