andrade-soulseek-downloader
Version:
Simple, safe Soulseek download library with built-in rate limiting to prevent bans
45 lines • 1.43 kB
TypeScript
import { ITrackRepository, Track } from '../../domain';
/** External Soulseek client interface */
interface SoulseekClient {
search(options: any, callback: any): void;
download(options: any, callback: any): void;
destroy(): void;
}
/**
* Infrastructure adapter for Soulseek network operations.
* Implements ITrackRepository port for hexagonal architecture.
*/
export declare class SoulseekTrackRepository implements ITrackRepository {
private client;
/**
* @param client - Soulseek client instance
*/
constructor(client: SoulseekClient);
/**
* Searches Soulseek network for matching tracks.
* @inheritdoc
*/
search(artist: string, title: string, minBitrate: number, maxBitrate?: number, timeout?: number): Promise<Track[]>;
/**
* Downloads track from Soulseek peer.
* @inheritdoc
*/
download(track: Track, destinationPath: string): Promise<string | null>;
/**
* Checks local filesystem for existing file.
* @inheritdoc
*/
exists(destinationPath: string): Promise<boolean>;
/**
* Maps Soulseek result to domain Track entity.
* @returns Track or null if invalid data
*/
private mapToTrack;
/**
* Calculates similarity score between query and filename.
* @returns Score from 0-1
*/
private calculateMatchScore;
}
export {};
//# sourceMappingURL=soulseek-track-repository.d.ts.map