fix: Overwrite(add command) was using snapshots without timestamps (and in memory), causing issues with some extractors

This commit is contained in:
Cristian 2021-01-16 14:11:45 -05:00
parent a36f36866f
commit 30c886d4d4
3 changed files with 3 additions and 1 deletions

View file

@ -597,6 +597,7 @@ def add(urls: Union[str, List[str]],
if update_all:
archive_snapshots(all_snapshots, overwrite=overwrite, **archive_kwargs)
elif overwrite:
imported_snapshots = Snapshot.objects.filter(url__in=[imported_snapshot.url for imported_snapshot in imported_snapshots])
archive_snapshots(imported_snapshots, overwrite=True, **archive_kwargs)
elif new_snapshots:
archive_snapshots(new_snapshots, overwrite=False, **archive_kwargs)