From ac74e2dc0759e82e2a0c411aa74a89396d059a02 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Mon, 19 Jul 2021 13:30:34 +0300 Subject: [PATCH] add PeriodicallyAnnounceTorrentsToDht opt --- server/settings/btsets.go | 2 ++ server/torr/btserver.go | 3 +-- web/src/components/Settings/SecondarySettingsComponent.jsx | 6 ++++++ web/src/components/Settings/defaultSettings.js | 1 + web/src/locales/en/translation.json | 1 + web/src/locales/ru/translation.json | 1 + 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/settings/btsets.go b/server/settings/btsets.go index 5d6c65c..100d4e1 100644 --- a/server/settings/btsets.go +++ b/server/settings/btsets.go @@ -29,6 +29,7 @@ type BTSets struct { // BT Config AcceptPeerCon bool + AnnTorrentsToDht bool EnableIPv6 bool DisableTCP bool DisableUTP bool @@ -121,6 +122,7 @@ func loadBTSets() { func SetDefault() { sets := new(BTSets) sets.AcceptPeerCon = true + sets.AnnTorrentsToDht = true sets.EnableDebug = false sets.DisableUTP = true sets.CacheSize = 96 * 1024 * 1024 // 96 MB diff --git a/server/torr/btserver.go b/server/torr/btserver.go index 63fa9a8..7aedc97 100644 --- a/server/torr/btserver.go +++ b/server/torr/btserver.go @@ -64,8 +64,7 @@ func (bt *BTServer) configure() { cliVers := userAgent //"uTorrent/2210(25302)" bt.config.AcceptPeerConnections = settings.BTsets.AcceptPeerCon - bt.config.PeriodicallyAnnounceTorrentsToDht = false - + bt.config.PeriodicallyAnnounceTorrentsToDht = settings.BTsets.AnnTorrentsToDht bt.config.Debug = settings.BTsets.EnableDebug bt.config.DisableIPv6 = settings.BTsets.EnableIPv6 == false bt.config.DisableTCP = settings.BTsets.DisableTCP diff --git a/web/src/components/Settings/SecondarySettingsComponent.jsx b/web/src/components/Settings/SecondarySettingsComponent.jsx index b4cf6ad..6ced79f 100644 --- a/web/src/components/Settings/SecondarySettingsComponent.jsx +++ b/web/src/components/Settings/SecondarySettingsComponent.jsx @@ -9,6 +9,7 @@ export default function SecondarySettingsComponent({ settings, inputForm }) { const { AcceptPeerCon, + AnnTorrentsToDht, RetrackersMode, TorrentDisconnectTimeout, EnableIPv6, @@ -85,6 +86,11 @@ export default function SecondarySettingsComponent({ settings, inputForm }) { label={t('SettingsDialog.DHT')} labelPlacement='start' /> + } + label={t('SettingsDialog.AnnTorrentsToDht')} + labelPlacement='start' + /> } label={t('SettingsDialog.AcceptPeerCon')} diff --git a/web/src/components/Settings/defaultSettings.js b/web/src/components/Settings/defaultSettings.js index 88f4e55..a01b26e 100644 --- a/web/src/components/Settings/defaultSettings.js +++ b/web/src/components/Settings/defaultSettings.js @@ -1,5 +1,6 @@ export default { AcceptPeerCon: true, + AnnTorrentsToDht: true, CacheSize: 96, ReaderReadAHead: 95, UseDisk: false, diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index 2cc5d9a..e397e49 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -85,6 +85,7 @@ "SelectSeason": "Select Season", "SettingsDialog": { "AcceptPeerCon": "Accept Peer Connections", + "AnnTorrentsToDht": "Periodically Announce Torrents To DHT", "AddRetrackers": "Add retrackers", "AdditionalSettings": "Additional Settings", "CacheBeforeReaderDesc": "from cache will be saved before currently played frame", diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index 15df7c6..a8840e5 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -85,6 +85,7 @@ "SelectSeason": "Выбор сезона", "SettingsDialog": { "AcceptPeerCon": "Принимать входящие соединения", + "AnnTorrentsToDht": "Анонсировать торренты по DHT", "AddRetrackers": "Добавлять", "AdditionalSettings": "Дополнительные настройки", "CacheBeforeReaderDesc": "от кеша будет оставаться позади воспроизводимого кадра",