fix multi-api key bug

This commit is contained in:
Mukhtar Akere
2025-04-11 00:05:09 +01:00
parent a357897222
commit 101ae4197e
13 changed files with 282 additions and 140 deletions

View File

@@ -8,7 +8,7 @@ type Client interface {
SubmitMagnet(tr *Torrent) (*Torrent, error)
CheckStatus(tr *Torrent, isSymlink bool) (*Torrent, error)
GenerateDownloadLinks(tr *Torrent) error
GetDownloadLink(tr *Torrent, file *File) (string, error)
GetDownloadLink(tr *Torrent, file *File) (string, string, error)
DeleteTorrent(torrentId string) error
IsAvailable(infohashes []string) map[string]bool
GetCheckCached() bool
@@ -21,6 +21,6 @@ type Client interface {
GetDownloads() (map[string]DownloadLinks, error)
CheckLink(link string) error
GetMountPath() string
RemoveActiveDownloadKey()
DisableAccount(string)
ResetActiveDownloadKeys()
}

View File

@@ -78,6 +78,7 @@ type File struct {
Path string `json:"path"`
Link string `json:"link"`
DownloadLink string `json:"download_link"`
AccountId string `json:"account_id"`
Generated time.Time `json:"generated"`
}
@@ -118,3 +119,10 @@ func (t *Torrent) GetFile(id string) *File {
}
return nil
}
type Account struct {
ID string `json:"id"`
Disabled bool `json:"disabled"`
Name string `json:"name"`
Token string `json:"token"`
}