andrade-soulseek-downloader
Version:
Simple, safe Soulseek download library with built-in rate limiting to prevent bans
44 lines • 1.96 kB
TypeScript
import { ITrackRepository, TrackSelectionService, DownloadRacingService } from '../../domain';
import { ILogger, IRateLimiter } from '../../shared';
import { DownloadTrackRequest, DownloadTrackResponse } from '../dto';
import type { YouTubeDownloader } from '../../infrastructure/services/youtube-downloader';
/**
* Application use case for downloading tracks.
* Orchestrates domain logic with retry strategy and rate limiting.
*/
export declare class DownloadTrackUseCase {
private trackRepository;
private selectionService;
private racingService;
private logger;
private rateLimiter;
private youtubeDownloader;
/**
* @param trackRepository - Repository for track operations
* @param selectionService - Service for track quality selection
* @param racingService - Service for concurrent download racing
* @param logger - Logger for operation tracking
* @param rateLimiter - Rate limiter to prevent bans
* @param youtubeDownloader - YouTube downloader for fallback
*/
constructor(trackRepository: ITrackRepository, selectionService: TrackSelectionService, racingService: DownloadRacingService, logger: ILogger, rateLimiter: IRateLimiter, youtubeDownloader: YouTubeDownloader);
/**
* Executes track download with quality-first strategy.
* @param request - Download parameters
* @returns Download result with file path or error
*/
execute(request: DownloadTrackRequest): Promise<DownloadTrackResponse>;
/** Validates request parameters */
private validateRequest;
/**
* Executes download with racing strategy - concurrent downloads from different users
*/
private executeWithRacing;
/**
* Executes download sequentially - traditional one-by-one approach
*/
private executeSequentially;
/** Builds safe file path from metadata */
private buildDestinationPath;
}
//# sourceMappingURL=download-track-use-case.d.ts.map