Changelog 0.3.0

This commit is contained in:
Mukhtar Akere
2024-11-30 15:46:58 +01:00
parent df2aa4e361
commit a51364d150
53 changed files with 2019 additions and 679 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/anacrolix/torrent/metainfo"
"goBlack/common"
"goBlack/pkg/arr"
"log"
"path/filepath"
)
@@ -94,16 +95,17 @@ func getTorrentInfo(filePath string) (*Torrent, error) {
if err != nil {
return nil, err
}
infoLength := info.Length
magnet := &common.Magnet{
InfoHash: infoHash,
Name: info.Name,
Size: info.Length,
Size: infoLength,
Link: mi.Magnet(&hash, &info).String(),
}
torrent := &Torrent{
InfoHash: infoHash,
Name: info.Name,
Size: info.Length,
Size: infoLength,
Magnet: magnet,
Filename: filePath,
}
@@ -136,12 +138,12 @@ func GetLocalCache(infohashes []string, cache *common.Cache) ([]string, map[stri
return infohashes, result
}
func ProcessQBitTorrent(d *DebridService, magnet *common.Magnet, arr *Arr, isSymlink bool) (*Torrent, error) {
func ProcessTorrent(d *DebridService, magnet *common.Magnet, a *arr.Arr, isSymlink bool) (*Torrent, error) {
debridTorrent := &Torrent{
InfoHash: magnet.InfoHash,
Magnet: magnet,
Name: magnet.Name,
Arr: arr,
Arr: a,
Size: magnet.Size,
}
@@ -159,15 +161,16 @@ func ProcessQBitTorrent(d *DebridService, magnet *common.Magnet, arr *Arr, isSym
}
}
debridTorrent, err := db.SubmitMagnet(debridTorrent)
if err != nil || debridTorrent.Id == "" {
dbt, err := db.SubmitMagnet(debridTorrent)
if err != nil || dbt.Id == "" {
logger.Printf("Error submitting magnet: %s", err)
continue
}
logger.Printf("Torrent: %s submitted to %s", debridTorrent.Name, db.GetName())
logger.Printf("Torrent: %s submitted to %s", dbt.Name, db.GetName())
d.lastUsed = index
debridTorrent.Debrid = db
return db.CheckStatus(debridTorrent, isSymlink)
dbt.Debrid = db
dbt.Arr = a
return db.CheckStatus(dbt, isSymlink)
}
return nil, fmt.Errorf("failed to process torrent")
}