diff --git a/build/src/qbittorrent/auth.js b/build/src/qbittorrent/auth.js index eaee76e..6ca60f0 100644 --- a/build/src/qbittorrent/auth.js +++ b/build/src/qbittorrent/auth.js @@ -16,6 +16,8 @@ export const loginV2 = async (qbittorrentSettings) => { throw new Error(`Failed to authenticate (UNKNOWN ERROR)`); } const api = new QbittorrentApi(qbittorrentSettings.url, response.headers['set-cookie'][0]); + // Need to get the version so we can choose which endpoints to use + // See: https://github.com/ckcr4lyf/qbit-race/issues/52 const version = await api.getAndSetVersion(); logger.info(`Detected qBitorrent version as: ${version}`); return api; diff --git a/build/src/racing/add.js b/build/src/racing/add.js index d41499f..e76b3cf 100644 --- a/build/src/racing/add.js +++ b/build/src/racing/add.js @@ -13,12 +13,6 @@ import axios from "axios"; export const addTorrentToRace = async (api, settings, path, options, category) => { const logger = getLoggerV3(); logger.debug(`Called with path: ${path}, category: ${category}`); - // Get API version - const version = await api.getAndSetVersion(); - console.log(version); - console.log(version >= 'v5'); - // console.log(version < 'v4'); - // process.exit(-1); // Read the torrent file and get info let torrentFile; try { diff --git a/src/qbittorrent/auth.ts b/src/qbittorrent/auth.ts index 9a77044..f16fd06 100644 --- a/src/qbittorrent/auth.ts +++ b/src/qbittorrent/auth.ts @@ -24,6 +24,9 @@ export const loginV2 = async (qbittorrentSettings: QBITTORRENT_SETTINGS): Promis } const api = new QbittorrentApi(qbittorrentSettings.url, response.headers['set-cookie'][0]); + + // Need to get the version so we can choose which endpoints to use + // See: https://github.com/ckcr4lyf/qbit-race/issues/52 const version = await api.getAndSetVersion(); logger.info(`Detected qBitorrent version as: ${version}`); return api; diff --git a/src/racing/add.ts b/src/racing/add.ts index 2402103..75e5570 100644 --- a/src/racing/add.ts +++ b/src/racing/add.ts @@ -19,13 +19,6 @@ export const addTorrentToRace = async (api: QbittorrentApi, settings: Settings, const logger = getLoggerV3(); logger.debug(`Called with path: ${path}, category: ${category}`); - // Get API version - const version = await api.getAndSetVersion(); - console.log(version); - console.log(version >= 'v5'); - // console.log(version < 'v4'); - // process.exit(-1); - // Read the torrent file and get info let torrentFile: Buffer;