mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-20 17:16:39 +08:00
refactor: change type of percentage to float64
This commit is contained in:
@@ -26,7 +26,7 @@ type Task[K comparable] struct {
|
||||
Name string
|
||||
state string // pending, running, finished, canceling, canceled, errored
|
||||
status string
|
||||
progress int
|
||||
progress float64
|
||||
|
||||
Error error
|
||||
|
||||
@@ -41,11 +41,11 @@ func (t *Task[K]) SetStatus(status string) {
|
||||
t.status = status
|
||||
}
|
||||
|
||||
func (t *Task[K]) SetProgress(percentage int) {
|
||||
func (t *Task[K]) SetProgress(percentage float64) {
|
||||
t.progress = percentage
|
||||
}
|
||||
|
||||
func (t Task[K]) GetProgress() int {
|
||||
func (t Task[K]) GetProgress() float64 {
|
||||
return t.progress
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user