private SpotifySortOptions GenerateOptions() { var options = new SpotifySortOptions { Interval = interval, MaxPlaylistResults = maxPlaylistResults, MaxSongResults = maxSongResults, MaxConcurrentThreads = maxConcurrentThreads }; return(options); }
public SpotifySortWorker(ILogger <SpotifySortWorker> logger, IOptions <SpotifySortOptions> sortOptions, IOptions <SpotifyAuthentication> authOptions, ISpotifySort sorter, IServiceScopeFactory scopeFactory) { this.logger = logger; this.sortOptions = sortOptions.Value; this.authOptions = authOptions.Value; this.sorter = sorter; this.localIp = this.authOptions.CallbackIp; this.semaphore = new SemaphoreSlim(1, 1); this.scopeFactory = scopeFactory; }
public SpotifySorter( ILogger <SpotifySorter> logger, IOptions <SpotifySortOptions> options, IApi api, IServiceScopeFactory scopeFactory, IContextProvider contextProvider) { this.logger = logger; this.options = options.Value; Api = api; this.scopeFactory = scopeFactory; this.contextProvider = contextProvider; RequestSemaphore = new SemaphoreSlim(this.options.MaxConcurrentThreads, this.options.MaxConcurrentThreads); }