Skip to content

[wip] File sharing service#168

Draft
markst wants to merge 4 commits intofiso64:masterfrom
markst:feature/file-sharing-service
Draft

[wip] File sharing service#168
markst wants to merge 4 commits intofiso64:masterfrom
markst:feature/file-sharing-service

Conversation

@markst
Copy link
Copy Markdown

@markst markst commented Apr 2, 2026

  • FileShareService.cs — NEW: Contains all core sharing logic (index building, music extension filtering, and the 4 Soulseek delegate implementations: browse, search, directory contents, upload enqueue)

  • SoulseekClientManager.cs — Added SetFileShareService() method, Disconnect() method, and wiring of sharing delegates into SoulseekClientOptions when a FileShareService is set. Login now uses real share counts from the service instead of hardcoded (50, 1000)

  • Config.cs — Added enableSharing and shareFolders fields with --enable-sharing and --share-folders CLI args

GitHub Copilot added 3 commits April 2, 2026 21:52
Indexes local music directories and provides Soulseek delegate
implementations (browse, search, directory contents, upload enqueue)
that can be wired into SoulseekClientManager.
- Add SetFileShareService() to wire sharing delegates into client options
- Add Disconnect() for clean client teardown
- Wire browse, search, directory contents, and upload delegates when
  a FileShareService is registered
- Use real share counts from FileShareService after login instead of
  hardcoded values
Add enableSharing and shareFolders fields with --enable-sharing and
--share-folders CLI arguments.
@markst markst marked this pull request as draft April 2, 2026 10:55
…g-service

# Conflicts:
#	slsk-batchdl/Services/SoulseekClientManager.cs

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps I need to upgrade slsk-batchdl-gui to net10

case "--enable-sharing":
setFlag(ref enableSharing, ref i);
break;
case "--share-folders":
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think needs to be merged with --shared-folders

@fiso64
Copy link
Copy Markdown
Owner

fiso64 commented Apr 2, 2026

Nice, thanks!

Note that I'm currently in the process of a large refactor for sldl (will open a PR soon), so I won't be able to merge until then.

foreach (var file in Directory.EnumerateFiles(localRoot, "*.*", SearchOption.AllDirectories))
{
var ext = Path.GetExtension(file);
if (!MusicExtensions.Contains(ext)) continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can share any type of file on Soulseek, for example coverart.jpg, txt files as well as videos and iso disk images, zips, and so on. Nothing should be excluded from indexing, except hidden .dotfiles and things like desktop.ini, _DSStore, $Recyclebin or whatnot.

var exclusions = query.Exclusions.Select(e => e.ToLowerInvariant()).ToList();

var matches = new List<Soulseek.File>();
foreach (var (slskPath, _) in _pathMap)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider limiting the list to a maximum number of results, otherwise the response payload could be too large if someone searches for example "a" letter that's in the name of parent folder of a massive share then both peers could end up crashing. Most clients only return up to 50 or 100 results by default.

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.

3 participants