From e2e14ba3ee95315ec1fa8ffeea693349ae120deb Mon Sep 17 00:00:00 2001 From: "build@apk-groulx" Date: Sun, 31 Jul 2022 16:43:19 +0000 Subject: [PATCH 1/1] change-prefix-to-scan --- scantopl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scantopl.go b/scantopl.go index e19ac9f..20bc6c7 100644 --- a/scantopl.go +++ b/scantopl.go @@ -20,7 +20,7 @@ func FilenameWithoutExtension(fn string) string { } func TitleFromFileName(fn string) string { - return strings.TrimPrefix(FilenameWithoutExtension(fn), "pl_") + return strings.TrimPrefix(FilenameWithoutExtension(fn), "scan_") } func createForm(form map[string]string) (string, io.Reader, error) { @@ -101,7 +101,7 @@ func main() { return } //log.Println("event:", event) - if event.Op&fsnotify.Create == fsnotify.Create && strings.HasPrefix(path.Base(event.Name), "pl_") { + if event.Op&fsnotify.Create == fsnotify.Create && strings.HasPrefix(path.Base(event.Name), "scan_") { //little pause to ensure the write operation is finished time.Sleep(1 * time.Second) log.Info("New file to upload:", event.Name) -- 2.36.2