From 632b7048fe695f2df0b5b9c2c73630ff6190022f Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 7 Jan 2024 19:10:04 +0100 Subject: [PATCH] fix: parsing sitename info from 3.xx Servers (#6438) --- qt/VariantHelpers.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qt/VariantHelpers.cc b/qt/VariantHelpers.cc index 11fb26732..928060eb5 100644 --- a/qt/VariantHelpers.cc +++ b/qt/VariantHelpers.cc @@ -178,8 +178,14 @@ bool change(TrackerStat& setme, tr_variant const* value) changed = true; } - if (site_changed && !setme.sitename.isEmpty() && !setme.announce.isEmpty() && trApp != nullptr) + if (site_changed && !setme.announce.isEmpty() && trApp != nullptr) { + if (setme.sitename.isEmpty()) + { + QStringList const separated_host = QUrl{ setme.announce }.host().split(QStringLiteral(".")); + setme.sitename = separated_host.at(separated_host.size() - 2); + } + setme.announce = trApp->intern(setme.announce); trApp->load_favicon(setme.announce); }