Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/description/description.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package description

import (
"fmt"
"sync"

"github.com/openset/leetcode/internal/base"
Expand All @@ -24,6 +25,7 @@ func runDescription(cmd *base.Command, args []string) {
for _, problem := range problems.StatStatusPairs {
wg.Add(1)
tokens <- true
fmt.Println(problem.Stat.FrontendQuestionId, "\t"+problem.Stat.QuestionTitle)
go func(problem leetcode.StatStatusPairsType) {
titleSlug := problem.Stat.QuestionTitleSlug
question := leetcode.QuestionData(titleSlug, false).Data.Question
Expand Down
1 change: 0 additions & 1 deletion internal/leetcode/question_article.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

func GetDescription(articleSlug string) string {
fmt.Println("\tquestion article", "saving...")
filename := fmt.Sprintf(questionArticleFile, slugToSnake(articleSlug))
html := remember(filename, 6, func() []byte {
return client.Get(fmt.Sprintf(questionArticleUrl, articleSlug))
Expand Down
1 change: 0 additions & 1 deletion internal/leetcode/question_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (d difficultyStrType) Str() (s string) {

func (question questionType) SaveContent() {
if question.TitleSlug != "" {
fmt.Println(question.QuestionFrontendId, "\t"+question.Title, "saving...")
filePutContents(question.getFilePath("README.md"), question.getDescContent())
question.saveMysqlSchemas()
}
Expand Down
2 changes: 2 additions & 0 deletions internal/question/question.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package question

import (
"fmt"
"strconv"

"github.com/openset/leetcode/internal/base"
Expand All @@ -22,6 +23,7 @@ func runQuestion(cmd *base.Command, args []string) {
problems := leetcode.ProblemsAll()
for _, problem := range problems.StatStatusPairs {
if problem.Stat.FrontendQuestionId == questionId {
fmt.Println(questionId, "\t"+problem.Stat.QuestionTitle)
titleSlug := problem.Stat.QuestionTitleSlug
question := leetcode.QuestionData(titleSlug, true).Data.Question
if question.Content == "" && problem.PaidOnly == true && problem.Stat.QuestionArticleLive {
Expand Down