diff --git a/fe/src/__tests__/DownloadClientFormModal.spec.ts b/fe/src/__tests__/DownloadClientFormModal.spec.ts index 17beed61d..23320dabd 100644 --- a/fe/src/__tests__/DownloadClientFormModal.spec.ts +++ b/fe/src/__tests__/DownloadClientFormModal.spec.ts @@ -172,4 +172,47 @@ describe('DownloadClientFormModal', () => { expect(calledWith.password).toBe('') expect(calledWith.id).toBe('4') }) + + it('renders URL Base field for qbittorrent and includes it in the test payload when set', async () => { + const api = await import('@/services/api') + ;(api.testDownloadClient as unknown) = vi.fn(async (config: unknown) => ({ + success: true, + message: 'ok', + client: config, + })) + + const wrapper = mount(DownloadClientFormModal, { + global: { plugins: [createPinia()] }, + props: { visible: true, editingClient: null }, + }) + + await wrapper.setProps({ + editingClient: { + id: '5', + name: 'qbt', + type: 'qbittorrent', + host: 'qbittorrent.local', + port: 8080, + isEnabled: true, + useSSL: false, + downloadPath: '', + username: '', + password: '', + settings: {}, + }, + }) + await wrapper.vm.$nextTick() + + const urlBaseInput = wrapper.find('input[id="urlBase"]') + expect(urlBaseInput.exists()).toBe(true) + + await urlBaseInput.setValue('/qbittorrent') + + const testButton = wrapper.find('button.btn-info') + await testButton.trigger('click') + + expect(api.testDownloadClient as unknown).toHaveBeenCalled() + const calledWith = (api.testDownloadClient as unknown).mock.calls[0][0] + expect(calledWith.settings.urlBase).toBe('/qbittorrent') + }) }) diff --git a/fe/src/components/domain/download/DownloadClientFormModal.vue b/fe/src/components/domain/download/DownloadClientFormModal.vue index baa7df91a..8b9d1ffa1 100644 --- a/fe/src/components/domain/download/DownloadClientFormModal.vue +++ b/fe/src/components/domain/download/DownloadClientFormModal.vue @@ -116,15 +116,22 @@ -
/qbittorrent). Must match the prefix your reverse proxy strips before
+ forwarding to qBittorrent's own root-relative API - qBittorrent itself has no
+ built-in base path setting. Leave blank if qBittorrent is reachable directly at the
+ host/port above.
+ RPC path for the Transmission endpoint. Default is /transmission/rpc.
Some seedbox providers use a custom path (e.g. /rpc).
@@ -496,6 +503,14 @@ const getPortHelpText = () => {
return hints[formData.value.type] || 'Port the download client is listening on.'
}
+const showUrlBase = computed(() => {
+ return formData.value.type === 'transmission' || formData.value.type === 'qbittorrent'
+})
+
+const getUrlBasePlaceholder = () => {
+ return formData.value.type === 'qbittorrent' ? '/qbittorrent' : '/transmission/rpc'
+}
+
const getCategoryHelp = () => {
if (isUsenet.value) {
return 'Adding a category specific to Listenarr avoids conflicts with unrelated non-Listenarr downloads. Using a category is optional, but strongly recommended.'
@@ -593,9 +608,7 @@ const testConnection = async () => {
...(formData.value.type === 'sabnzbd' && formData.value.apiKey
? { apiKey: formData.value.apiKey }
: {}),
- ...(formData.value.type === 'transmission' && formData.value.urlBase
- ? { urlBase: formData.value.urlBase }
- : {}),
+ ...(showUrlBase.value && formData.value.urlBase ? { urlBase: formData.value.urlBase } : {}),
...(formData.value.category && { category: formData.value.category }),
...(formData.value.tags && { tags: formData.value.tags }),
recentPriority: formData.value.recentPriority,
@@ -653,9 +666,7 @@ const handleSubmit = async () => {
...(formData.value.type === 'sabnzbd' && formData.value.apiKey
? { apiKey: formData.value.apiKey }
: {}),
- ...(formData.value.type === 'transmission' && formData.value.urlBase
- ? { urlBase: formData.value.urlBase }
- : {}),
+ ...(showUrlBase.value && formData.value.urlBase ? { urlBase: formData.value.urlBase } : {}),
...(formData.value.category && { category: formData.value.category }),
...(formData.value.tags && { tags: formData.value.tags }),
recentPriority: formData.value.recentPriority,
diff --git a/listenarr.infrastructure/DownloadClients/Qbittorrent/QBittorrentHelpers.cs b/listenarr.infrastructure/DownloadClients/Qbittorrent/QBittorrentHelpers.cs
index 2ee964c35..f7410d402 100644
--- a/listenarr.infrastructure/DownloadClients/Qbittorrent/QBittorrentHelpers.cs
+++ b/listenarr.infrastructure/DownloadClients/Qbittorrent/QBittorrentHelpers.cs
@@ -69,5 +69,37 @@ public static void LogCategoryFiltering(ILogger logger, string? category)
logger.LogInformation("Fetching qBittorrent queue filtered by category: {Category}", category);
}
}
+
+ ///