From 8e98cef7adcc78465d5ca6754b126de362ea1a3a Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Mon, 15 Feb 2021 20:48:51 -0500 Subject: [PATCH] fix after and before args flipped when filtering --- archivebox/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/archivebox/main.py b/archivebox/main.py index 169921fd..afcaaeff 100644 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -818,11 +818,15 @@ def list_links(snapshots: Optional[QuerySet]=None, all_snapshots = load_main_index(out_dir=out_dir) if after is not None: - all_snapshots = all_snapshots.filter(timestamp__lt=after) + all_snapshots = all_snapshots.filter(timestamp__gte=after) if before is not None: - all_snapshots = all_snapshots.filter(timestamp__gt=before) + all_snapshots = all_snapshots.filter(timestamp__lt=before) if filter_patterns: all_snapshots = snapshot_filter(all_snapshots, filter_patterns, filter_type) + + if not all_snapshots: + stderr('[!] No Snapshots matched your filters:', filter_patterns, f'({filter_type})', color='lightyellow') + return all_snapshots @enforce_types