Skip to content

Commit

Permalink
Add support to filter torrents/info by private flag
Browse files Browse the repository at this point in the history
- Add `str` to type hints alongside `Iterable[str]`
- Use `always_use_bars_union=True` to remove `Union[]` in docs
  • Loading branch information
rmartin16 committed Jun 17, 2024
1 parent 527eee7 commit 21fbf1f
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 107 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Change Log
==========
### v2024.x.64 (dd mmm 2024)
- Added support for ``private`` argument for ``torrents/info`` (#464)

### v2024.5.63 (31 may 2024)
- Added support to configure ``HTTPAdapter`` (#459)

Expand Down
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
]

autodoc_type_aliases = {"JsonValueT": "qbittorrentapi.definitions.JsonValueT"}
always_use_bars_union = True
add_module_names = False
autodoc_typehints_format = "short"
python_use_unqualified_type_names = True
Expand Down
16 changes: 8 additions & 8 deletions src/qbittorrentapi/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def search(self) -> Search:
def search_start(
self,
pattern: str | None = None,
plugins: Iterable[str] | None = None,
plugins: str | Iterable[str] | None = None,
category: str | None = None,
**kwargs: APIKwargsT,
) -> SearchJobDictionary:
Expand Down Expand Up @@ -262,7 +262,7 @@ def search_plugins(self, **kwargs: APIKwargsT) -> SearchPluginsList:

def search_install_plugin(
self,
sources: Iterable[str] | None = None,
sources: str | Iterable[str] | None = None,
**kwargs: APIKwargsT,
) -> None:
"""
Expand All @@ -285,7 +285,7 @@ def search_install_plugin(

def search_uninstall_plugin(
self,
names: Iterable[str] | None = None,
names: str | Iterable[str] | None = None,
**kwargs: APIKwargsT,
) -> None:
"""
Expand All @@ -308,7 +308,7 @@ def search_uninstall_plugin(

def search_enable_plugin(
self,
plugins: Iterable[str] | None = None,
plugins: str | Iterable[str] | None = None,
enable: bool | None = None,
**kwargs: APIKwargsT,
) -> None:
Expand Down Expand Up @@ -438,7 +438,7 @@ class Search(ClientCache[SearchAPIMixIn]):
def start(
self,
pattern: str | None = None,
plugins: Iterable[str] | None = None,
plugins: str | Iterable[str] | None = None,
category: str | None = None,
**kwargs: APIKwargsT,
) -> SearchJobDictionary:
Expand Down Expand Up @@ -504,7 +504,7 @@ def plugins(self) -> SearchPluginsList:
@wraps(SearchAPIMixIn.search_install_plugin)
def install_plugin(
self,
sources: Iterable[str] | None = None,
sources: str | Iterable[str] | None = None,
**kwargs: APIKwargsT,
) -> None:
return self._client.search_install_plugin(sources=sources, **kwargs)
Expand All @@ -514,7 +514,7 @@ def install_plugin(
@wraps(SearchAPIMixIn.search_uninstall_plugin)
def uninstall_plugin(
self,
sources: Iterable[str] | None = None,
sources: str | Iterable[str] | None = None,
**kwargs: APIKwargsT,
) -> None:
return self._client.search_uninstall_plugin(sources=sources, **kwargs)
Expand All @@ -524,7 +524,7 @@ def uninstall_plugin(
@wraps(SearchAPIMixIn.search_enable_plugin)
def enable_plugin(
self,
plugins: Iterable[str] | None = None,
plugins: str | Iterable[str] | None = None,
enable: bool | None = None,
**kwargs: APIKwargsT,
) -> None:
Expand Down
Loading

0 comments on commit 21fbf1f

Please sign in to comment.