persepolisdm / persepolis

Persepolis is a download manager written in Python.
https://persepolisdm.github.io
GNU General Public License v3.0
6.24k stars 650 forks source link

[Feature request] Save the temporary file directly into chosen directory instead of temporary directory #628

Open Livy-Inverse opened 5 years ago

Livy-Inverse commented 5 years ago

Download managers with multi-connection support such as IDM create multi temporary files inside its temporary directory, then merge all parts into the download directory when done. It is necessary because each connection needs a temp file.

According to my observation, Persepolis can save all connection data to a single temporary file, and it saves that file along with a meta data file inside the temporary directory. After the download completes, it moves the file to the chosen download location. If the 2 directories is located on different disks, it shall be slow, and will produce unnecessary writes to the disk where the temp directory resides.

Not to mention that the temp directory is most likely located on the system partition, which is usually an SSD. Writing a lot of things into it is never good.

I suggest that the development team should change the behavior to something like FDM's or uTorrent's: put the temporary file directly into the chosen directory, with a suffix to prevent misuse, for example my-download.iso.pdm then rename it to my-download.iso when completed. The metadata file can still be kept inside Persepolis temp directory and point to the temp file.

Pakrohk commented 5 years ago

The most use of PDM in GNU / Linux PDM Temp : /mnt/home/{username} /.persepolis Users Deta : /mnt/home/{username} /... Usually all users use a partition for the home directory.

Livy-Inverse commented 5 years ago

I use it on Linux only, because Windows version is very broken -- the error "fail to execute PDM scripts" always pops up.

Edit: I've got it, APakrohk. I just switch from Windows to Linux, and forget that Linux users usually mount their data partition directly to /home/. On Windows, users will save important files to anywhere other than C:\

Sure I can change the default download directory to somewhere on my dedicated storage. But I think it would be nice and less complicated if we just put the temporary download file directly where it shall be eventually moved to. I am now thinking of the situation when someone wants to save some file into their portable storage. Just a thought.

Arch-Lover commented 5 years ago

Hi I have almost the same concern as Livy-Inverse has. It would be nice if the temp folder become actual file destination this way there would be much less writes to SSD.(currently if i download a 30GB file it would cost me 60GB of write which is not good for SSD that i use in my laptop) سلام علیرضا مجتبی هستم موج آرچ به نظرم بهتره پرسپولیس یه گزینه برای هاردهای SSD اضافه کنه تا وقتی اون تیک زده شد فایلا رو مستقیم تو پوشه های کمپرس و غیره دانلود کنه اینجوری مقدار نوشتن روی این نوع هاردها که براشون مضرر هم هست کم میشه.

Livy-Inverse commented 5 years ago

I've taken a look at my home directory (currently on my main SSD). It took over 30GiB because of program installation. There is no way I will mount my HDD on /home/ because it shall slow everything down. And I won't save large download files on my SSD either. The best scenario I can think of is to mount a SSD on /home/my-user-name/, and my data HDD partition on /home/my-user-name/Data/. But then, the temporary file location should be changed to /home/my-user-name/Data/.persepolis/.

This is getting complicated and ridiculous.

ademlabs commented 5 years ago

I think it does make sense to have the temporary download location into the same location as the destination already.