Skip to content

fix(handlers): revert proxy status on link failed #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions resolve_proxy_encoder/queuer/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,20 @@ def handle_offline_proxies(media_list: list) -> list:

if answer.lower().startswith("y"):
pprint(f"[yellow]Queuing '{offline_proxy['file_name']}' for re-render")
[
x["proxy"].update("None")
for x in media_list
if x["file_path"] == offline_proxy["file_path"]
]

for x in media_list:
if x["file_path"] == offline_proxy["file_path"]:
x["proxy"] = "None"

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

pprint(
f"[yellow]Queuing {len(offline_proxies)} offline proxies for re-render"
)
[x["proxy"].update("None") for x in media_list if x == "Offline"]

for x in media_list:
if x == "Offline":
x["proxy"] = "None"

global SOME_ACTION_TAKEN
SOME_ACTION_TAKEN = True
Expand Down
15 changes: 11 additions & 4 deletions resolve_proxy_encoder/queuer/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,19 @@ def link_proxies_with_mpi(media_list):
if Confirm.ask(
f"[yellow]{len(link_fail)} proxies failed to link. Would you like to re-render them?"
):
# Remove offline status, redefine media list
for x in media_list:
if x in link_fail:
x["proxy"] = "None"

media_list = [
x for x in media_list if x not in link_success or x not in link_fail
]
media_list = [x for x in media_list if x not in link_success]

media_list = [x for x in media_list if x not in link_success]
else:

# Queue only those that remain
media_list = [
x for x in media_list if x not in link_success or x not in link_fail
]

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