32bit compatibility
This commit is contained in:
@@ -9,10 +9,9 @@ import (
|
||||
"github.com/debridmediamanager/zurg/internal/config"
|
||||
"github.com/debridmediamanager/zurg/pkg/logutil"
|
||||
"github.com/debridmediamanager/zurg/pkg/realdebrid"
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
cmap "github.com/orcaman/concurrent-map/v2"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
"github.com/scylladb/go-set"
|
||||
"github.com/scylladb/go-set/strset"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -25,7 +24,7 @@ type TorrentManager struct {
|
||||
Api *realdebrid.RealDebrid
|
||||
DirectoryMap cmap.ConcurrentMap[string, cmap.ConcurrentMap[string, *Torrent]] // directory -> accessKey -> Torrent
|
||||
DownloadCache cmap.ConcurrentMap[string, *realdebrid.Download]
|
||||
allAccessKeys *strset.Set
|
||||
allAccessKeys mapset.Set[string]
|
||||
latestState *LibraryState
|
||||
requiredVersion string
|
||||
workerPool *ants.Pool
|
||||
@@ -42,7 +41,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
|
||||
t := &TorrentManager{
|
||||
Config: cfg,
|
||||
Api: api,
|
||||
allAccessKeys: set.NewStringSet(),
|
||||
allAccessKeys: mapset.NewSet[string](),
|
||||
latestState: &initialSate,
|
||||
requiredVersion: "06.12.2023",
|
||||
workerPool: p,
|
||||
@@ -120,7 +119,7 @@ func (t *TorrentManager) TriggerHookOnLibraryUpdate(updatedPaths []string) {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) assignedDirectoryCb(tor *Torrent, cb func(string)) {
|
||||
torrentIDs := strset.Union(tor.DownloadedIDs, tor.InProgressIDs).List()
|
||||
torrentIDs := tor.DownloadedIDs.Union(tor.InProgressIDs).ToSlice()
|
||||
// get filenames needed for directory conditions
|
||||
var filenames []string
|
||||
var fileSizes []int64
|
||||
@@ -200,7 +199,7 @@ func (t *TorrentManager) readTorrentFromFile(torrentID string) *Torrent {
|
||||
if err := json.Unmarshal(jsonData, &torrent); err != nil {
|
||||
return nil
|
||||
}
|
||||
if strset.Union(torrent.DownloadedIDs, torrent.InProgressIDs).IsEmpty() {
|
||||
if torrent.DownloadedIDs.Union(torrent.InProgressIDs).IsEmpty() {
|
||||
t.log.Fatal("Torrent has no downloaded or in progress ids")
|
||||
}
|
||||
if torrent.Version != t.requiredVersion {
|
||||
|
||||
Reference in New Issue
Block a user