Clarify completed repair handoff
This commit is contained in:
@@ -558,6 +558,7 @@ def _build_repair_activity(
|
|||||||
)
|
)
|
||||||
state = "complete" if jellyfin_found else "indexing"
|
state = "complete" if jellyfin_found else "indexing"
|
||||||
download_step_state = "complete"
|
download_step_state = "complete"
|
||||||
|
download_step_detail = f"{collector} reports the replacement file as collected and imported."
|
||||||
available_step_state = "complete" if jellyfin_found else "active"
|
available_step_state = "complete" if jellyfin_found else "active"
|
||||||
elif download_visible and download_state in {"downloading", "paused", "completed", "error", "missing"}:
|
elif download_visible and download_state in {"downloading", "paused", "completed", "error", "missing"}:
|
||||||
state = {
|
state = {
|
||||||
@@ -584,6 +585,9 @@ def _build_repair_activity(
|
|||||||
download_step_state = "active" if download_state == "downloading" else (
|
download_step_state = "active" if download_state == "downloading" else (
|
||||||
"complete" if download_state == "completed" else "attention"
|
"complete" if download_state == "completed" else "attention"
|
||||||
)
|
)
|
||||||
|
download_step_detail = str(
|
||||||
|
download.get("summary") or "Magent found the replacement download in qBittorrent."
|
||||||
|
)
|
||||||
available_step_state = "waiting"
|
available_step_state = "waiting"
|
||||||
else:
|
else:
|
||||||
state = "searching"
|
state = "searching"
|
||||||
@@ -593,6 +597,7 @@ def _build_repair_activity(
|
|||||||
"has been selected yet. Magent will keep checking."
|
"has been selected yet. Magent will keep checking."
|
||||||
)
|
)
|
||||||
download_step_state = "waiting"
|
download_step_state = "waiting"
|
||||||
|
download_step_detail = "Waiting for a suitable release to be selected."
|
||||||
available_step_state = "waiting"
|
available_step_state = "waiting"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -615,11 +620,7 @@ def _build_repair_activity(
|
|||||||
"id": "download",
|
"id": "download",
|
||||||
"label": "Replacement download",
|
"label": "Replacement download",
|
||||||
"state": download_step_state,
|
"state": download_step_state,
|
||||||
"detail": (
|
"detail": download_step_detail,
|
||||||
str(download.get("summary") or "Waiting for a suitable replacement release.")
|
|
||||||
if download_step_state != "waiting"
|
|
||||||
else "Waiting for a suitable release to be selected."
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "available",
|
"id": "available",
|
||||||
|
|||||||
@@ -482,6 +482,10 @@ class RequestPresentationTests(unittest.TestCase):
|
|||||||
self.assertIsNotNone(activity)
|
self.assertIsNotNone(activity)
|
||||||
self.assertEqual(activity["state"], "indexing")
|
self.assertEqual(activity["state"], "indexing")
|
||||||
self.assertEqual(activity["steps"][2]["state"], "complete")
|
self.assertEqual(activity["steps"][2]["state"], "complete")
|
||||||
|
self.assertEqual(
|
||||||
|
activity["steps"][2]["detail"],
|
||||||
|
"Radarr reports the replacement file as collected and imported.",
|
||||||
|
)
|
||||||
self.assertEqual(activity["steps"][3]["state"], "active")
|
self.assertEqual(activity["steps"][3]["state"], "active")
|
||||||
|
|
||||||
def test_torrent_progress_keeps_tenths_for_live_updates(self) -> None:
|
def test_torrent_progress_keeps_tenths_for_live_updates(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user