Feat: add local policy

This commit is contained in:
HFO4
2020-02-26 15:11:06 +08:00
parent c1d2b933aa
commit f1ef21e195
13 changed files with 270 additions and 35 deletions

View File

@@ -48,7 +48,11 @@ func (task *Download) AfterFind() (err error) {
// BeforeSave Save下载任务前的钩子
func (task *Download) BeforeSave() (err error) {
return task.AfterFind()
// 解析状态
if task.Attrs != "" {
err = json.Unmarshal([]byte(task.Attrs), &task.StatusInfo)
}
return err
}
// Create 创建离线下载记录