Skip to content

Commit 9a5ec13

Browse files
authored
fix(handlers): revert proxy status on link failed (#124)
1 parent 192b9d6 commit 9a5ec13

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

resolve_proxy_encoder/queuer/handlers.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,20 @@ def handle_offline_proxies(media_list: list) -> list:
348348

349349
if answer.lower().startswith("y"):
350350
pprint(f"[yellow]Queuing '{offline_proxy['file_name']}' for re-render")
351-
[
352-
x["proxy"].update("None")
353-
for x in media_list
354-
if x["file_path"] == offline_proxy["file_path"]
355-
]
351+
352+
for x in media_list:
353+
if x["file_path"] == offline_proxy["file_path"]:
354+
x["proxy"] = "None"
356355

357356
elif answer.lower().startswith("a"):
358357

359358
pprint(
360359
f"[yellow]Queuing {len(offline_proxies)} offline proxies for re-render"
361360
)
362-
[x["proxy"].update("None") for x in media_list if x == "Offline"]
361+
362+
for x in media_list:
363+
if x == "Offline":
364+
x["proxy"] = "None"
363365

364366
global SOME_ACTION_TAKEN
365367
SOME_ACTION_TAKEN = True

resolve_proxy_encoder/queuer/link.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,19 @@ def link_proxies_with_mpi(media_list):
275275
if Confirm.ask(
276276
f"[yellow]{len(link_fail)} proxies failed to link. Would you like to re-render them?"
277277
):
278+
# Remove offline status, redefine media list
279+
for x in media_list:
280+
if x in link_fail:
281+
x["proxy"] = "None"
278282

279-
media_list = [
280-
x for x in media_list if x not in link_success or x not in link_fail
281-
]
283+
media_list = [x for x in media_list if x not in link_success]
282284

283-
media_list = [x for x in media_list if x not in link_success]
285+
else:
286+
287+
# Queue only those that remain
288+
media_list = [
289+
x for x in media_list if x not in link_success or x not in link_fail
290+
]
284291

285292
logger.debug(f"[magenta]Remaining unlinked media: {media_list}")
286293
return media_list

0 commit comments

Comments
 (0)