mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
only check IPv6 if enabled
This commit is contained in:
@@ -77,7 +77,7 @@ func (bt *BTServer) Disconnect() {
|
||||
}
|
||||
}
|
||||
|
||||
func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
func (bt *BTServer) configure(ctx context.Context) {
|
||||
blocklist, _ := utils.ReadBlockedIP()
|
||||
bt.config = torrent.NewDefaultClientConfig()
|
||||
|
||||
@@ -145,6 +145,8 @@ func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
}
|
||||
|
||||
log.Println("Client config:", settings.BTsets)
|
||||
|
||||
var err error
|
||||
|
||||
// set public IPv4
|
||||
if settings.PubIPv4 != "" {
|
||||
@@ -168,7 +170,7 @@ func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
bt.config.PublicIp6 = ip6
|
||||
}
|
||||
}
|
||||
if bt.config.PublicIp6 == nil {
|
||||
if bt.config.PublicIp6 == nil && settings.BTsets.EnableIPv6 {
|
||||
bt.config.PublicIp6, err = publicip.Get6(ctx)
|
||||
if err != nil {
|
||||
log.Printf("error getting public ipv6 address: %v", err)
|
||||
@@ -177,7 +179,6 @@ func (bt *BTServer) configure(ctx context.Context) (err error) {
|
||||
if bt.config.PublicIp6 != nil {
|
||||
log.Println("PublicIp6:", bt.config.PublicIp6)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (bt *BTServer) GetTorrent(hash torrent.InfoHash) *Torrent {
|
||||
|
||||
Reference in New Issue
Block a user