Skip to content

Docs: Fix incorrect file download example in README for remote deployment#236

Merged
beveradb merged 1 commit into
nomadkaraoke:mainfrom
arrrshia:fix-remote-readme
Sep 28, 2025
Merged

Docs: Fix incorrect file download example in README for remote deployment#236
beveradb merged 1 commit into
nomadkaraoke:mainfrom
arrrshia:fix-remote-readme

Conversation

@arrrshia
Copy link
Copy Markdown
Contributor

What was the problem?

The file download example in the README.md for remote deployment was not working as intended. The code iterated over the keys of the status["files"] dictionary (which are file hashes), and incorrectly passed them as filenames to the download_file() function.

This bug caused the script to download empty files that were incorrectly named after their file hashes, instead of downloading the actual stem file content with the correct filename.

How does this PR fix it?

This PR updates the code example to use the correct logic for downloading files:

It now iterates over status["files"].items() to correctly access both the file hash and the filename.

It replaces download_file() method with the correct download_file_by_hash() method.

This change ensures the example code is functional and correctly downloads the stem files as expected.

Code Changes

        for filename in status["files"]:
            output_path = api_client.download_file(task_id, filename)
            print(f"Downloaded: {output_path}")

is now

        for filehash, filename in status["files"].items():
            output_path = api_client.download_file_by_hash(task_id, filehash, filename)
            print(f"Downloaded: {output_path}")

…ing download_file() instead of download_file_by_hash(), which was downloading empty hash files instead of audio stems.
@beveradb
Copy link
Copy Markdown
Collaborator

Cheers, sounds reasonable to me! This modal deployment script was really intended just as an example to get folks started, I don't actually use it myself so apologies for the bug and thanks for fixing 🙇

@beveradb beveradb merged commit 6a76cd7 into nomadkaraoke:main Sep 28, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants