1
0
Fork 0
mirror of synced 2024-06-24 00:50:23 +12:00

fix: Invalid file path being generated on add

This commit is contained in:
Cristian 2021-01-11 08:28:41 -05:00
parent 1ce6130202
commit d5cabe05af
2 changed files with 1 additions and 2 deletions

View file

@ -213,7 +213,6 @@ class Snapshot(models.Model):
return self.history['title'][-1].output.strip()
return None
@cached_property
def domain(self) -> str:
from ..util import domain

View file

@ -576,7 +576,7 @@ def add(urls: Union[str, List[str]],
log_crawl_started(new_snapshots)
for new_snapshot in new_snapshots:
# TODO: Check if we need to add domain to the Snapshot model
downloaded_file = save_file_as_source(new_snapshot.url, filename=f'{new_snapshot.timestamp}-crawl-{new_snapshot.url}.txt', out_dir=out_dir)
downloaded_file = save_file_as_source(new_snapshot.url, filename=f'{new_snapshot.timestamp}-crawl-{new_snapshot.domain}.txt', out_dir=out_dir)
new_snapshots_depth += parse_snapshots_from_source(downloaded_file, root_url=new_snapshot.url)
imported_snapshots = [Snapshot(url=snapshot.url) for snapshot in new_snapshots + new_snapshots_depth]