mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-11 23:49:58 +08:00
feat: parse url with js plugins support (#96)
* feat: WIP. add parser functionality and text message handling * fix: use json to marshal js result * feat: add metadata handling and version validation for jsParser * refactor: rename parser package to parsers and restructure parser handling * refactor: core code struct and impl parse task handle * feat: impl parsed download * fix: seek cache file when processing tph picture * feat: implement parsed task handling and progress tracking * feat: enhance task processing with concurrency control and progress tracking * feat: add resource ID generation and improve resource processing handling * feat: improve message formatting in parsed text and progress completion * feat: add example js plugin * feat: implement Twitter parser * fix: twitter parse video json decode error * feat: impl stream mode for parse task
This commit is contained in:
29
core/tasks/tfile/taskinfo.go
Normal file
29
core/tasks/tfile/taskinfo.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package tfile
|
||||
|
||||
type TaskInfo interface {
|
||||
TaskID() string
|
||||
FileName() string
|
||||
FileSize() int64
|
||||
StoragePath() string
|
||||
StorageName() string
|
||||
}
|
||||
|
||||
func (t *Task) TaskID() string {
|
||||
return t.ID
|
||||
}
|
||||
|
||||
func (t *Task) FileName() string {
|
||||
return t.File.Name()
|
||||
}
|
||||
|
||||
func (t *Task) FileSize() int64 {
|
||||
return t.File.Size()
|
||||
}
|
||||
|
||||
func (t *Task) StoragePath() string {
|
||||
return t.Path
|
||||
}
|
||||
|
||||
func (t *Task) StorageName() string {
|
||||
return t.Storage.Name()
|
||||
}
|
||||
Reference in New Issue
Block a user