mirror of
https://github.com/simon-ding/polaris.git
synced 2026-04-21 19:27:30 +08:00
feat: complete qbittorrent support
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
@@ -15,12 +17,20 @@ func (DownloadClients) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Bool("enable"),
|
||||
field.String("name"),
|
||||
field.String("implementation"),
|
||||
field.Enum("implementation").Values("transmission", "qbittorrent"),
|
||||
field.String("url"),
|
||||
field.String("user").Default(""),
|
||||
field.String("password").Default(""),
|
||||
field.String("settings").Default(""),
|
||||
field.String("priority").Default(""),
|
||||
field.Int("ordering").Default(1).Validate(func(i int) error {
|
||||
if i > 50 {
|
||||
return errors.ErrUnsupported
|
||||
}
|
||||
if i <= 0 {
|
||||
return errors.ErrUnsupported
|
||||
}
|
||||
return nil
|
||||
}),
|
||||
field.Bool("remove_completed_downloads").Default(true),
|
||||
field.Bool("remove_failed_downloads").Default(true),
|
||||
field.String("tags").Default(""),
|
||||
|
||||
Reference in New Issue
Block a user