init adding rclone

This commit is contained in:
Mukhtar Akere
2025-02-12 22:11:58 +01:00
parent c386495d3d
commit 878f78468f
41 changed files with 6741 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package engine
type Engine struct {
Debrids []Service
LastUsed int
}
func (d *Engine) Get() Service {
if d.LastUsed == 0 {
return d.Debrids[0]
}
return d.Debrids[d.LastUsed]
}
func (d *Engine) GetByName(name string) Service {
for _, deb := range d.Debrids {
if deb.GetName() == name {
return deb
}
}
return nil
}
func (d *Engine) GetDebrids() []Service {
return d.Debrids
}

View File

@@ -0,0 +1,21 @@
package engine
import (
"github.com/rs/zerolog"
"github.com/sirrobot01/debrid-blackhole/pkg/debrid/torrent"
)
type Service interface {
SubmitMagnet(tr *torrent.Torrent) (*torrent.Torrent, error)
CheckStatus(tr *torrent.Torrent, isSymlink bool) (*torrent.Torrent, error)
GetDownloadLinks(tr *torrent.Torrent) error
GetDownloadLink(tr *torrent.Torrent, file *torrent.File) *torrent.DownloadLinks
DeleteTorrent(tr *torrent.Torrent)
IsAvailable(infohashes []string) map[string]bool
GetMountPath() string
GetCheckCached() bool
GetTorrent(id string) (*torrent.Torrent, error)
GetTorrents() ([]*torrent.Torrent, error)
GetName() string
GetLogger() zerolog.Logger
}