Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for torrentcreator endpoints #424

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ jobs:
name: html-coverage-report
path: ./htmlcov

#- name: Upload Coverage to Codecov
# if: contains(fromJson('["push", "pull_request"]'), github.event_name)
# uses: codecov/[email protected]
# with:
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Coverage to Codecov
if: contains(fromJson('["push", "pull_request"]'), github.event_name)
uses: codecov/[email protected]
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

install-dev:
#######
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div align="center">

qBittorrent Web API Client
================================
==========================

Python client implementation for qBittorrent Web API

[![GitHub Workflow Status (branch)](https://img.shields.io/github/checks-status/rmartin16/qbittorrent-api/main?style=flat-square)](https://github.com/rmartin16/qbittorrent-api/actions?query=branch%3Amain) [![Codecov branch](https://img.shields.io/codecov/c/gh/rmartin16/qbittorrent-api/main?style=flat-square)](https://app.codecov.io/gh/rmartin16/qbittorrent-api) [![Coverity Scan](https://img.shields.io/coverity/scan/21227?style=flat-square)](https://scan.coverity.com/projects/rmartin16-qbittorrent-api) [![Codacy grade](https://img.shields.io/codacy/grade/ef2975376e834af1910632cb76d05832?style=flat-square)](https://app.codacy.com/gh/rmartin16/qbittorrent-api/dashboard) [![PyPI](https://img.shields.io/pypi/v/qbittorrent-api?style=flat-square)](https://pypi.org/project/qbittorrent-api/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qbittorrent-api?style=flat-square)](https://pypi.org/project/qbittorrent-api/)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/checks-status/rmartin16/qbittorrent-api/main?style=flat-square)](https://github.com/rmartin16/qbittorrent-api/actions?query=branch%3Amain) [![Codecov branch](https://img.shields.io/codecov/c/gh/rmartin16/qbittorrent-api/main?style=flat-square)](https://app.codecov.io/gh/rmartin16/qbittorrent-api) [![PyPI](https://img.shields.io/pypi/v/qbittorrent-api?style=flat-square)](https://pypi.org/project/qbittorrent-api/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qbittorrent-api?style=flat-square)](https://pypi.org/project/qbittorrent-api/)

</div>

Expand Down
34 changes: 34 additions & 0 deletions docs/source/apidoc/torrentcreator.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Torrent Creator
================================

.. autoclass:: qbittorrentapi.torrentcreator.TorrentCreatorAPIMixIn
:members:
:undoc-members:
:exclude-members: torrentcreator, torrentcreator_addTask, torrentcreator_torrentFile, torrentcreator_deleteTask
:show-inheritance:

.. autoclass:: qbittorrentapi.torrentcreator.TorrentCreator
:members:
:undoc-members:
:exclude-members: addTask, torrentFile, deleteTask

.. autoclass:: qbittorrentapi.torrentcreator.TorrentCreatorTaskDictionary
:members:
:undoc-members:
:show-inheritance:
:exclude-members: torrentFile, deleteTask

.. autoclass:: qbittorrentapi.torrentcreator.TorrentCreatorTaskStatus
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: qbittorrentapi.torrentcreator.TaskStatus
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: qbittorrentapi.torrentcreator.TorrentCreatorTaskStatusList
:members:
:undoc-members:
:show-inheritance:
6 changes: 1 addition & 5 deletions docs/source/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ Introduction
:target: https://github.com/rmartin16/qbittorrent-api/actions?query=branch%3Amain
.. |codecov| image:: https://img.shields.io/codecov/c/gh/rmartin16/qbittorrent-api/main?style=flat-square
:target: https://app.codecov.io/gh/rmartin16/qbittorrent-api
.. |coverity| image:: https://img.shields.io/coverity/scan/21227?style=flat-square
:target: https://scan.coverity.com/projects/rmartin16-qbittorrent-api
.. |codacy| image:: https://img.shields.io/codacy/grade/ef2975376e834af1910632cb76d05832?style=flat-square
:target: https://app.codacy.com/gh/rmartin16/qbittorrent-api/dashboard

.. |pypi| image:: https://img.shields.io/pypi/v/qbittorrent-api?style=flat-square
:target: https://pypi.org/project/qbittorrent-api/
Expand All @@ -17,7 +13,7 @@ Introduction
.. |pypi downloads| image:: https://img.shields.io/pypi/dw/qbittorrent-api?color=blue&style=flat-square
:target: https://pypi.org/project/qbittorrent-api/

|github ci| |codecov| |coverity| |codacy|
|github ci| |codecov|

|pypi| |pypi versions| |pypi downloads|

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ dev = [
"pre-commit ==3.6.0 ; python_version >= '3.9'",
"pytest ==8.0.0",
"sphinx ==7.2.6; python_version >= '3.9'",
"sphinx-autobuild ==2024.2.4 ; python_version >= '3.9'",
"sphinx-copybutton ==0.5.2",
"sphinxcontrib-spelling ==8.0.0",
"sphinx-autodoc-typehints ==1.25.3",
Expand Down
14 changes: 14 additions & 0 deletions src/qbittorrentapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
SyncMainDataDictionary,
SyncTorrentPeersDictionary,
)
from qbittorrentapi.torrentcreator import (
TaskStatus,
TorrentCreator,
TorrentCreatorAPIMixIn,
TorrentCreatorTaskDictionary,
TorrentCreatorTaskStatus,
TorrentCreatorTaskStatusList,
)
from qbittorrentapi.torrents import (
Tag,
TagList,
Expand Down Expand Up @@ -137,6 +145,12 @@
"SyncTorrentPeersDictionary",
"Tag",
"TagList",
"TaskStatus",
"TorrentCreator",
"TorrentCreatorAPIMixIn",
"TorrentCreatorTaskDictionary",
"TorrentCreatorTaskStatus",
"TorrentCreatorTaskStatusList",
"TorrentCategoriesDictionary",
"TorrentDictionary",
"TorrentFile",
Expand Down
2 changes: 2 additions & 0 deletions src/qbittorrentapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from qbittorrentapi.rss import RSSAPIMixIn
from qbittorrentapi.search import SearchAPIMixIn
from qbittorrentapi.sync import SyncAPIMixIn
from qbittorrentapi.torrentcreator import TorrentCreatorAPIMixIn
from qbittorrentapi.torrents import TorrentsAPIMixIn
from qbittorrentapi.transfer import TransferAPIMixIn

Expand Down Expand Up @@ -49,6 +50,7 @@ class Client(
SyncAPIMixIn,
TransferAPIMixIn,
TorrentsAPIMixIn,
TorrentCreatorAPIMixIn,
RSSAPIMixIn,
SearchAPIMixIn,
):
Expand Down
1 change: 1 addition & 0 deletions src/qbittorrentapi/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class APINames(str, Enum):
Sync = "sync"
Transfer = "transfer"
Torrents = "torrents"
TorrentCreator = "torrentcreator"
RSS = "rss"
Search = "search"
EMPTY = ""
Expand Down
3 changes: 3 additions & 0 deletions src/qbittorrentapi/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from qbittorrentapi.rss import RSS
from qbittorrentapi.search import Search
from qbittorrentapi.sync import Sync
from qbittorrentapi.torrentcreator import TorrentCreator
from qbittorrentapi.torrents import TorrentCategories, Torrents, TorrentTags
from qbittorrentapi.transfer import Transfer

Expand Down Expand Up @@ -280,6 +281,7 @@ def __init__(
self._torrents: Torrents | None = None
self._torrent_categories: TorrentCategories | None = None
self._torrent_tags: TorrentTags | None = None
self._torrentcreator: TorrentCreator | None = None
self._transfer: Transfer | None = None

# turn off console-printed warnings about SSL certificate issues.
Expand Down Expand Up @@ -313,6 +315,7 @@ def _initialize_context(self) -> None:
self._torrents = None
self._torrent_categories = None
self._torrent_tags = None
self._torrentcreator = None
self._log = None
self._sync = None
self._rss = None
Expand Down
Loading
Loading