Fix up some code after aplanas' continued review

This commit is contained in:
Stephan Kulow
2022-11-02 15:14:38 +01:00
parent 6ac0f90ec7
commit 172242891d
6 changed files with 21 additions and 22 deletions

View File

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