Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Jun 5, 2024 · 7 comments
Milestone

Comments

@blindingblacklight
Copy link

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
Copy link
Member

mathiascode commented Jun 5, 2024

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
Copy link
Member

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
Copy link
Author

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
Copy link
Author

blindingblacklight commented Jun 6, 2024

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
Copy link
Member

slook commented Jun 7, 2024

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:

[
["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", ""]
]

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
Copy link
Author

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
Copy link
Member

slook commented Jun 9, 2024

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.

@slook slook added this to the 3.4.0 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants