diff --git a/internal/leetcode/question_data.go b/internal/leetcode/question_data.go index db52de55e..f7601a734 100644 --- a/internal/leetcode/question_data.go +++ b/internal/leetcode/question_data.go @@ -27,15 +27,16 @@ func QuestionData(titleSlug string, isForce bool, graphQL ...string) (qd questio if len(graphQL) == 0 { graphQL = []string{graphQLCnUrl} } - filename := fmt.Sprintf(questionDataFile, slugToSnake(titleSlug)) + name := fmt.Sprintf(questionDataFile, slugToSnake(titleSlug)) + filename := getCachePath(name) oldContent := getContent(filename) - graphQLRequest(graphQL[0], jsonStr, filename, days, &qd) + graphQLRequest(graphQL[0], jsonStr, name, days, &qd) if qd.Data.Question.Content == "" && oldContent != "" { qd.Data.Question.Content = oldContent filePutContents(filename, jsonEncode(qd)) } if qd.Data.Question.TitleSlug == "" { - _ = os.Remove(getCachePath(filename)) + os.Remove(filename) if graphQL[0] == graphQLCnUrl { return QuestionData(titleSlug, isForce, graphQLUrl) } diff --git a/internal/version/version.go b/internal/version/version.go index 45b862cf7..db4a5016a 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -7,7 +7,7 @@ import ( "github.com/openset/leetcode/internal/base" ) -const version = "1.4.2" +const version = "1.4.3" var CmdVersion = &base.Command{ Run: runVersion,