|
|
@@ -13,99 +13,92 @@ export type VideoHomeSectionKey = 'featured' | 'latest' | 'editorPick';
|
|
|
|
|
|
export const CacheKeys = {
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // CHANNELS (existing)
|
|
|
+ // CHANNELS
|
|
|
// ─────────────────────────────────────────────
|
|
|
- appChannelAll: 'app:channel:all',
|
|
|
+ appChannelAll: 'box:app:channel:all',
|
|
|
appChannelById: (channelId: string | number): string =>
|
|
|
- `app:channel:by-id:${channelId}`,
|
|
|
+ `box:app:channel:by-id:${channelId}`,
|
|
|
|
|
|
- // NEW: Channel → Categories tree (future use)
|
|
|
appChannelWithCategories: (channelId: string | number): string =>
|
|
|
- `app:channel:with-categories:${channelId}`,
|
|
|
+ `box:app:channel:with-categories:${channelId}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // CATEGORIES (existing)
|
|
|
+ // CATEGORIES
|
|
|
// ─────────────────────────────────────────────
|
|
|
appCategory: (categoryId: string | number): string =>
|
|
|
- `app:category:${categoryId}`,
|
|
|
- appCategoryAll: 'app:category:all',
|
|
|
+ `box:app:category:${categoryId}`,
|
|
|
+ appCategoryAll: 'box:app:category:all',
|
|
|
appCategoryById: (categoryId: string | number): string =>
|
|
|
- `app:category:by-id:${categoryId}`,
|
|
|
+ `box:app:category:by-id:${categoryId}`,
|
|
|
|
|
|
- // NEW: Category → Tags tree (main for video listing)
|
|
|
appCategoryWithTags: (categoryId: string | number): string =>
|
|
|
- `app:category:with-tags:${categoryId}`,
|
|
|
+ `box:app:category:with-tags:${categoryId}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // TAGS (new)
|
|
|
+ // TAGS
|
|
|
// ─────────────────────────────────────────────
|
|
|
- appTagAll: 'app:tag:all',
|
|
|
+ appTagAll: 'box:app:tag:all',
|
|
|
|
|
|
appTagByCategoryKey: (categoryId: string | number): string =>
|
|
|
- `app:tag:list:${categoryId}`,
|
|
|
+ `box:app:tag:list:${categoryId}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // ADS (existing)
|
|
|
+ // ADS
|
|
|
// ─────────────────────────────────────────────
|
|
|
- appAdById: (adId: string | number): string => `app:ad:by-id:${adId}`,
|
|
|
+ appAdById: (adId: string | number): string => `box:app:ad:by-id:${adId}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
// AD POOLS (AdType-based)
|
|
|
// ─────────────────────────────────────────────
|
|
|
- /** Build the canonical ad pool key for a given AdType. */
|
|
|
appAdPoolByType: (adType: AdType | string): string =>
|
|
|
`box:app:adpool:${adType}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // VIDEO LISTS (existing)
|
|
|
+ // VIDEO LISTS
|
|
|
// ─────────────────────────────────────────────
|
|
|
- appHomeVideoPage: (page: number): string => `app:videolist:home:page:${page}`,
|
|
|
+ appHomeVideoPage: (page: number): string =>
|
|
|
+ `box:app:videolist:home:page:${page}`,
|
|
|
|
|
|
appChannelVideoPage: (channelId: string | number, page: number): string =>
|
|
|
- `app:videolist:channel:${channelId}:page:${page}`,
|
|
|
-
|
|
|
- // appTrendingVideoPage: (countryCode: string, page: number): string =>
|
|
|
- // `app:videolist:trending:${countryCode}:page:${page}`,
|
|
|
+ `box:app:videolist:channel:${channelId}:page:${page}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
// VIDEO DETAILS & METADATA
|
|
|
// ─────────────────────────────────────────────
|
|
|
- appVideoDetailKey: (videoId: string): string => `app:video:detail:${videoId}`,
|
|
|
+ appVideoDetailKey: (videoId: string): string =>
|
|
|
+ `box:app:video:detail:${videoId}`,
|
|
|
|
|
|
appVideoPayloadKey: (videoId: string): string =>
|
|
|
- `app:video:payload:${videoId}`,
|
|
|
+ `box:app:video:payload:${videoId}`,
|
|
|
|
|
|
appVideoCategoryListKey: (categoryId: string): string =>
|
|
|
- `app:video:category:list:${categoryId}`,
|
|
|
+ `box:app:video:category:list:${categoryId}`,
|
|
|
|
|
|
appVideoTagListKey: (categoryId: string, tagId: string): string =>
|
|
|
- `app:video:tag:list:${categoryId}:${tagId}`,
|
|
|
+ `box:app:video:tag:list:${categoryId}:${tagId}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // VIDEO POOLS (sorted listings with scores)
|
|
|
+ // VIDEO POOLS
|
|
|
// ─────────────────────────────────────────────
|
|
|
-
|
|
|
appVideoCategoryPoolKey: (
|
|
|
channelId: string,
|
|
|
categoryId: string,
|
|
|
sort: VideoSortKey,
|
|
|
- ): string => `app:video:list:category:${channelId}:${categoryId}:${sort}`,
|
|
|
+ ): string => `box:app:video:list:category:${channelId}:${categoryId}:${sort}`,
|
|
|
|
|
|
appVideoTagPoolKey: (
|
|
|
channelId: string,
|
|
|
tagId: string,
|
|
|
sort: VideoSortKey,
|
|
|
- ): string => `app:video:list:tag:${channelId}:${tagId}:${sort}`,
|
|
|
+ ): string => `box:app:video:list:tag:${channelId}:${tagId}:${sort}`,
|
|
|
|
|
|
appVideoHomeSectionKey: (
|
|
|
channelId: string,
|
|
|
section: VideoHomeSectionKey,
|
|
|
- ): string => `app:video:list:home:${channelId}:${section}`,
|
|
|
+ ): string => `box:app:video:list:home:${channelId}:${section}`,
|
|
|
|
|
|
// ─────────────────────────────────────────────
|
|
|
- // RECOMMENDED VIDEOS (Homepage)
|
|
|
+ // RECOMMENDED VIDEOS
|
|
|
// ─────────────────────────────────────────────
|
|
|
-
|
|
|
- /** Recommended videos for homepage (7 random completed videos) */
|
|
|
- appRecommendedVideos: 'app:video:recommended',
|
|
|
+ appRecommendedVideos: 'box:app:video:recommended',
|
|
|
};
|