Conversation
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.
…g-service # Conflicts: # slsk-batchdl/Services/SoulseekClientManager.cs
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> |
There was a problem hiding this comment.
perhaps I need to upgrade slsk-batchdl-gui to net10
| case "--enable-sharing": | ||
| setFlag(ref enableSharing, ref i); | ||
| break; | ||
| case "--share-folders": |
There was a problem hiding this comment.
think needs to be merged with --shared-folders
|
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; |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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 intoSoulseekClientOptionswhen aFileShareServiceis set. Login now uses real share counts from the service instead of hardcoded(50, 1000)Config.cs — Added
enableSharingandshareFoldersfields with--enable-sharingand--share-foldersCLI args