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.
This commit is contained in:
krau
2026-01-19 21:14:01 +08:00
parent 3d20fbd0fe
commit dd0dea8cb5
13 changed files with 167 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
package tasktype
//go:generate go-enum --values --names --flag --nocase
// ENUM(tgfiles,tphpics,parseditem,directlinks,aria2,ytdlp,batchimport)
// ENUM(tgfiles,tphpics,parseditem,directlinks,aria2,ytdlp,transfer)
type TaskType string

View File

@@ -24,8 +24,8 @@ const (
TaskTypeAria2 TaskType = "aria2"
// TaskTypeYtdlp is a TaskType of type ytdlp.
TaskTypeYtdlp TaskType = "ytdlp"
// TaskTypeBatchimport is a TaskType of type batchimport.
TaskTypeBatchimport TaskType = "batchimport"
// TaskTypeTransfer is a TaskType of type transfer.
TaskTypeTransfer TaskType = "transfer"
)
var ErrInvalidTaskType = fmt.Errorf("not a valid TaskType, try [%s]", strings.Join(_TaskTypeNames, ", "))
@@ -37,7 +37,7 @@ var _TaskTypeNames = []string{
string(TaskTypeDirectlinks),
string(TaskTypeAria2),
string(TaskTypeYtdlp),
string(TaskTypeBatchimport),
string(TaskTypeTransfer),
}
// TaskTypeNames returns a list of possible string values of TaskType.
@@ -56,7 +56,7 @@ func TaskTypeValues() []TaskType {
TaskTypeDirectlinks,
TaskTypeAria2,
TaskTypeYtdlp,
TaskTypeBatchimport,
TaskTypeTransfer,
}
}
@@ -79,7 +79,7 @@ var _TaskTypeValue = map[string]TaskType{
"directlinks": TaskTypeDirectlinks,
"aria2": TaskTypeAria2,
"ytdlp": TaskTypeYtdlp,
"batchimport": TaskTypeBatchimport,
"transfer": TaskTypeTransfer,
}
// ParseTaskType attempts to convert a string to a TaskType.