Save based on access key and dont retry code 19
This commit is contained in:
@@ -48,11 +48,10 @@ func (t *TorrentManager) refreshTorrents() []string {
|
||||
return false
|
||||
})
|
||||
|
||||
existingHashes := mapset.NewSet[string]()
|
||||
cachedAccessKeys := mapset.NewSet[string]()
|
||||
t.getTorrentFiles("data").Each(func(path string) bool {
|
||||
path = filepath.Base(path)
|
||||
hash := strings.TrimSuffix(path, ".zurgtorrent")
|
||||
existingHashes.Add(hash)
|
||||
cachedAccessKeys.Add(strings.TrimSuffix(path, ".zurgtorrent"))
|
||||
return false
|
||||
})
|
||||
|
||||
@@ -96,7 +95,7 @@ func (t *TorrentManager) refreshTorrents() []string {
|
||||
}
|
||||
|
||||
// write to file if it is a new torrent
|
||||
if forMerging == nil && !existingHashes.Contains(tInfo.Hash) {
|
||||
if forMerging == nil && !cachedAccessKeys.Contains(accessKey) {
|
||||
t.writeTorrentToFile(torrent)
|
||||
}
|
||||
|
||||
@@ -324,9 +323,14 @@ func (t *TorrentManager) mergeTorrents(existing, toMerge *Torrent) *Torrent {
|
||||
}
|
||||
})
|
||||
older.SelectedFiles.IterCb(func(key string, file *File) {
|
||||
if f, ok := mergedTorrent.SelectedFiles.Get(key); !ok || !f.State.Is("ok_file") {
|
||||
mediaInfo := file.MediaInfo
|
||||
f, ok := mergedTorrent.SelectedFiles.Get(key)
|
||||
if !ok || !f.State.Is("ok_file") {
|
||||
mergedTorrent.SelectedFiles.Set(key, file)
|
||||
}
|
||||
if ok && f.MediaInfo == nil && mediaInfo != nil {
|
||||
f.MediaInfo = mediaInfo
|
||||
}
|
||||
})
|
||||
|
||||
// unassigned links
|
||||
|
||||
Reference in New Issue
Block a user