From 87593db7993d1f3689d9602eed3ef095ac69cfb4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 2 Oct 2024 10:48:53 +0300 Subject: rename some funcs --- internal/queue/queue.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/queue') diff --git a/internal/queue/queue.go b/internal/queue/queue.go index 94ea1e0..ae8e377 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -29,7 +29,7 @@ func queueEntries(args config.Args) error { // Strictly, we only operate on .txt files, but we also accept .md as Obsidian creates only .md files. var validExtensions = []string{".txt", ".md"} - ch, err := oi.ReadDirFilter(args.GosDir, func(file os.DirEntry) (string, bool) { + ch, err := oi.ReadDirCh(args.GosDir, func(file os.DirEntry) (string, bool) { filePath := filepath.Join(args.GosDir, file.Name()) return filePath, slices.Contains(validExtensions, filepath.Ext(file.Name())) && file.Type().IsRegular() @@ -54,7 +54,7 @@ func queueEntries(args config.Args) error { // for each PLATFORM func queuePlatforms(args config.Args) error { dbDir := filepath.Join(args.GosDir, "db") - ch, err := oi.ReadDirFilter(dbDir, func(file os.DirEntry) (string, bool) { + ch, err := oi.ReadDirCh(dbDir, func(file os.DirEntry) (string, bool) { filePath := filepath.Join(dbDir, file.Name()) return filePath, strings.HasSuffix(file.Name(), ".queued") }) @@ -81,9 +81,7 @@ func queuePlatforms(args config.Args) error { // Queue ./db/queued/*.txt.STAMP.queued to ./db/platforms/PLATFORM/*.txt.STAMP.queued func queuePlatform(entryPath, gosDir, platform string) error { destDir := filepath.Join(gosDir, "db/platform", strings.ToLower(platform)) - // destDir := fmt.Sprintf("%s/db/platforms/%s/", gosDir, strings.ToLower(platform)) destPath := filepath.Join(destDir, filepath.Base(entryPath)) - // destPath := fmt.Sprintf("%s/%s", destDir, filepath.Base(entryPath)) postedFile := fmt.Sprintf("%s.posted", strings.TrimSuffix(destPath, ".queued")) // Entry already posted platform? -- cgit v1.2.3