return ban time on item is banned

This commit is contained in:
yggverse 2025-08-14 00:11:16 +03:00
parent 4f9714e5bb
commit d1d628e878
2 changed files with 4 additions and 4 deletions

View file

@ -20,8 +20,8 @@ impl Ban {
} }
} }
pub fn has(&self, key: &Id20) -> bool { pub fn get(&self, key: &Id20) -> Option<&DateTime<Local>> {
self.index.contains_key(key) self.index.get(key)
} }
pub fn total(&self) -> usize { pub fn total(&self) -> usize {

View file

@ -91,8 +91,8 @@ async fn main() -> Result<()> {
log::debug!("torrent `{h}` exists, skip."); log::debug!("torrent `{h}` exists, skip.");
continue; continue;
} }
if ban.has(&i) { if let Some(t) = ban.get(&i) {
log::debug!("torrent `{h}` is temporary banned, skip for this queue."); log::debug!("torrent `{h}` is banned until {t}, skip for this queue.");
continue; continue;
} }
log::debug!("index `{h}`..."); log::debug!("index `{h}`...");