Docs: Fix incorrect file download example in README for remote deployment#236
Merged
Merged
Conversation
…ing download_file() instead of download_file_by_hash(), which was downloading empty hash files instead of audio stems.
1 task
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 🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
is now