Revert "[verified] feat: add external calendar subscriptions"
This reverts commit 583b6a8a9d.
This commit is contained in:
@@ -152,18 +152,6 @@ def parse_archive_path(path: Path, *, max_archive_bytes: int = MAX_ARCHIVE_BYTES
|
||||
content_names = set(names) - {"manifest.json"}
|
||||
if set(checksums) != content_names:
|
||||
raise backup_error("backup_manifest_mismatch", "manifest 与 ZIP 条目不一致")
|
||||
# Calendar subscriptions are an additive backup-v2 entity. Accept archives
|
||||
# produced by older helpers that checksum the new file but omit its count.
|
||||
optional_entities = {"calendar_subscriptions"}
|
||||
undeclared_optional = {
|
||||
f"data/{name}.json" for name in optional_entities - set(declared_entities)
|
||||
}
|
||||
if set(declared_entities) != {
|
||||
name[5:-5]
|
||||
for name in content_names - undeclared_optional
|
||||
if name.startswith("data/") and name.endswith(".json")
|
||||
}:
|
||||
raise backup_error("backup_manifest_mismatch", "manifest 实体清单不一致")
|
||||
entities: dict[str, list[dict]] = {}
|
||||
files: dict[str, StagedBlob] = {}
|
||||
for index, name in enumerate(sorted(content_names)):
|
||||
@@ -182,11 +170,7 @@ def parse_archive_path(path: Path, *, max_archive_bytes: int = MAX_ARCHIVE_BYTES
|
||||
if not isinstance(checksums[name], str) or actual_digest != checksums[name]:
|
||||
raise backup_error("backup_checksum_mismatch", "备份校验和不匹配")
|
||||
if set(declared_entities) != set(entities):
|
||||
required_declared = set(entities) - optional_entities
|
||||
if set(declared_entities) != required_declared or any(
|
||||
entities.get(name) for name in optional_entities - set(declared_entities)
|
||||
):
|
||||
raise backup_error("backup_manifest_mismatch", "manifest 实体清单不一致")
|
||||
raise backup_error("backup_manifest_mismatch", "manifest 实体清单不一致")
|
||||
if any(type(count) is not int or count < 0 or count != len(entities[name]) for name, count in declared_entities.items()):
|
||||
raise backup_error("backup_manifest_mismatch", "manifest 实体数量不一致")
|
||||
except HTTPException:
|
||||
|
||||
Reference in New Issue
Block a user