mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 05:56:10 +05:00
update
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package torr
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sort"
|
||||
|
||||
"github.com/anacrolix/torrent"
|
||||
"github.com/anacrolix/torrent/metainfo"
|
||||
"server/log"
|
||||
sets "server/settings"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -24,13 +24,12 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string) (*Torrent, erro
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !torr.GotInfo() {
|
||||
log.TLogln("error add torrent:", "timeout connection torrent")
|
||||
return nil, errors.New("timeout connection torrent")
|
||||
if torr.Title == "" {
|
||||
torr.Title = title
|
||||
}
|
||||
if torr.Poster == "" {
|
||||
torr.Poster = poster
|
||||
}
|
||||
|
||||
torr.Title = title
|
||||
torr.Poster = poster
|
||||
|
||||
if torr.Title == "" {
|
||||
torr.Title = torr.Name()
|
||||
@@ -86,3 +85,9 @@ func DropTorrent(hashHex string) {
|
||||
hash := metainfo.NewHashFromHex(hashHex)
|
||||
bts.RemoveTorrent(hash)
|
||||
}
|
||||
|
||||
func SetSettings(set *sets.BTSets) {
|
||||
bts.Disconnect()
|
||||
sets.SetBTSets(set)
|
||||
bts.Connect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user