Files
SaveAny-Bot/pkg/tcbdata/data.go
krau dd0dea8cb5 feat!: Refactor batch import task to transfer task
- Updated command usage in English and Simplified Chinese localization files to reflect changes in transfer command syntax.
- Removed batch import task implementation, replacing it with a new transfer task implementation.
- Introduced new task structure and progress tracking for file transfers.
- Updated task type enumeration to replace batch import with transfer.
- Added new fields in data structures to support transfer operations.
- Implemented file handling and progress reporting for the transfer task.
2026-01-19 21:14:01 +08:00

64 lines
1.3 KiB
Go

package tcbdata
import (
"github.com/krau/SaveAny-Bot/pkg/enums/tasktype"
"github.com/krau/SaveAny-Bot/pkg/parser"
"github.com/krau/SaveAny-Bot/pkg/telegraph"
"github.com/krau/SaveAny-Bot/pkg/tfile"
)
const (
TypeAdd = "add"
TypeSetDefault = "setdefault"
TypeConfig = "config"
TypeCancel = "cancel"
)
// type TaskDataTGFiles struct {
// Files []tfile.TGFileMessage
// AsBatch bool
// }
// type TaskDataTelegraph struct {
// Pics []string
// PageNode *telegraph.Page
// }
// type TaskDataType interface {
// TaskDataTGFiles | TaskDataTelegraph
// }
type Add struct {
// [TODO] maybe we should to spilit this into different types...
TaskType tasktype.TaskType
SelectedStorName string
DirID uint
SettedDir bool
// tfiles
Files []tfile.TGFileMessage
AsBatch bool
// tphpics
TphPageNode *telegraph.Page
TphPics []string
TphDirPath string // unescaped telegraph.Page.Path
// parseditem
ParsedItem *parser.Item
// directlinks
DirectLinks []string
// aria2
Aria2URIs []string
// ytdlp
YtdlpURLs []string
YtdlpFlags []string
// transfer
TransferSourceStorName string
TransferSourcePath string
TransferFiles []string // file paths relative to source storage
TransferTargetPath string
}
type SetDefaultStorage struct {
StorageName string
DirID uint
}