-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/crawling vaild #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
โฆASE_SERVICE_ROLE_KEY์ ์ฌ์ฉํ๊ณ ์๋ ๊ฒ์ ๋ฐ๊ฒฌ. SUPABASE_ANON_KEY์ผ๋ก ๊ต์ฒด
|
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
์ด PR์ ํฌ๋กค๋ง ๋ฐฉ์์ ๋ณ๊ฒฝํ๊ณ ์๋ก์ด ์ ํจ์ฑ ๊ฒ์ฆ ๊ธฐ๋ฅ์ ์ถ๊ฐํ๋ ์์ ์ ๋๋ค. ์ฃผ์ ๋ชฉ์ ์ KY๋ ธ๋๋ฐฉ ํํ์ด์ง์์ ๋ฒํธ์ ์ ํจ์ฑ์ ํ์ธํ๋ ๊ธฐ๋ฅ์ ์ถ๊ฐํ๊ณ , ์ฝ๋์ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ ํ๋ ๊ฒ์ ๋๋ค.
- KY๋ ธ๋๋ฐฉ ํํ์ด์ง์์ ๋ฒํธ ์ ํจ์ฑ ๊ฒ์ฆ ๊ธฐ๋ฅ ์ถ๊ฐ (crawlYoutubeVaild.ts)
- ๊ธฐ์กด ํฌ๋กค๋ง ๋ก์ง ๊ฐ์ ๋ฐ ๊ฒ์ฆ ์์ ๋์ ์คํ ํ๊ฒฝ ๊ตฌ์ถ
- ์ฝ๋ ํ์ง ๊ฐ์ ์ ์ํ ํจ์๋ช ์คํ ์์ ๋ฐ ๋ชจ๋ ๊ตฌ์กฐ ์ฌ์ ๋ฆฌ
Reviewed Changes
Copilot reviewed 32 out of 38 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/open-api/src/instance.ts | ํจ์๋ช ์คํ ์์ (isVaild โ isValid) |
| packages/open-api/src/getPopular.ts | ํจ์๋ช ์์ ๋ฐ ์ฝ๋ ์คํ์ผ ํต์ผ |
| packages/crawling/src/crawlYoutubeValid.ts | KY ๋ ธ๋๋ฐฉ ๋ฒํธ ์ ํจ์ฑ ๊ฒ์ฆ ๊ธฐ๋ฅ ์ ๊ท ์ถ๊ฐ |
| packages/crawling/src/crawlYoutube.ts | ๊ธฐ์กด ํฌ๋กค๋ง ๋ก์ง์ ์ ํจ์ฑ ๊ฒ์ฆ ์ถ๊ฐ |
| packages/crawling/src/utils/ | ์ ํธ๋ฆฌํฐ ํจ์๋ค์ ๋ณ๋ ๋ชจ๋๋ก ๋ถ๋ฆฌ ๋ฐ ์ฌ๊ตฌ์ฑ |
| ๊ธฐํ ํ์ผ๋ค | ์ฝ๋ ์คํ์ผ ํต์ผ, ์ํฌํธ ๊ฒฝ๋ก ์ ๋ฆฌ, ์ค์ ํ์ผ ์ถ๊ฐ |
| import type { Brand, Period, ResponseType, InstanceResponse } from "./types"; | ||
|
|
||
| export const isVaildBrand = (brand: string): brand is Brand => { | ||
| export const isValidBrand = (brand: string): brand is Brand => { |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํจ์๋ช ์คํ๊ฐ ์์ ๋์์ต๋๋ค. 'isVaild'์์ 'isValid'๋ก ์ฌ๋ฐ๋ฅด๊ฒ ๋ณ๊ฒฝ๋์์ต๋๋ค.
| if ( | ||
| (titleResult.includes(parsedTitle.slice(0, 2)) || | ||
| titleResult.includes(parsedTitle.slice(-2))) && | ||
| (artistResult.includes(parsedArtist.slice(0, 2)) || | ||
| artistResult.includes(parsedArtist.slice(-2))) | ||
| ) { |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] ์กฐ๊ฑด๋ฌธ์ด ๋ณต์กํฉ๋๋ค. ๊ฐ๋ ์ฑ์ ์ํด ๋ณ๋ ํจ์๋ก ๋ถ๋ฆฌํ๊ฑฐ๋ ๋ณ์์ ํ ๋นํ์ฌ ์๋ฏธ๋ฅผ ๋ช ํํ ํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
| if ( | |
| (titleResult.includes(parsedTitle.slice(0, 2)) || | |
| titleResult.includes(parsedTitle.slice(-2))) && | |
| (artistResult.includes(parsedArtist.slice(0, 2)) || | |
| artistResult.includes(parsedArtist.slice(-2))) | |
| ) { | |
| const isTitleAndArtistSimilar = | |
| (titleResult.includes(parsedTitle.slice(0, 2)) || | |
| titleResult.includes(parsedTitle.slice(-2))) && | |
| (artistResult.includes(parsedArtist.slice(0, 2)) || | |
| artistResult.includes(parsedArtist.slice(-2))); | |
| if (isTitleAndArtistSimilar) { |
| if ( | ||
| (titleResult.includes(parsedTitle.slice(0, 2)) || | ||
| titleResult.includes(parsedTitle.slice(-2))) && | ||
| (artistResult.includes(parsedArtist.slice(0, 2)) || | ||
| artistResult.includes(parsedArtist.slice(-2))) | ||
| ) { |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋์ผํ ๋ณต์กํ ์กฐ๊ฑด๋ฌธ์ด ๋ฐ๋ณต๋ฉ๋๋ค. crawlYoutubeValid.ts์ ๋์ผํ ๋ก์ง์ด๋ฏ๋ก ๊ณตํต ํจ์๋ก ์ถ์ถํ์ฌ ์ค๋ณต์ ์ ๊ฑฐํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
| if ( | |
| (titleResult.includes(parsedTitle.slice(0, 2)) || | |
| titleResult.includes(parsedTitle.slice(-2))) && | |
| (artistResult.includes(parsedArtist.slice(0, 2)) || | |
| artistResult.includes(parsedArtist.slice(-2))) | |
| ) { | |
| if (isTitleAndArtistMatch(parsedTitle, parsedArtist, titleResult, artistResult)) { |
| @@ -0,0 +1,11 @@ | |||
| export const parseNumber = (str: string) => { | |||
| if (!isNumber(str)) { | |||
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ธฐ์กด์ ์๋ ๊ธธ์ด ๊ฒ์ฆ ๋ก์ง(str.length < 5)์ด ์ ๊ฑฐ๋์์ต๋๋ค. ์ด ๋ณ๊ฒฝ์ด ์๋๋ ๊ฒ์ธ์ง ํ์ธํ๊ณ , ๋ง์ฝ ๊ธธ์ด ๊ฒ์ฆ์ด ํ์ํ๋ค๋ฉด ๋ค์ ์ถ๊ฐํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
| if (!isNumber(str)) { | |
| if (!isNumber(str) || str.length >= 5) { |
| .order("title", { ascending: true }) | ||
| .from('songs') | ||
| .select('id, title, artist, num_tj, num_ky') | ||
| .is('num_ky', null) // num_ky๊ฐ null์ธ ๋ฐ์ดํฐ๋ง ๊ฐ์ ธ์ด |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ ๋ ฌ ๊ธฐ์ค์ด 'title'์์ 'created_at'์ผ๋ก ๋ณ๊ฒฝ๋์์ต๋๋ค. ์ด ๋ณ๊ฒฝ์ด ์๋๋ ๊ฒ์ธ์ง ํ์ธํ๊ณ , ๋ง์ฝ ์ฑ๋ฅ์ ์ด์ ๊ฐ ์๋ค๋ฉด ์ฃผ์์ ๊ทธ ์ด์ ๋ฅผ ๋ช ์ํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
| .is('num_ky', null) // num_ky๊ฐ null์ธ ๋ฐ์ดํฐ๋ง ๊ฐ์ ธ์ด | |
| .is('num_ky', null) // num_ky๊ฐ null์ธ ๋ฐ์ดํฐ๋ง ๊ฐ์ ธ์ด | |
| // 'created_at' ๊ธฐ์ค์ผ๋ก ์ ๋ ฌํ๋ ๊ฒ์ ์ต๊ทผ์ ์ถ๊ฐ๋ ๊ณก์ ์ฐ์ ์ ์ผ๋ก ํ์ธํ๊ธฐ ์ํจ์ ๋๋ค. (์๋๋ ๋ณ๊ฒฝ) |
|
|
||
| // return createServerClient(process.env.SUPABASE_URL!, process.env.SUPABASE_ANON_KEY!, { | ||
| return createServerClient(process.env.SUPABASE_URL!, process.env.SUPABASE_SERVICE_ROLE_KEY!, { | ||
| // process.env.SUPABASE_SERVICE_ROLE_KEY?? ์ถ์ฒ๊ฐ ์ด๋์ง? |
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SERVICE_ROLE_KEY์์ ANON_KEY๋ก ๋ณ๊ฒฝ๋์์ต๋๋ค. SERVICE_ROLE_KEY๋ ์๋ฒ ์ธก์์ ๋ชจ๋ ๊ถํ์ ๊ฐ์ง๋ ํค์ด๋ฏ๋ก, ์ด ๋ณ๊ฒฝ์ด ๋ณด์์ ์๋๋ ๊ฒ์ธ์ง ํ์ธ์ด ํ์ํฉ๋๋ค.
| const browser = await puppeteer.launch(); | ||
| const page = await browser.newPage(); | ||
|
|
Copilot
AI
Aug 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ธ๋ผ์ฐ์ ์ธ์คํด์ค๊ฐ ๋ชจ๋ ๋ ๋ฒจ์์ ์ด๊ธฐํ๋๊ณ ์์ต๋๋ค. ์ด๋ ๋ฉ๋ชจ๋ฆฌ ๋์๋ฅผ ์ ๋ฐํ ์ ์์ผ๋ฏ๋ก, ์ฌ์ฉ ํ browser.close()๋ฅผ ํธ์ถํ๋ ๋ก์ง์ ์ถ๊ฐํ๊ฑฐ๋ ํจ์ ๋ด๋ถ๋ก ์ด๋ํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
| const browser = await puppeteer.launch(); | |
| const page = await browser.newPage(); |
๐ PR ์ ๋ชฉ
Fix : ํฌ๋กค๋ง ๋ฐฉ์ ๋ณ๊ฒฝ
๐ ๋ณ๊ฒฝ ์ฌํญ
๐ฌ ์ถ๊ฐ ์ฐธ๊ณ ์ฌํญ