Skip to content

Commit

Permalink
4.1.6 (#580)
Browse files Browse the repository at this point in the history
* 4.1.6-develop1

* update wiki to include custom_tag

* Fixes #560

* Bump qbittorrent-api from 2024.3.60 to 2024.5.61 (#564)

* Bump schedule from 1.2.1 to 1.2.2 (#565)

Bumps [schedule](https://github.com/dbader/schedule) from 1.2.1 to 1.2.2.
- [Changelog](https://github.com/dbader/schedule/blob/master/HISTORY.rst)
- [Commits](dbader/schedule@1.2.1...1.2.2)

---
updated-dependencies:
- dependency-name: schedule
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update SUPPORTED_VERSIONS.json (#566)

Co-authored-by: bobokun <[email protected]>

* Update SUPPORTED_VERSIONS.json (#563)

* (docs): qbit version details (#567)

* Bump requests from 2.32.2 to 2.32.3 (#571)

* Bump qbittorrent-api from 2024.5.61 to 2024.5.62 (#570)

* Update SUPPORTED_VERSIONS.json (#572)

* Update SUPPORTED_VERSIONS.json (#573)

* closes #575

* allow github auto-merge using squash

* Bump qbittorrent-api from 2024.5.62 to 2024.5.63 (#576)

Bumps [qbittorrent-api](https://github.com/rmartin16/qbittorrent-api) from 2024.5.62 to 2024.5.63.
- [Release notes](https://github.com/rmartin16/qbittorrent-api/releases)
- [Changelog](https://github.com/rmartin16/qbittorrent-api/blob/main/CHANGELOG.md)
- [Commits](rmartin16/qbittorrent-api@v2024.5.62...v2024.5.63)

---
updated-dependencies:
- dependency-name: qbittorrent-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* automatic merge PR for update version

* Update SUPPORTED_VERSIONS.json (#578)

Co-authored-by: bobokun <[email protected]>

* 4.1.6

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bakerboy448 <[email protected]>
  • Loading branch information
4 people authored Jun 4, 2024
1 parent 19a33a1 commit 28a837e
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# updates if all checks pass
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --merge "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/update-supported-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,23 @@ jobs:
run: python scripts/update-readme-version.py ${{ github.event.inputs.targetBranch || github.ref_name }}

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update SUPPORTED_VERSIONS.json
title: "Update SUPPORTED_VERSIONS.json for ${{ github.event.inputs.targetBranch || github.ref_name }}"
branch: update-supported-versions-${{ github.event.inputs.targetBranch || github.ref_name }}
base: develop
body: "This PR updates the SUPPORTED_VERSIONS.json to reflect new versions."

- name: Approve the Pull Request
if: ${{ steps.cpr.outputs.pull-request-number }}
run: gh pr review ${{ steps.cpr.outputs.pull-request-number }} --approve
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge the Pull Request
if: ${{ steps.cpr.outputs.pull-request-number }}
run: gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --auto --squash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 6 additions & 8 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Requirements Updated
- requests==2.32.2
- qbittorrent-api==2024.5.63
- requests==2.32.3
- schedule==1.2.2

# New Updates
- Customize tag names in share limits (Adds [#551](https://github.com/StuffAnThings/qbit_manage/issues/551))
- Force category updates for all torrents (Adds [#483](https://github.com/StuffAnThings/qbit_manage/issues/483))
- Add config option `cat_update_all` to categorize only uncategorized torrents (Closes [#575](https://github.com/StuffAnThings/qbit_manage/issues/575))

# Bug Fixes
- Fixes [#552](https://github.com/StuffAnThings/qbit_manage/issues/552)
- Fixes [#557](https://github.com/StuffAnThings/qbit_manage/issues/557)
- Fixes [#558](https://github.com/StuffAnThings/qbit_manage/issues/558)
- Fixes [#560](https://github.com/StuffAnThings/qbit_manage/issues/560)



**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.4...v4.1.5
**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.5...v4.1.6
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ This is a program used to manage your qBittorrent instance such as:

## Supported Qbittorrent Versions

We rely on [qbittorrent-api](https://pypi.org/project/qbittorrent-api/) to interact with Qbittorrent.

Generally expect new releases of Qbittorrent to not immediately be supported. Support CANNOT be added until qbittorrent-api adds support gor the version. Any material changed and impact must then be assessed prior to Qbit Manage supporting it.

### Master

![master - qBittorrent version](https://img.shields.io/badge/dynamic/json?label=master%20-%20qBittorrent&query=master.qbit&url=https%3A%2F%2Fraw.githubusercontent.com%2FStuffAnThings%2Fqbit_manage%2Fdevelop%2FSUPPORTED_VERSIONS.json&color=brightgreen)
Expand Down
8 changes: 4 additions & 4 deletions SUPPORTED_VERSIONS.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"master": {
"qbit": "v4.6.4",
"qbitapi": "2024.3.60"
"qbit": "v4.6.5",
"qbitapi": "2024.5.63"
},
"develop": {
"qbit": "v4.6.4",
"qbitapi": "2024.3.60"
"qbit": "v4.6.5",
"qbitapi": "2024.5.63"
}
}
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.5
4.1.6
2 changes: 2 additions & 0 deletions config/config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ settings:
cat_filter_completed: True # Filters for completed torrents only when running cat_update command
share_limits_filter_completed: True # Filters for completed torrents only when running share_limits command
tag_nohardlinks_filter_completed: True # Filters for completed torrents only when running tag_nohardlinks command
cat_update_all: True # Checks and udpates all torrent categories if set to True when running cat_update command, otherwise only update torrents that are uncategorized

directory:
# Do not remove these
# Cross-seed var: </your/path/here/> # Output directory of cross-seed
Expand Down
30 changes: 16 additions & 14 deletions docs/Config-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,20 @@ This section defines your qBittorrent instance.
---
This section defines any settings defined in the configuration.

| Variable | Definition | Required |
| :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------- |
| `force_auto_tmm` | Will force qBittorrent to enable Automatic Torrent Management for each torrent. | <center>❌</center> |
| `tracker_error_tag` | Define the tag of any torrents that do not have a working tracker. (Used in `--rem-unregistered` and `--tag-tracker-error`) | <center>❌</center> |
| `nohardlinks_tag` | Define the tag of any torrents that don't have hardlinks (Used in `--tag-nohardlinks`) | <center>❌</center> |
| `share_limits_tag` | Will add this tag when applying share limits to provide an easy way to filter torrents by share limit group/priority for each torrent. For example, if you have a share-limit group `cross-seed` with a priority of 2 and the default share_limits_tag `~share_limits` would add the tag `~share_limit_2.cross-seed` (Used in `--share-limits`) | <center>❌</center> |
| `share_limits_min_seeding_time_tag` | Will add this tag when applying share limits to torrents that have not yet reached the minimum seeding time (Used in `--share-limits`) | <center>❌</center> |
| `share_limits_min_num_seeds_tag` | Will add this tag when applying share limits to torrents that have not yet reached the minimum number of seeds (Used in `--share-limits`) | <center>❌</center> |
| `share_limits_last_active_tag` | Will add this tag when applying share limits to torrents that have not yet reached the last active limit (Used in `--share-limits`) | <center>❌</center> |
| `cross_seed_tag` | When running `--cross-seed` function, it will update any added cross-seed torrents with this tag. | <center>❌</center> |
| `cat_filter_completed` | When running `--cat-update` function, it will filter for completed torrents only. | <center>❌</center> |
| `share_limits_filter_completed` | When running `--share-limits` function, it will filter for completed torrents only. | <center>❌</center> |
| `tag_nohardlinks_filter_completed` | When running `--tag-nohardlinks` function, , it will filter for completed torrents only. | <center>❌</center> |
| Variable | Definition | Default Values | Required |
| :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------| :----------------- | :----------------- |
| `force_auto_tmm` | Will force qBittorrent to enable Automatic Torrent Management for each torrent. | False | <center>❌</center> |
| `tracker_error_tag` | Define the tag of any torrents that do not have a working tracker. (Used in `--rem-unregistered` and `--tag-tracker-error`) | issue | <center>❌</center> |
| `nohardlinks_tag` | Define the tag of any torrents that don't have hardlinks (Used in `--tag-nohardlinks`) | noHL | <center>❌</center> |
| `share_limits_tag` | Will add this tag when applying share limits to provide an easy way to filter torrents by share limit group/priority for each torrent. For example, if you have a share-limit group `cross-seed` with a priority of 2 and the default share_limits_tag `~share_limits` would add the tag `~share_limit_2.cross-seed` (Used in `--share-limits`) | ~share_limit | <center>❌</center> |
| `share_limits_min_seeding_time_tag` | Will add this tag when applying share limits to torrents that have not yet reached the minimum seeding time (Used in `--share-limits`) | MinSeedTimeNotReached | <center>❌</center> |
| `share_limits_min_num_seeds_tag` | Will add this tag when applying share limits to torrents that have not yet reached the minimum number of seeds (Used in `--share-limits`) | MinSeedsNotMet | <center>❌</center> |
| `share_limits_last_active_tag` | Will add this tag when applying share limits to torrents that have not yet reached the last active limit (Used in `--share-limits`) | LastActiveLimitNotReached | <center>❌</center> |
| `cross_seed_tag` | When running `--cross-seed` function, it will update any added cross-seed torrents with this tag. | cross-seed | <center>❌</center> |
| `cat_filter_completed` | When running `--cat-update` function, it will filter for completed torrents only. | True | <center>❌</center> |
| `share_limits_filter_completed` | When running `--share-limits` function, it will filter for completed torrents only. | True | <center>❌</center> |
| `tag_nohardlinks_filter_completed` | When running `--tag-nohardlinks` function, , it will filter for completed torrents only. | True | <center>❌</center> |
| `cat_update_all` | When running `--cat-update` function, it will check and update all torrents categories, otherwise it will only update uncategorized torrents. | True | <center>❌</center> |
## **directory:**

---
Expand All @@ -74,7 +75,7 @@ This section defines the directories that qbit_manage will be looking into for v

---
This section defines the categories that you are currently using and the path's that are associated with them.<br>
> **NOTE** ALL categories must be defined, if it is in your qBit, then it **MUST** be defined here, if not the script will throw errors.
> **NOTE** ALL categories must be defined, if it is in your qBit, then it **MUST** be defined here, if not the script will throw errors. If you want to leave a save_path as uncategorized you can use the key 'Uncategorized' as the name of the category.
| Configuration | Definition | Required |
| :------------ | :------------------------ | :----------------- |
Expand Down Expand Up @@ -169,6 +170,7 @@ Control how torrent share limits are set depending on the priority of your group
| `resume_torrent_after_change` | Will resume your torrent after changing share limits. | True | bool | <center>❌</center> |
| `add_group_to_tag` | This adds your grouping as a tag with a prefix defined in settings (share_limits_tag). Example: A grouping named noHL with a priority of 1 will have a tag set to `~share_limit_1.noHL` (if using the default prefix). | True | bool | <center>❌</center> |
| `min_num_seeds` | Will prevent torrent deletion by cleanup variable if the number of seeds is less than the value set here (depending on the tracker, you may or may not be included). If the torrent has less number of seeds than the min_num_seeds, the share limits will be changed back to no limits and resume the torrent to continue seeding. | 0 | int | <center>❌</center> |
| `custom_tag` | Apply a custom tag name for this particular group. **WARNING (This tag MUST be unique as it will be used to determine share limits. Please ensure it does not overlap with any other tags in qBittorrent)** | None | str | <center>❌</center> |
## **recyclebin:**

---
Expand Down
3 changes: 3 additions & 0 deletions modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def hooks(attr):
"tag_nohardlinks_filter_completed": self.util.check_for_attribute(
self.data, "tag_nohardlinks_filter_completed", parent="settings", var_type="bool", default=True
),
"cat_update_all": self.util.check_for_attribute(
self.data, "cat_update_all", parent="settings", var_type="bool", default=True
),
}

self.tracker_error_tag = self.settings["tracker_error_tag"]
Expand Down
18 changes: 14 additions & 4 deletions modules/core/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,30 @@ def __init__(self, qbit_manager):
self.notify_attr = [] # List of single torrent attributes to send to notifiarr
self.uncategorized_mapping = "Uncategorized"
self.status_filter = "completed" if self.config.settings["cat_filter_completed"] else "all"

self.cat_update_all = self.config.settings["cat_update_all"]
self.category()
self.config.webhooks_factory.notify(self.torrents_updated, self.notify_attr, group_by="category")

def category(self):
"""Update category for torrents that don't have any category defined and returns total number categories updated"""
logger.separator("Updating Categories", space=False, border=False)
torrent_list = self.qbt.get_torrents({"status_filter": self.status_filter})
torrent_list_filter = {"status_filter": self.status_filter}
if not self.cat_update_all:
torrent_list_filter["category"] = ""
torrent_list = self.qbt.get_torrents(torrent_list_filter)
for torrent in torrent_list:
torrent_category = torrent.category
new_cat = []
new_cat.extend(self.get_tracker_cat(torrent) or self.qbt.get_category(torrent.save_path))
if not torrent.auto_tmm and torrent_category:
logger.print_line(
f"{torrent.name} has Automatic Torrent Management disabled and already has a category"
f"{torrent_category}. Skipping..",
"DEBUG",
)
continue
if new_cat[0] == self.uncategorized_mapping:
logger.print_line(f"{torrent.name} remains uncategorized.", self.config.loglevel)
logger.print_line(f"{torrent.name} remains uncategorized.", "DEBUG")
continue
if torrent_category not in new_cat:
self.update_cat(torrent, new_cat[0], False)
Expand All @@ -46,7 +56,7 @@ def category(self):

def get_tracker_cat(self, torrent):
tracker = self.qbt.get_tags(self.qbt.get_tracker_urls(torrent.trackers))
return tracker["cat"]
return [tracker["cat"]] if tracker["cat"] else None

def update_cat(self, torrent, new_cat, cat_change):
"""Update category based on the torrent information"""
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GitPython==3.1.43
humanize==4.9.0
pytimeparse2==1.7.1
qbittorrent-api==2024.5.63
requests==2.32.2
requests==2.32.3
retrying==1.3.4
ruamel.yaml==0.18.6
schedule==1.2.1
schedule==1.2.2

0 comments on commit 28a837e

Please sign in to comment.