Load torrent files from folder on start. ()

This commit is contained in:
Antonio Navarro Perez 2022-10-08 19:36:55 +02:00 committed by GitHub
parent b13425f370
commit fab0b8044a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 11 deletions
cmd/distribyted

View file

@ -146,6 +146,7 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
}
cl := loader.NewConfig(conf.Routes)
fl := loader.NewFolder(conf.Routes)
ss := torrent.NewStats()
dbl, err := loader.NewDB(filepath.Join(conf.Torrent.MetadataFolder, "magnetdb"))
@ -153,7 +154,7 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
return fmt.Errorf("error starting magnet database: %w", err)
}
ts := torrent.NewService(cl, dbl, ss, c, conf.Torrent.AddTimeout, conf.Torrent.ReadTimeout)
ts := torrent.NewService([]loader.Loader{cl, fl}, dbl, ss, c, conf.Torrent.AddTimeout, conf.Torrent.ReadTimeout)
var mh *fuse.Handler
if conf.Fuse != nil {