Skip to content

Implement custom download directory management and path mirroring - #1718

Open
Okashichan wants to merge 12 commits into
slskd:masterfrom
Okashichan:master
Open

Implement custom download directory management and path mirroring#1718
Okashichan wants to merge 12 commits into
slskd:masterfrom
Okashichan:master

Conversation

@Okashichan

Copy link
Copy Markdown

Overview

This PR implements a comprehensive suite of features for managing download directory structures, as discussed in Issue #1584. It addresses several long-standing requests regarding path mirroring, username isolation, and custom destination routing.

Key Changes

  • New Path Formats: Added root, subfolder (default), and mirror formats for both completed and incomplete downloads: download_directory_format, incomplete_directory_format.
  • Directory Stripping: Added a download_strip_leading_directories option to prune unwanted segments from mirrored paths.
  • Username Isolation: Added an include_username_in_download_path option to prefix download paths with the remote user's username.
  • Custom Destinations: Added the ability to specify a destination subfolder for individual download requests directly from the Browse and Search views.
  • File Management: Added an overwrite_existing_files option to overwrite existing files in the downloads directory instead of appending numeric suffixes.
  • Database: Added a migration to persist the custom destination directory for transfers.

Linked Issues

Closes #1584
Relates to #1499, #1362, #1202, #704, #405, #401

AI Disclosure

  • AI Tool(s) used: Antigravity.
  • How they were used: Used for generating the backend path logic in C#, creating the migration script, developing the React UI components for the "Destination Subfolder" input, and documentation help.
  • Parts that were AI-assisted:
    • Backend logic in DownloadService.cs and CommonExtensions.cs.
    • Frontend changes in Directory.jsx and Response.jsx.
    • Database migration in src/slskd/Core/Data/Migrations/.

I have fully reviewed all code produced and take responsibility for its quality and adherence to the project's standards. BUT this code must be reviewed very carefully by maintainers, as I am not a C# developer myself. It resolves some issues that I found really annoying, and, as far as I could test, it works for me.

Nevertheless, you have the right to reject it completely, since it was mostly written with the help of AI.

@jpdillingham

Copy link
Copy Markdown
Member

Thanks for the PR. I appreciate the effort, but merging would conflict with a different solution I'll be adding shortly.

@Okashichan

Copy link
Copy Markdown
Author

Either way, I'm just glad it will be resolved. Thank you for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option(s) to allow control over how downloaded files are placed on disk

2 participants