Skip to content

Commit

Permalink
Merge pull request #182 from teamViNO/feature/video
Browse files Browse the repository at this point in the history
[fix] 영상 데이터 빈값 수정
  • Loading branch information
jainefer authored Feb 17, 2024
2 parents 127de82 + 491146b commit 6e96a3b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
11 changes: 9 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"express-session": "^1.17.3",
"ffmpeg": "^0.0.4",
"fluent-ffmpeg": "^2.1.2",
"get-youtube-title": "^1.0.1",
"get-youtube-title-await": "^1.1.5",
"http-status-codes": "^2.3.0",
"install": "^0.13.0",
"jsonwebtoken": "^9.0.2",
Expand All @@ -50,6 +50,7 @@
"@babel/preset-env": "^7.23.7",
"babel-cli": "^6.26.0",
"babel-loader": "^9.1.3",
"get-youtube-title": "^1.0.1",
"nodemon": "^3.0.2",
"swagger": "^0.7.5",
"webpack": "^5.89.0",
Expand Down
15 changes: 9 additions & 6 deletions src/controllers/summary.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { readFileFromObjectStorage } from '../services/storage.service.js';
import { checkFileExistsInStorage } from '../services/storage.service.js';
import { getScriptFileName } from '../services/storage.service.js';
import { chatGPTCall } from '../services/chatGPT.service.js';

import getYoutubeTitle from 'get-youtube-title';

export const processVideo = async (req, res) => {
Expand All @@ -26,12 +27,14 @@ export const processVideo = async (req, res) => {

const id =videoId;
console.log("id",id);
let videoTitle="";

getYoutubeTitle(videoId,async function(err,title){
videoTitle=title;
})


let videoTitle=""
const titleData=await getYoutubeTitle(id, async function (err, title) {
console.log("타이틀",title);
return title; // 'SLCHLD - EMOTIONS (feat. RIPELY) (prod. by GILLA)'
})

console.log("비디오 테그",titleData);
// const clientId = token;

// Object Storage에서 해당 MP3 파일이 존재하는지 확인
Expand Down
4 changes: 2 additions & 2 deletions src/services/video.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const viewSimpleVideo=async(data)=>{

} catch (error) {
console.error(error);
throw new BaseError(status.VIDEO_NOT_FOUND);
return {"videos":[]}
}

}
Expand Down Expand Up @@ -121,7 +121,7 @@ export const viewCategoryVideo=async(data)=>{
return getCategoryVideoResponseDTO(getVideoData,tagData);
} catch (error) {
console.error(error);
throw new BaseError(status.CATEGORY_IS_EMPTY);
return {"videos":[]}
}
}
async function findCategory(categoryData, category, user) {
Expand Down

0 comments on commit 6e96a3b

Please sign in to comment.