From a85c84a7fe4f557f22781bf64271733d33278da2 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 17 Aug 2020 14:36:49 +0200 Subject: add a minimum_duration setting --- src/config.rs | 3 +++ src/main.rs | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/config.rs b/src/config.rs index 805a2c3..47d6de7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,6 +11,9 @@ pub struct Config { /// Flag indicating whether logs with an unknown boss should be uploaded. #[serde(default)] pub upload_unknown: bool, + /// Minimum log duration in milliseconds for uploads. + #[serde(default)] + pub minimum_duration: u64, /// How often the upload to dps.report should be retried. #[serde(default)] pub retries: u32, diff --git a/src/main.rs b/src/main.rs index d5cee18..4052d59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -201,6 +201,10 @@ fn should_upload(config: &Config, log: &Log) -> bool { if log.encounter() == Some(Boss::Skorvald) && !log.is_cm() { return false; } + // Only upload logs that are long enough + if log.span() < config.minimum_duration { + return false; + } true } -- cgit v1.2.3