Cameron-IPFSPodcasting / podcastnode-Python

Python IPFS Podcast Client for IPFSPodcasting.net
GNU General Public License v3.0
7 stars 4 forks source link

Bug: Free space not calculated correctly when using an alternative IPFS_PATH #10

Closed EricTheMagician closed 1 year ago

EricTheMagician commented 1 year ago

The script assumes that the disk we are writing too is the root disk. Therefore, the amount of free space might be wrong.

There are a lot of possible solutiosn, I didn't want to open a PR without first checking in here.

I think this: https://github.com/Cameron-IPFSPodcasting/podcastnode-Python/blob/4cc364a4a541ea48a04677d78ad32440177ef58b/ipfspodcastnode.py#L148C11-L148C18

should be replaced with something like

ipfs_data_path = os.environ.get("IPFS_PATH", os.environ.get("HOME", "/"))
df = os.statvfs(ipfs_data_path)
Cameron-IPFSPodcasting commented 1 year ago

Looks good. Thanks for the help.

Do you want to submit a PR? Or, I can make the change for you.

EricTheMagician commented 1 year ago

I'll submit a PR later.