Skip to content

Commit

Permalink
馃敡 code fmt [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
iawia002 committed Sep 30, 2019
1 parent 795edc2 commit e1b2308
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extractors/bilibili/bilibili.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func bilibiliDownload(options bilibiliOptions) downloader.Data {
}
title := parser.Title(doc)
if options.subtitle != "" {
title = fmt.Sprintf("%s P%d %s", title, options.page, options.subtitle)
title = fmt.Sprintf("%s P%d %s", title, options.page, options.subtitle)
}

downloader.Caption(
Expand Down
16 changes: 8 additions & 8 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ func FileName(name string, ext string) string {
rep = strings.NewReplacer("\"", " ", "?", " ", "*", " ", "\\", " ", "<", " ", ">", " ")
name = rep.Replace(name)
}
limitedName := LimitLength(name, MAXLENGTH)
if ext == "" {
return limitedName
} else {
return fmt.Sprintf("%s.%s", limitedName, ext)
}
limitedName := LimitLength(name, MAXLENGTH)
if ext == "" {
return limitedName
} else {
return fmt.Sprintf("%s.%s", limitedName, ext)
}
}

// FilePath gen valid file path
Expand All @@ -115,8 +115,8 @@ func FilePath(name, ext string, escape bool) (string, error) {
if escape {
fileName = FileName(name, ext)
} else {
fileName = fmt.Sprintf("%s.%s", name, ext)
}
fileName = fmt.Sprintf("%s.%s", name, ext)
}
outputPath = filepath.Join(config.OutputPath, fileName)
return outputPath, nil
}
Expand Down

0 comments on commit e1b2308

Please sign in to comment.