Skip to content

Commit

Permalink
Correct returns in uphelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Dec 19, 2024
1 parent 2c50cf3 commit 2765c0f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/uphelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ def dupe_check(self, dupes, meta):
if not dupes:
console.print("[green]No dupes found")
meta['upload'] = True
return meta
return meta, False
else:
console.print()
dupe_text = "\n".join([d['name'] if isinstance(d, dict) else d for d in dupes])
console.print()
cli_ui.info_section(cli_ui.bold, "Check if these are actually dupes!")
cli_ui.info(dupe_text)

if not meta['unattended'] or (meta['unattended'] and meta.get('unattended-confirm', False)):
if meta.get('dupe', False) is False:
upload = cli_ui.ask_yes_no("Upload Anyways?", default=False)
Expand All @@ -29,17 +30,19 @@ def dupe_check(self, dupes, meta):
else:
console.print("[yellow]Found potential dupes. --skip-dupe-check was passed. Uploading anyways")
upload = True

console.print()
if upload is False:
meta['upload'] = False
return meta, True
else:
meta['upload'] = True
for each in dupes:
each_name = each['name'] if isinstance(each, dict) else each
if each_name == meta['name']:
meta['name'] = f"{meta['name']} DUPE?"

return meta
return meta, False

def get_confirmation(self, meta):
if meta['debug'] is True:
Expand Down

0 comments on commit 2765c0f

Please sign in to comment.