def _lock(self, url: str, name: str, hash_: str):
        """
        Add details of the files downloaded to _new_lock so they can be saved to the lock file.
        Also remove path from _stale_files, whatever remains at the end therefore is stale and can be deleted.
        """
        self._new_lock.append({
            'url': url,
            'name': name,
            'hash': hash_,
        })
        self._stale_files.pop(name, None)