Skip to content

Commit

Permalink
Remove "Download speed boost"
Browse files Browse the repository at this point in the history
  • Loading branch information
c0re100 committed Jan 3, 2025
1 parent 5b6a689 commit 4b52e9a
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 128 deletions.
1 change: 0 additions & 1 deletion Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6102,7 +6102,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_settings_enhanced" = "Enhanced Settings";
"lng_settings_network" = "Network";
"lng_settings_net_upload_speed_boost" = "Upload speed boost";
"lng_settings_net_download_speed_boost" = "Download speed boost";
"lng_settings_show_message_id" = "Show message ID";
"lng_settings_button" = "Button";
"lng_settings_show_emoji_button_as_text" = "Show emoji button as text";
Expand Down
1 change: 0 additions & 1 deletion Telegram/Resources/langs/localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"lng_settings_enhanced": "Enhanced Settings",
"lng_settings_network": "Network",
"lng_settings_net_upload_speed_boost": "Upload speed boost",
"lng_settings_net_download_speed_boost": "Download speed boost",
"lng_settings_show_message_id": "Show message ID",
"lng_settings_button": "Button",
"lng_settings_show_emoji_button_as_text": "Show emoji button as text",
Expand Down
10 changes: 0 additions & 10 deletions Telegram/SourceFiles/core/enhanced_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,6 @@ namespace EnhancedSettings {
}
});

ReadBoolOption(settings, "net_dl_speed_boost", [&](auto v) {
if (v) {
SetNetworkDLBoost(true);
} else {
SetNetworkDLBoost(false);
}
});

ReadOption(settings, "bitrate", [&](auto v) {
if (v.isDouble()) {
int value = v.toInt();
Expand Down Expand Up @@ -297,7 +289,6 @@ namespace EnhancedSettings {

auto settings = QJsonObject();
settings.insert(qsl("net_speed_boost"), 0);
settings.insert(qsl("net_dl_speed_boost"), false);
settings.insert(qsl("show_messages_id"), false);
settings.insert(qsl("show_repeater_option"), false);
settings.insert(qsl("show_emoji_button_as_text"), false);
Expand Down Expand Up @@ -351,7 +342,6 @@ namespace EnhancedSettings {

auto settings = QJsonObject();
settings.insert(qsl("net_speed_boost"), GetEnhancedInt("net_speed_boost"));
settings.insert(qsl("net_dl_speed_boost"), GetEnhancedBool("net_dl_speed_boost"));
settings.insert(qsl("show_messages_id"), GetEnhancedBool("show_messages_id"));
settings.insert(qsl("show_repeater_option"), GetEnhancedBool("show_repeater_option"));
settings.insert(qsl("show_emoji_button_as_text"), GetEnhancedBool("show_emoji_button_as_text"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Clip {
namespace {

constexpr auto kHeaderSize = 8;
constexpr auto kFindMoovBefore = 1024 * 1024;
constexpr auto kFindMoovBefore = 128 * 1024;

template <typename Type>
Type ReadBigEndian(bytes::const_span data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Streaming {

bool LoadedPart::valid(int64 size) const {
return (offset != kFailedOffset)
&& ((bytes.size() == cNetDownloadChunkSize())
&& ((bytes.size() == Loader::kPartSize)
|| (offset + bytes.size() == size));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct LoadedPart {

class Loader {
public:
static constexpr auto kPartSize = int64(1024 * 1024);
static constexpr auto kPartSize = int64(128 * 1024);

[[nodiscard]] virtual Storage::Cache::Key baseCacheKey() const = 0;
[[nodiscard]] virtual int64 size() const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ void LoaderLocal::load(int64 offset) {
fail();
return;
}
auto result = _device->read(cNetDownloadChunkSize());
auto result = _device->read(kPartSize);
if (result.isEmpty()
|| ((result.size() != cNetDownloadChunkSize())
|| ((result.size() != kPartSize)
&& (offset + result.size() != size()))) {
fail();
return;
Expand Down
Loading

0 comments on commit 4b52e9a

Please sign in to comment.