Show live repair progress on requests
This commit is contained in:
@@ -2192,11 +2192,15 @@ async def action_replace_media(
|
||||
else:
|
||||
raise HTTPException(status_code=400, detail="Unknown request type")
|
||||
except HTTPException as exc:
|
||||
detail = f"The media replacement could not be started: {exc.detail}"
|
||||
await asyncio.to_thread(
|
||||
save_action, request_id, "replace_media", "Replace media file", "failed", detail
|
||||
)
|
||||
_record_replacement_activity(
|
||||
linked_issue,
|
||||
user=user,
|
||||
event_type="replacement_failed",
|
||||
message=f"The media replacement could not be started: {exc.detail}",
|
||||
message=detail,
|
||||
)
|
||||
raise
|
||||
except Exception as exc:
|
||||
@@ -2339,16 +2343,33 @@ async def action_search_missing_media(
|
||||
await sonarr.search(collector_id)
|
||||
message = "Sonarr refreshed the series and started a full missing-episode search."
|
||||
except HTTPException as exc:
|
||||
detail = f"The missing-content search could not start: {exc.detail}"
|
||||
await asyncio.to_thread(
|
||||
save_action,
|
||||
request_id,
|
||||
"search_missing",
|
||||
"Search for missing content",
|
||||
"failed",
|
||||
detail,
|
||||
)
|
||||
_record_replacement_activity(
|
||||
linked_issue,
|
||||
user=user,
|
||||
event_type="missing_search_failed",
|
||||
message=f"The missing-content search could not start: {exc.detail}",
|
||||
message=detail,
|
||||
)
|
||||
raise
|
||||
except Exception as exc:
|
||||
logger.exception("missing content search failed request_id=%s", request_id)
|
||||
detail = "Sonarr/Radarr could not start the missing-content search."
|
||||
await asyncio.to_thread(
|
||||
save_action,
|
||||
request_id,
|
||||
"search_missing",
|
||||
"Search for missing content",
|
||||
"failed",
|
||||
detail,
|
||||
)
|
||||
_record_replacement_activity(
|
||||
linked_issue, user=user, event_type="missing_search_failed", message=detail
|
||||
)
|
||||
@@ -2416,16 +2437,33 @@ async def action_repair_subtitles(
|
||||
repaired_count = len(episode_ids)
|
||||
message = f"Bazarr started fresh {language.upper()} subtitle searches for {repaired_count} episode(s)."
|
||||
except HTTPException as exc:
|
||||
detail = f"The subtitle repair could not start: {exc.detail}"
|
||||
await asyncio.to_thread(
|
||||
save_action,
|
||||
request_id,
|
||||
"repair_subtitles",
|
||||
"Repair subtitles",
|
||||
"failed",
|
||||
detail,
|
||||
)
|
||||
_record_replacement_activity(
|
||||
linked_issue,
|
||||
user=user,
|
||||
event_type="subtitle_repair_failed",
|
||||
message=f"The subtitle repair could not start: {exc.detail}",
|
||||
message=detail,
|
||||
)
|
||||
raise
|
||||
except Exception as exc:
|
||||
logger.exception("Bazarr subtitle repair failed request_id=%s", request_id)
|
||||
detail = "Bazarr could not start the subtitle repair."
|
||||
await asyncio.to_thread(
|
||||
save_action,
|
||||
request_id,
|
||||
"repair_subtitles",
|
||||
"Repair subtitles",
|
||||
"failed",
|
||||
detail,
|
||||
)
|
||||
_record_replacement_activity(
|
||||
linked_issue, user=user, event_type="subtitle_repair_failed", message=detail
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user