Skip to content

Commit

Permalink
refactor: 방송 정보 업데이트 API 변경
Browse files Browse the repository at this point in the history
정적으로 생성해서 전달하는 이미지 URL의 Path를 변경하였습니다.
  • Loading branch information
JYKIM317 committed Nov 28, 2024
1 parent fbda556 commit 39ee9f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions applicationServer/src/live/live.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ export class LiveService {
async updateLiveData(tokenPayload, requestBody) {
const member = await this.memberService.findOneMemberWithCondition({ id: tokenPayload.memberId });
if (!this.live.data.has(member.broadcast_id)) throw new HttpException('Not Found', HttpStatus.NOT_FOUND);
const memberLiveData = this.live.data.get(member.broadcast_id);

if (requestBody.thumbnail) {
const imageData = Buffer.from(requestBody.thumbnail, 'base64');
uploadData(`${member.broadcast_id}/static_thumbnail.jpg`, imageData);
uploadData(`${memberLiveData.broadcastPath}/static_thumbnail.jpg`, imageData);
}

const memberLiveData = this.live.data.get(member.broadcast_id);
memberLiveData.title = requestBody.title;
memberLiveData.contentCategory = requestBody.contentCategory;
memberLiveData.moodCategory = requestBody.moodCategory;
memberLiveData.tags = requestBody.tags;
memberLiveData.thumbnailUrl = requestBody.thumbnail
? `https://kr.object.ncloudstorage.com/media-storage/${member.broadcast_id}/static_thumbnail.jpg`
: `https://kr.object.ncloudstorage.com/media-storage/${member.broadcast_id}/dynamic_thumbnail.jpg`;
? `https://kr.object.ncloudstorage.com/media-storage/${memberLiveData.broadcastPath}/static_thumbnail.jpg`
: `https://kr.object.ncloudstorage.com/media-storage/${memberLiveData.broadcastPath}/dynamic_thumbnail.jpg`;
}

notifyLiveDataInterval(broadcastId: string, req: Request) {
Expand Down

0 comments on commit 39ee9f1

Please sign in to comment.