-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed Intervals to be at least "1s" by default for "image", "page", and "details". #3221
Conversation
😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but wouldn't it be easier to set the defaults when no values are found in the INI file? This way all sources would get this automatically, without having to remember to set it explicitly in the INI.
i.e. here for actual usage:
imgbrd-grabber/src/lib/src/models/site.cpp
Lines 155 to 161 in 9295754
// Setup throttling | |
m_manager->setMaxConcurrency(setting("download/simultaneous", 10).toInt()); | |
m_manager->setInterval(QueryType::List, setting("download/throttle_page", 0).toInt() * 1000); | |
m_manager->setInterval(QueryType::Img, setting("download/throttle_image", 0).toInt() * 1000); | |
m_manager->setInterval(QueryType::Thumbnail, setting("download/throttle_thumbnail", 0).toInt() * 1000); | |
m_manager->setInterval(QueryType::Details, setting("download/throttle_details", 0).toInt() * 1000); | |
m_manager->setInterval(QueryType::Retry, setting("download/throttle_retry", 60).toInt() * 1000); |
Here for the settings window:
imgbrd-grabber/src/gui/src/sources/sources-settings-window.cpp
Lines 63 to 69 in 9295754
// Download settings | |
ui->spinSimultaneousDownloads->setValue(site->setting("download/simultaneous", 10).toInt()); | |
ui->spinThrottleDetails->setValue(site->setting("download/throttle_details", 0).toInt()); | |
ui->spinThrottleImage->setValue(site->setting("download/throttle_image", 0).toInt()); | |
ui->spinThrottlePage->setValue(site->setting("download/throttle_page", 0).toInt()); | |
ui->spinThrottleRetry->setValue(site->setting("download/throttle_retry", 60).toInt()); | |
ui->spinThrottleThumbnail->setValue(site->setting("download/throttle_thumbnail", 0).toInt()); |
And here on Android settings screen:
imgbrd-grabber/src/gui-qml/src/components/settings/SourceSettingsScreen.qml
Lines 231 to 260 in 9295754
SpinBoxSetting { | |
name: qsTr("Interval (image)") | |
max: 60 * 60 | |
setting: Setting { | |
key: "download/throttle_image" | |
def: 0 | |
obj: root.site.settings | |
} | |
Layout.fillWidth: true | |
} | |
SpinBoxSetting { | |
name: qsTr("Interval (page)") | |
max: 60 * 60 | |
setting: Setting { | |
key: "download/throttle_page" | |
def: 0 | |
obj: root.site.settings | |
} | |
Layout.fillWidth: true | |
} | |
SpinBoxSetting { | |
name: qsTr("Interval (details)") | |
max: 60 * 60 | |
setting: Setting { | |
key: "download/throttle_details" | |
def: 0 | |
obj: root.site.settings | |
} | |
Layout.fillWidth: true | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! 👍
#3220