nicotine-plus / nicotine-plus

Graphical client for the Soulseek peer-to-peer network
https://nicotine-plus.org
GNU General Public License v3.0
1.68k stars 134 forks source link

set final destination folder upon completion of download, instead of when download is requested - or - allow user to change to download folder for existing/pending downloads #3026

Open blindingblacklight opened 3 months ago

blindingblacklight commented 3 months ago

Describe the solution you'd like

Either:

  1. Set final destination folder for songs to the download folder upon completion of download, instead of when download is requested. - or -
  2. Implement a way to change the download folder per song/folder/user in the Downloads tab.

Ideally both, but if I had to choose one, it would be the first one because then if I change the download location in Settings, I won't have to manually change the download destinations in all the previously initiated downloads.

Additional context

Reason for request: The drive of my original download folder no longer had space for downloads, so I changed the download folder to a larger drive (and took the original external drive offline). However, downloads that were started before the change are still set to go to the old download location, and the destination path cannot be changed. So now, if a song with the old download destination completes, it just stays in the incomplete folder (on my internal drive). I can change the name and manually move it to the intended destination, or remove and re-download the affected songs, but either choice is far from ideal.

mathiascode commented 3 months ago

I'm leaning towards the second option. I don't think this is something you would have to do often, and you risk silently splitting folder downloads into multiple locations if you set the final path later.

I don't know what the ideal design for changing the download path would be, but it should be possible to change download paths in bulk without too much effort.

mathiascode commented 3 months ago

As a temporary measure, you should be able to open the downloads.json file in a text editor and change the paths there (do it while the program is closed).

blindingblacklight commented 3 months ago

As a temporary measure, you should be able to open the downloads.json file in a text editor and change the paths there (do it while the program is closed).

Thanks for the workaround!

blindingblacklight commented 3 months ago

Oops, I thanked you before I actually edited the file... which I can't seem to find. Where is downloads.json located? I thought it would be in ~/.config/Nicotine/, but it was not.

When I did a search of my hard drive, only download.json file I found was in ~/Music/Nicotine/lib/pynicotine/tests/unit/transfers, where ~/Music/Nicotine/ is set as my downloads folder, and all that file contained was this:

[
    ["user1", "Downloaded\\Song1.mp3", "", "Paused", 10093741, 5000, {"0": 320, "1": 252}],
    ["user2", "Downloaded\\Song2.mp3", "", "User logged off", 10734496, null, {"0": 319, "1": 268}],
    ["user3", "Downloaded\\Song3.flac", "", "User logged off", 27231044, null, {"0": 792, "1": 268}],
    ["user4", "Downloaded\\Song4.mp3", "", "User logged off", 9456698, null, {"0": 128, "1": 0}],
    ["user5", "Downloaded\\Song5.mp3", "", "User logged off", 11733776, null, {"0": 319, "1": 293}],
    ["user6", "Downloaded\\Song6.mp3", "", "User logged off", 7868544, null, {"0": 160, "1": 393}],
    ["user7", "Downloaded\\Song7.mp3", "", "User logged off", 18070994, null, {"0": 320, "1": 451}],
    ["user8", "Downloaded\\Song8.mp3", "", "User logged off", 11412838, null, {"0": 319, "1": 285}],
    ["user9", "Downloaded\\Song9.mp3", "", "User logged off", 278806, null, {}],
    ["user10", "Downloaded\\Song10.mp3", "", "User logged off", 10734496, null, {"0": 319, "1": 268}],
    ["user11", "Downloaded\\Song11.mp3", "", "User logged off", 14411885, null, {"0": 319, "1": 360}],
    ["user12", "Downloaded\\Song12.mp3", "", "User logged off", 5085884, null, {"0": 320, "1": 127}],
    ["user13", "Downloaded\\Song13.mp3", "", "Finished", 43443, 43443, "", ""],
    ["user14", "Downloaded\\Song14.mp3", "", "User logged off", 3745634, null, "238 (vbr)", "2:53"],
    ["user15", "Downloaded\\Song15.mp3", "", "User logged off", 9456698, null, "128", "4:50"],
    ["user16", "Downloaded\\Song16.mp3", "", "User logged off", 232137, null, "{\"0\": 256, \"1\": 476}", ""],
    ["user17", "Downloaded\\Song17.mp3", ""]
]

However, I have dozens (if not hundreds) of files that are waiting to be downloaded.

Also, "user1" through "user17" and "song1" through "song17" were what was literally in the file (i.e., I did not substitute those names to mask actual user and song names).

slook commented 3 months ago

Where is downloads.json located?

Your user data is located in somewhere like ~/.local/share/nicotine/ (the exact path varies depending on your platform).

.../lib/pynicotine/tests/unit/transfers

What you have found there is dummy data that's used for the CI tests (Continuous Integrations) that are used by developers during build-time for verifying the program works properly. It's a part of the source code package in the repo: https://github.com/nicotine-plus/nicotine-plus/blob/e7c7377d2707b69df64ff4b8e0fc35f352255c46/pynicotine/tests/unit/transfers/downloads.json#L1-L19

There is no good reason why the Nicotine+ source code files are saved in your shares, you must have copied it in there yourself by mistake. The source code is not needed for run-time (unless you want to run from source, of course), so it can be deleted.

blindingblacklight commented 3 months ago

Your user data is located in somewhere like ~/.local/share/nicotine/

D'oh! I thought I had looked in there, thanks.

There is no good reason why the Nicotine+ source code files are saved in your shares, you must have copied it in there yourself by mistake.

Yeah, I was experimenting with installing it on a Windows VM, and I can't imagine how or why I would have copied that folder in there, but I have deleted it now.

slook commented 3 months ago

I can't imagine how or why I would have copied that folder in there

It's likely because you chose your Music shares folder to be easily accessible from your VM, so it would have made sense to put things in there during installation.

That is a somewhat related reason as to why I am in support of your feature request, because migrating N+ onto another machine almost always results in different paths being needed, and it is annoying that the Incomplete items break in such cases.