|
@@ -4,7 +4,6 @@ import { BaseCacheBuilder } from '@box/common/cache/cache-builder';
|
|
|
import { RedisService } from '@box/db/redis/redis.service';
|
|
import { RedisService } from '@box/db/redis/redis.service';
|
|
|
import { MongoPrismaService } from '@box/db/prisma/mongo-prisma.service';
|
|
import { MongoPrismaService } from '@box/db/prisma/mongo-prisma.service';
|
|
|
import { CacheKeys } from '@box/common/cache/cache-keys';
|
|
import { CacheKeys } from '@box/common/cache/cache-keys';
|
|
|
-import { CacheKeys } from '@box/common/cache/cache-keys';
|
|
|
|
|
import { tsCacheKeys } from '@box/common/cache/ts-cache-key.provider';
|
|
import { tsCacheKeys } from '@box/common/cache/ts-cache-key.provider';
|
|
|
import {
|
|
import {
|
|
|
RawVideoPayloadRow,
|
|
RawVideoPayloadRow,
|
|
@@ -407,10 +406,7 @@ export class VideoCategoryCacheBuilder extends BaseCacheBuilder {
|
|
|
await this.buildCategoryVideoListForCategory(categoryId);
|
|
await this.buildCategoryVideoListForCategory(categoryId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async rebuildVideoTagCache(
|
|
|
|
|
- categoryId: string,
|
|
|
|
|
- tagId: string,
|
|
|
|
|
- ): Promise<void> {
|
|
|
|
|
|
|
+ async rebuildVideoTagCache(categoryId: string, tagId: string): Promise<void> {
|
|
|
await this.buildTagFilteredVideoListForTag(categoryId, tagId);
|
|
await this.buildTagFilteredVideoListForTag(categoryId, tagId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -488,7 +484,9 @@ export class VideoCategoryCacheBuilder extends BaseCacheBuilder {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private async fetchVideoById(videoId: string): Promise<RawVideoPayloadRow | null> {
|
|
|
|
|
|
|
+ private async fetchVideoById(
|
|
|
|
|
+ videoId: string,
|
|
|
|
|
+ ): Promise<RawVideoPayloadRow | null> {
|
|
|
return this.mongoPrisma.videoMedia.findUnique({
|
|
return this.mongoPrisma.videoMedia.findUnique({
|
|
|
where: { id: videoId },
|
|
where: { id: videoId },
|
|
|
select: {
|
|
select: {
|
|
@@ -511,7 +509,9 @@ export class VideoCategoryCacheBuilder extends BaseCacheBuilder {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private async writeVideoPayloads(videos: RawVideoPayloadRow[]): Promise<void> {
|
|
|
|
|
|
|
+ private async writeVideoPayloads(
|
|
|
|
|
+ videos: RawVideoPayloadRow[],
|
|
|
|
|
+ ): Promise<void> {
|
|
|
if (!videos.length) return;
|
|
if (!videos.length) return;
|
|
|
|
|
|
|
|
const entries = videos.map((video) => ({
|
|
const entries = videos.map((video) => ({
|