use persistent names for data directory#98
Merged
johang merged 1 commit intojohang:masterfrom Jun 19, 2025
Merged
Conversation
032b634 to
3100445
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates directory handling to use the torrent’s v1 info-hash as a stable identifier and ensures metadata’s info_hashes is populated before use.
- Modified
populate_targetto take a directorynameand removedmkdtempin favor of a deterministic subfolder. - Ensured
p.info_hashesis explicitly set after loading metadata. - Refactored
mainto compute the v1 hash string, callpopulate_target, and set upp.save_pathaccordingly.
Comments suppressed due to low confidence (1)
src/btfs.cc:876
- The magnet-URI branch relies on
parse_magnet_urito populateinfo_hashes. Verify thatinfo_hashes.v1is always valid (or explicitly assign it) before using it for directory naming.
p.info_hashes = p.ti->info_hashes();
Owner
|
Sorry, just trying out some Github features... |
d5dd48f to
f9f74d3
Compare
f9f74d3 to
e27f941
Compare
Owner
|
Thanks for the patch! |
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.
fixes #74 by using the v1 info hash of the torrent as a stable and unique identifier of the torrent.