fixes here and there
This commit is contained in:
@@ -13,31 +13,23 @@ import (
|
||||
"github.com/debridmediamanager.com/zurg/internal/net"
|
||||
"github.com/debridmediamanager.com/zurg/internal/torrent"
|
||||
"github.com/debridmediamanager.com/zurg/pkg/logutil"
|
||||
"github.com/debridmediamanager.com/zurg/pkg/realdebrid"
|
||||
"github.com/hashicorp/golang-lru/v2/expirable"
|
||||
"github.com/nutsdb/nutsdb"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rlog := logutil.NewLogger()
|
||||
log := rlog.Named("zurg")
|
||||
log := logutil.NewLogger().Named("zurg")
|
||||
|
||||
config, configErr := config.LoadZurgConfig("./config.yml")
|
||||
if configErr != nil {
|
||||
log.Panicf("Config failed to load: %v", configErr)
|
||||
}
|
||||
|
||||
db, err := nutsdb.Open(
|
||||
nutsdb.DefaultOptions,
|
||||
nutsdb.WithDir("/tmp/nutsdb"),
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
cache := expirable.NewLRU[string, string](1e4, nil, time.Hour)
|
||||
|
||||
torrentMgr := torrent.NewTorrentManager(config, db)
|
||||
rd := realdebrid.NewRealDebrid(config.GetToken(), config, logutil.NewLogger().Named("realdebrid"))
|
||||
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
net.Router(mux, config, torrentMgr, cache)
|
||||
|
||||
Reference in New Issue
Block a user