Rewrote account switching, fix some minor bugs here and there

This commit is contained in:
Mukhtar Akere
2025-09-16 21:15:24 +01:00
parent 76f5b85313
commit 30b2db06e7
34 changed files with 945 additions and 866 deletions
+3 -2
View File
@@ -3,7 +3,6 @@ package wire
import (
"crypto/md5"
"fmt"
"github.com/google/uuid"
"net/http"
"os"
"path/filepath"
@@ -13,6 +12,8 @@ import (
"sync"
"time"
"github.com/google/uuid"
"github.com/sirrobot01/decypharr/pkg/debrid/types"
"github.com/cavaliergopher/grab/v3"
@@ -350,7 +351,7 @@ func (s *Store) downloadFiles(torrent *Torrent, debridTorrent *types.Torrent, pa
}
errChan := make(chan error, len(debridTorrent.Files))
for _, file := range debridTorrent.GetFiles() {
if file.DownloadLink == nil {
if file.DownloadLink.Empty() {
s.logger.Info().Msgf("No download link found for %s", file.Name)
continue
}
+1
View File
@@ -25,6 +25,7 @@ func createTorrentFromMagnet(req *ImportRequest) *Torrent {
AutoTmm: false,
Ratio: 1,
RatioLimit: 1,
TotalSize: magnet.Size,
SavePath: filepath.Join(req.DownloadFolder, arrName) + string(os.PathSeparator),
}
return torrent
+1
View File
@@ -292,6 +292,7 @@ func (s *Store) partialTorrentUpdate(t *Torrent, debridTorrent *types.Torrent) *
t.Files = files
t.Debrid = debridTorrent.Debrid
t.Size = totalSize
t.TotalSize = totalSize
t.Completed = sizeCompleted
t.NumSeeds = debridTorrent.Seeders
t.Downloaded = sizeCompleted