Skip to content

Commit

Permalink
Round robin proxy selection (#2230)
Browse files Browse the repository at this point in the history
* Round robin proxy selection

* lint
  • Loading branch information
Brainicism authored Sep 24, 2024
1 parent 2219c02 commit eb31663
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helpers/kmq_song_downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "../constants";
import { IPCLogger } from "../logger";
import {
chooseRandom,
extractErrorString,
parseJsonFile,
pathExists,
Expand Down Expand Up @@ -193,10 +192,11 @@ export default class KmqSongDownloader {
// update current list of non-downloaded songs
await this.updateNotDownloaded(db, allSongs);

for (const song of songsToDownload) {
for (let i = 0; i < songsToDownload.length; i++) {
const song = songsToDownload[i]!;
let proxy: string | undefined;
if (KmqConfiguration.Instance.ytdlpDownloadWithProxy()) {
proxy = chooseRandom(this.proxies);
proxy = this.proxies[i % this.proxies.length];
logger.info(
`Downloading song: '${song.songName}' by ${song.artistName} | ${
song.youtubeLink
Expand Down

0 comments on commit eb31663

Please sign in to comment.