Skip to content

Commit a358f58

Browse files
authored
Merge pull request #170 from codingpot/feat/169/add-pr-332-339
feat: add PR videos
2 parents 633a707 + abcbc63 commit a358f58

File tree

5 files changed

+10059
-8642
lines changed

5 files changed

+10059
-8642
lines changed

client/lib/sort_preference.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ class SortMode extends ChangeNotifier {
2525
}
2626

2727
// This type should not be a widget(e.g. Icon) because of mockito support...
28-
IconData get icon =>
29-
_isDescOrder ? Icons.arrow_upward : Icons.arrow_downward;
28+
IconData get icon => _isDescOrder ? Icons.arrow_upward : Icons.arrow_downward;
3029

3130
// This type should not be a widget(e.g. Text) because of mockito support...
3231
String get text => _isDescOrder ? "오름차순으로" : "내림차순으로";

dbctl/README.md

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,25 @@
1-
# Metadata manager
2-
3-
## 1. Generate a metadata from the mapping table
4-
5-
MappingTable(database.proto)
6-
7-
```proto
8-
message MappingTable {
9-
repeated MappingTableRow rows = 1;
10-
}
11-
12-
message MappingTableRow {
13-
int32 pr_id = 1;
14-
repeated string paper_arxiv_id = 2;
15-
string youtube_video_id = 3;
16-
}
17-
```
18-
19-
Database(database.proto)
20-
21-
```proto
22-
message Database {
23-
map<int32, PrVideo> pr_id_to_video = 1;
24-
}
25-
26-
// PR영상의 하나의 레코드
27-
message PrVideo {
28-
int32 pr_id = 1;
29-
// 관련도에 따라 정렬
30-
repeated Paper papers = 2;
31-
YouTubeVideo video = 3;
32-
}
33-
34-
// 유튜브 1편에 대한 정보
35-
// `pkg.pr12er.Video` 생성하기 위해 사용됩니다.
36-
message YouTubeVideo {
37-
string video_id = 1;
38-
string video_title = 2;
39-
int64 number_of_likes = 3;
40-
int64 number_of_views = 4;
41-
google.protobuf.Timestamp published_date = 5;
42-
string uploader = 6;
43-
}
44-
```
45-
46-
2.
1+
# dbctl
2+
3+
`dbctl` 은 데이터베이스 파일을 업데이트 하는데 사용됩니다.
4+
5+
## 새로운 PR 영상을 추가하기
6+
7+
1. PR 영상의 유튜브 주소를 획득합니다.
8+
2. 아래 스크립트를 실행합니다 (bash 기준).
9+
10+
```bash
11+
youtube_links=(
12+
https://youtu.be/-5fFL68d7Gg
13+
https://youtu.be/I9kQwMbpxuE
14+
https://youtu.be/HWf8CmTAIR4
15+
https://youtu.be/FFXAm2uTmeI
16+
https://youtu.be/20kxrS2yglg
17+
https://youtu.be/BZwUR9hvBPE
18+
https://youtu.be/hptinxZIXT4
19+
)
20+
21+
for youtube in ${youtube_links[@]}
22+
do
23+
go run main.go youtube --youtube-link $youtube >> ../server/internal/data/mapping_table.pbtxt
24+
done
25+
```

dbctl/internal/transform/transform.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ func ExtractPaperIDs(title string) ([]string, error) {
9393
}
9494

9595
var paperIDs []string
96+
// save paperIDs that were already seen.
97+
seenPaperID := map[string]bool{}
9698

9799
for i := 0; i < maxLen; i++ {
98100
arxivID, _ := ExtractArxivIDFromURL(search[i].URL)
101+
102+
if seenPaperID[arxivID] {
103+
continue
104+
}
105+
99106
paperIDs = append(paperIDs, arxivID)
107+
seenPaperID[arxivID] = true
100108
}
101109

102110
return paperIDs, nil

0 commit comments

Comments
 (0)