fix: hidden view

pull/156/head
Raphaël Vinot 2021-01-18 13:26:02 +01:00
parent 0a89d2190d
commit f9d8081efa
2 changed files with 4 additions and 4 deletions

View File

@ -30,6 +30,6 @@ class CaptureCache():
# Error without all the keys in __default_cache_keys was fatal.
# if the keys in __default_cache_keys are present, it was an HTTP error
self.error: Optional[str] = cache_entry.get('error')
self.incomplete_redirects: bool = True if cache_entry.get('incomplete_redirects') == 1 else False
self.no_index: bool = True if cache_entry.get('no_index') == 1 else False
self.incomplete_redirects: bool = True if cache_entry.get('incomplete_redirects') in [1, '1'] else False
self.no_index: bool = True if cache_entry.get('no_index') in [1, '1'] else False
self.categories: List[str] = json.loads(cache_entry['categories']) if cache_entry.get('categories') else []

View File

@ -406,6 +406,8 @@ def index_generic(show_hidden: bool=False, category: Optional[str]=None):
for cached in lookyloo.sorted_cache:
if not cached:
continue
if cut_time and cached.timestamp < cut_time:
continue
if category:
if not cached.categories or category not in cached.categories:
continue
@ -415,8 +417,6 @@ def index_generic(show_hidden: bool=False, category: Optional[str]=None):
continue
elif cached.no_index:
continue
if cut_time and cached.timestamp < cut_time:
continue
titles.append((cached.uuid, cached.title, cached.timestamp.isoformat(), cached.url,
cached.redirects, cached.incomplete_redirects))