mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-22 00:30:36 +08:00
Merge pull request #204 from Rain-kl/feat/save-strategy
新增功能: 重名文件时选择保存策略 - 重命名,覆盖,跳过
This commit is contained in:
@@ -14,6 +14,31 @@ const (
|
||||
TypeCancel = "cancel"
|
||||
)
|
||||
|
||||
const (
|
||||
ConflictStrategyRename = "rename"
|
||||
ConflictStrategyAsk = "ask"
|
||||
ConflictStrategyOverwrite = "overwrite"
|
||||
ConflictStrategySkip = "skip"
|
||||
)
|
||||
|
||||
func ConflictStrategyValues() []string {
|
||||
return []string{
|
||||
ConflictStrategyRename,
|
||||
ConflictStrategyAsk,
|
||||
ConflictStrategyOverwrite,
|
||||
ConflictStrategySkip,
|
||||
}
|
||||
}
|
||||
|
||||
func IsConflictStrategy(strategy string) bool {
|
||||
for _, value := range ConflictStrategyValues() {
|
||||
if strategy == value {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// type TaskDataTGFiles struct {
|
||||
// Files []tfile.TGFileMessage
|
||||
// AsBatch bool
|
||||
@@ -34,6 +59,8 @@ type Add struct {
|
||||
SelectedStorName string
|
||||
DirID uint
|
||||
SettedDir bool
|
||||
SelectedDirPath string
|
||||
ConflictStrategy string
|
||||
// tfiles
|
||||
Files []tfile.TGFileMessage
|
||||
AsBatch bool
|
||||
|
||||
Reference in New Issue
Block a user