Signed-off-by: Ken Swenson <flat@esoteric.moe>
---
src/theme.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/theme.rs b/src/theme.rs
index 5a57c24..f0e013a 100644
--- a/src/theme.rs
+++ b/src/theme.rs
@@ -48,7 +48,11 @@ impl ThemeClient {
.await?;
if let Some(cap) = self.count_re.captures(&page) {
- Ok(Some(cap[1].parse::<u64>().unwrap_or(1)))
+ let count = cap[1].parse::<u64>().unwrap_or(1);
+ match count {
+ 0 => Ok(None),
+ _ => Ok(Some(count)),
+ }
} else {
Ok(None)
}
@@ -96,6 +100,7 @@ impl ThemeClient {
Some(c) => c,
None => return Ok(ComicEmbed::new().theme_fail()),
};
+
let range = rand::distributions::Uniform::new(0, count);
use rand::distributions::Distribution;
--
2.27.0