Skip to content

Report Jackett setup errors in search results - #464

Closed
q5x-v6e-n7z-6x3 wants to merge 3 commits into
qbittorrent:masterfrom
q5x-v6e-n7z-6x3:codex/jackett-setup-errors
Closed

q5x-v6e-n7z-6x3 wants to merge 3 commits into
qbittorrent:masterfrom
q5x-v6e-n7z-6x3:codex/jackett-setup-errors

Conversation

@q5x-v6e-n7z-6x3

@q5x-v6e-n7z-6x3 q5x-v6e-n7z-6x3 commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

Report user-fixable Jackett setup errors through search results and stderr: a missing API key, an unreachable service, or no configured indexers. Check indexers even when thread_count is 1. Raise RuntimeError for malformed XML and Jackett API errors. Update the plugin version to 4.14.

Tests check stderr output without relying on exact wording. Response and search stand-ins are inlined with standard library mocks.

Testing

Comment thread nova3/tests/test_jackett.py Outdated
Comment on lines 1 to 5
from typing import List, Optional, Tuple

import pytest

from ..engines import jackett

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coding style:

Suggested change
from typing import List, Optional, Tuple
import pytest
from ..engines import jackett
import pytest
from ..engines import jackett
from typing import List, Optional, Tuple

Comment thread nova3/tests/test_jackett.py Outdated
Comment thread nova3/tests/test_jackett.py Outdated
Comment thread nova3/tests/test_jackett.py Outdated
Comment thread nova3/tests/test_jackett.py Outdated
Comment thread nova3/tests/test_jackett.py Outdated
Comment thread nova3/engines/jackett.py Outdated
Comment thread nova3/engines/jackett.py Outdated
@q5x-v6e-n7z-6x3
q5x-v6e-n7z-6x3 deleted the codex/jackett-setup-errors branch September 26, 2026 19:52
@q5x-v6e-n7z-6x3
q5x-v6e-n7z-6x3 restored the codex/jackett-setup-errors branch September 26, 2026 20:09
Use standard library mocks to keep response and search stand-ins local to each test while retaining strict type checking. Check stderr without matching fragile message text.

@Chocobo1 Chocobo1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only a few comment left.

@q5x-v6e-n7z-6x3
FYI, you are expected to handle replies yourself (manually) rather than through AI agents.

Comment thread nova3/engines/jackett.py
return response

def handle_error(self, error_msg: str, what: str) -> None:
print(f"Jackett: {error_msg}. Search: {what}", file=sys.stderr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are already passing the error to stdout so don't do this.

@q5x-v6e-n7z-6x3
Clearly you are using AI. Please instruct your AI to follow/address the review comments closely and don't invent new ideas.

Comment on lines +1 to 7
from __future__ import annotations

from unittest.mock import Mock

import pytest

from ..engines import jackett

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, follow the coding style from #464 (comment)

Comment on lines -11 to -12
assert capturedOutput.err == ""
assert len(capturedOutput.out) >= 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this.
Don't touch existing code unless it is broken.

Comment on lines +62 to +63
search_mock = Mock()
monkeypatch.setattr(engine, 'get_response', Mock(return_value='<indexers><indexer id="thepiratebay" /></indexers>'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
search_mock = Mock()
monkeypatch.setattr(engine, 'get_response', Mock(return_value='<indexers><indexer id="thepiratebay" /></indexers>'))
monkeypatch.setattr(engine, 'get_response', Mock(return_value='<indexers><indexer id="thepiratebay" /></indexers>'))
search_mock = Mock()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants