Download the full revision

This commit is contained in:
Stephan Kulow
2022-11-02 20:55:09 +01:00
parent c2294d6200
commit 1c54a74ecd
2 changed files with 34 additions and 62 deletions

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
import logging
from hashlib import md5
from pathlib import PurePath
from pathlib import Path
from typing import Optional
from lib.db import DB
@@ -232,11 +232,11 @@ class DBRevision:
for entry in self.files_list():
if old_files.get(entry["name"]) != f"{entry['md5']}-{entry['size']}":
logging.debug(f"Download {entry['name']}")
to_download.append((PurePath(entry["name"]), entry["md5"]))
to_download.append((Path(entry["name"]), entry["size"], entry["md5"]))
old_files.pop(entry["name"], None)
for entry in old_files.keys():
logging.debug(f"Delete {entry}")
to_delete.append(PurePath(entry))
to_delete.append(Path(entry))
return to_download, to_delete
@staticmethod