Skip to content

Commit

Permalink
逐步脱离mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyiming748 committed Dec 28, 2023
1 parent 33cfa8d commit 05d3805
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 1,036 deletions.
17 changes: 7 additions & 10 deletions merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Merge(rootPath string) {
slog.Info("2", slog.String("2", sec))
entry := strings.Join([]string{sec, "entry.json"}, string(os.PathSeparator))
name := getName(entry)
//name = CutName(name)
name = CutName(name)
slog.Info("entry", slog.String("获取到的文件名", name))
thirds := getall(sec)
for _, third := range thirds {
Expand Down Expand Up @@ -157,14 +157,9 @@ func getName(jackson string) (name string) {
if err != nil {
return
}
if entry.PageData.Part != "" {
//name = strings.Join([]string{entry.Title, entry.PageData.DownloadSubtitle}, "-")
name = entry.PageData.Part
} else {
name = entry.Title
}
name = strings.Join([]string{entry.PageData.Part, entry.Title}, "")
name = replace.ForFileName(name)
slog.Debug("解析之后", slog.String("最终名称", name))
slog.Debug("解析之后拼接", slog.String("名称", name))
return name
}

Expand Down Expand Up @@ -211,15 +206,17 @@ func isFileExist(fp string) bool {
func CutName(before string) (after string) {
for i, char := range before {
slog.Debug(fmt.Sprintf("第%d个字符:%v", i+1, string(char)))
if !Effective(string(char)) {
continue
}
if i >= 124 {
slog.Debug("截取124之前的完整字符")
break
} else {
after = strings.Join([]string{after, string(char)}, "")
}
}
slog.Debug(fmt.Sprintf("截取的完整字符:%vbefore", after))
slog.Debug("截取后", slog.String("字符串", after))
slog.Debug("截取后", slog.String("before", before), slog.String("after", after))
return after
}
func kindesOfPrefix() string {
Expand Down
74 changes: 0 additions & 74 deletions model/audio.go

This file was deleted.

78 changes: 0 additions & 78 deletions model/av.go

This file was deleted.

55 changes: 0 additions & 55 deletions model/err.go

This file was deleted.

82 changes: 0 additions & 82 deletions model/file.go

This file was deleted.

Loading

0 comments on commit 05d3805

Please sign in to comment.