refactor: simplify storage path handling across various tasks and storage implementations

This commit is contained in:
krau
2026-01-19 21:27:53 +08:00
parent 6990543c9f
commit 9b52a3e0ce
15 changed files with 22 additions and 25 deletions

View File

@@ -66,15 +66,12 @@ func (t *Telegram) Name() string {
return t.config.Name
}
func (t *Telegram) JoinStoragePath(p string) string {
return path.Clean(p)
}
func (t *Telegram) Exists(ctx context.Context, storagePath string) bool {
return false
}
func (t *Telegram) Save(ctx context.Context, r io.Reader, storagePath string) error {
storagePath = path.Clean(storagePath)
tctx := tgutil.ExtFromContext(ctx)
if tctx == nil {
return fmt.Errorf("failed to get telegram context")