US04-05: Operate Rename Plans in the Browser (#69)
This commit was merged in pull request #69.
This commit is contained in:
@@ -229,6 +229,12 @@ class RenameJournal:
|
||||
classification, reason = _classify(row["journal_state"], source_exists, destination_exists)
|
||||
return {
|
||||
"operation_id": operation_id,
|
||||
"plan_id": row["plan_id"],
|
||||
"album": row["album"],
|
||||
# The paths travel with the verdict so a reviewer can see which folder is
|
||||
# unresolved without correlating an opaque operation id by hand.
|
||||
"source_path": row["source_path"],
|
||||
"destination_path": row["destination_path"],
|
||||
"journal_state": row["journal_state"],
|
||||
"classification": classification,
|
||||
"reason": reason,
|
||||
|
||||
@@ -418,8 +418,17 @@ def _plan_dict(plan: RenamePlan, operations: list[RenameOperation]) -> dict:
|
||||
"asset_count": operation.asset_count,
|
||||
"same_filesystem": operation.same_filesystem,
|
||||
"case_only": operation.case_only,
|
||||
"issues": json.loads(operation.issues or "[]"),
|
||||
# Severity is decided here, not in the browser: a client that has to
|
||||
# keep its own copy of BLOCKING_CODES will eventually disagree with
|
||||
# the validator about whether a plan can run.
|
||||
"issues": [
|
||||
{**issue, "blocking": issue["code"] in BLOCKING_CODES}
|
||||
for issue in json.loads(operation.issues or "[]")
|
||||
],
|
||||
"journal_state": operation.journal_state,
|
||||
"verified_at": operation.verified_at.isoformat() if operation.verified_at else None,
|
||||
"error_code": operation.error_code,
|
||||
"error_message": operation.error_message,
|
||||
}
|
||||
for operation in operations
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user