From 68954bf6ebb5ffee3702786026b02c5a90a7f2a5 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Wed, 17 Jan 2024 20:14:52 +0800 Subject: [PATCH] fix: invalid telegram session store. --- internal/fetcher/telegram.go | 2 +- internal/file/writer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/fetcher/telegram.go b/internal/fetcher/telegram.go index ca5d31b..870e86f 100644 --- a/internal/fetcher/telegram.go +++ b/internal/fetcher/telegram.go @@ -32,7 +32,7 @@ func newTelegramService(config *Config) (service, error) { // Change the process file name. config.processFile = strings.ReplaceAll(channelID, "/", "_") + ".db" - if len(config.Keywords) == 0 { + if len(config.Keywords) != 0 { config.processFile = strconv.FormatInt(time.Now().Unix(), 10) + config.processFile } diff --git a/internal/file/writer.go b/internal/file/writer.go index 328a288..b353604 100644 --- a/internal/file/writer.go +++ b/internal/file/writer.go @@ -62,7 +62,7 @@ func (c *creator) NewWriter(id, total int64, name, subPath string, format Format // Escape the file name for avoiding the illegal characters. // Ref: https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words filename = escape(filename) - + // Create the download path. downloadPath := c.downloadPath if subPath != "" {