mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Add piece_extent_affinity to AdvancedSettings
Expose option in WebUI settings and WebAPI. Requires WebAPI version bump. Closes #11436.
This commit is contained in:
parent
e906478a16
commit
ed96a07a75
6 changed files with 49 additions and 1 deletions
|
@ -383,6 +383,7 @@ Session::Session(QObject *parent)
|
|||
#else
|
||||
, m_coalesceReadWriteEnabled(BITTORRENT_SESSION_KEY("CoalesceReadWrite"), false)
|
||||
#endif
|
||||
, m_usePieceExtentAffinity(BITTORRENT_SESSION_KEY("PieceExtentAffinity"), false)
|
||||
, m_isSuggestMode(BITTORRENT_SESSION_KEY("SuggestMode"), false)
|
||||
, m_sendBufferWatermark(BITTORRENT_SESSION_KEY("SendBufferWatermark"), 500)
|
||||
, m_sendBufferLowWatermark(BITTORRENT_SESSION_KEY("SendBufferLowWatermark"), 10)
|
||||
|
@ -1323,6 +1324,10 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack)
|
|||
settingsPack.set_bool(lt::settings_pack::coalesce_reads, isCoalesceReadWriteEnabled());
|
||||
settingsPack.set_bool(lt::settings_pack::coalesce_writes, isCoalesceReadWriteEnabled());
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM >= 10202)
|
||||
settingsPack.set_bool(lt::settings_pack::piece_extent_affinity, usePieceExtentAffinity());
|
||||
#endif
|
||||
|
||||
settingsPack.set_int(lt::settings_pack::suggest_mode, isSuggestModeEnabled()
|
||||
? lt::settings_pack::suggest_read_cache : lt::settings_pack::no_piece_suggestions);
|
||||
|
||||
|
@ -3248,6 +3253,19 @@ bool Session::isSuggestModeEnabled() const
|
|||
return m_isSuggestMode;
|
||||
}
|
||||
|
||||
bool Session::usePieceExtentAffinity() const
|
||||
{
|
||||
return m_usePieceExtentAffinity;
|
||||
}
|
||||
|
||||
void Session::setPieceExtentAffinity(const bool enabled)
|
||||
{
|
||||
if (enabled == m_usePieceExtentAffinity) return;
|
||||
|
||||
m_usePieceExtentAffinity = enabled;
|
||||
configureDeferred();
|
||||
}
|
||||
|
||||
void Session::setSuggestMode(const bool mode)
|
||||
{
|
||||
if (mode == m_isSuggestMode) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue