Psst stores cached songs twice in two different directories
Describe the bug
I see that psst creates lots of /tmp/.tmpXXXXXX files. Some of them are about 5-20 MiB and identical to some files in ~/.cache/Psst/audio/. Others are about 400 KiB. Probably albums covers cache. That I have not checked
To Reproduce
Use psst under GNU/Linux?
Probably to trigger this bug /tmp and ~/.cache has to be on different volumes.
Expected behavior Cache files should be created in the same directory where they will be eventually stored.
Environment
- OS: Ubuntu Linux 22.04
- Version: 69314f9, built 2024-11-12
Additional context
In my setup /tmp and ~/.cache are actually 2 different Btrfs subvolumes.
In my case these files do not actually consume extra space as it seems they are reflinked. And therefore occupied storage space is not doubled. But for people with different filesystems for /tmp and ~/.cache this issue might lead to effective duplication of consumed cache space.
Also when cache cleanup option will be implemented it might clean just ~/.cache/Psst without removing file copies from /tmp. So it will not free up space.
#536
I recommend running Psst via firejail --private-tmp as workaround for this.