From 31aee16b1cc28ccc62cc0014b8136c62472f89d2 Mon Sep 17 00:00:00 2001 From: garypiner Date: Thu, 5 Jan 2023 17:04:39 +0000 Subject: [PATCH 1/9] NoHL torrents been removed when criteria not met --- modules/qbittorrent.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 18c81f4..7f37acc 100755 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -548,12 +548,12 @@ class Qbt: tracker["url"], ) if tor_reach_seed_limit: - if torrent.name not in tdel_dict: - tdel_dict[torrent.name] = {} - tdel_dict[torrent.name]["content_path"] = torrent["content_path"].replace( + if torrent.hash not in tdel_dict: + tdel_dict[torrent.hash] = {} + tdel_dict[torrent.hash]["content_path"] = torrent["content_path"].replace( root_dir, remote_dir ) - tdel_dict[torrent.name]["body"] = tor_reach_seed_limit + tdel_dict[torrent.hash]["body"] = tor_reach_seed_limit else: # Updates torrent to see if "MinSeedTimeNotReached" tag has been added torrent = self.get_torrents({"torrent_hashes": [torrent.hash]}).data[0] @@ -608,19 +608,20 @@ class Qbt: torrent_list = self.get_torrents({"category": category, "status_filter": "completed"}) for torrent in torrent_list: t_name = torrent.name - if t_name in tdel_dict.keys() and "noHL" in torrent.tags: + t_hash = torrent.hash + if t_hash in tdel_dict.keys() and "noHL" in torrent.tags: t_count = self.torrentinfo[t_name]["count"] t_msg = self.torrentinfo[t_name]["msg"] t_status = self.torrentinfo[t_name]["status"] # Double check that the content path is the same before we delete anything - if torrent["content_path"].replace(root_dir, remote_dir) == tdel_dict[t_name]["content_path"]: + if torrent["content_path"].replace(root_dir, remote_dir) == tdel_dict[t_hash]["content_path"]: tracker = self.config.get_tags(torrent.trackers) body = [] body += logger.print_line(logger.insert_space(f"Torrent Name: {t_name}", 3), self.config.loglevel) body += logger.print_line( logger.insert_space(f'Tracker: {tracker["url"]}', 8), self.config.loglevel ) - body += logger.print_line(tdel_dict[t_name]["body"], self.config.loglevel) + body += logger.print_line(tdel_dict[t_hash]["body"], self.config.loglevel) body += logger.print_line( logger.insert_space("Cleanup: True [No hard links found and meets Share Limits.]", 8), self.config.loglevel, From 3730abeaa2512aed1d47e673b3a4efdaee1f48bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 00:05:31 +0000 Subject: [PATCH 2/9] Bump docker/build-push-action from 3 to 4 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3 to 4. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/develop.yml | 2 +- .github/workflows/latest.yml | 2 +- .github/workflows/version.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 .github/workflows/develop.yml mode change 100755 => 100644 .github/workflows/latest.yml mode change 100755 => 100644 .github/workflows/version.yml diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml old mode 100755 new mode 100644 index 8088d8a..6ed6492 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -42,7 +42,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: ./ file: ./Dockerfile diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml old mode 100755 new mode 100644 index 16337f4..7e472c9 --- a/.github/workflows/latest.yml +++ b/.github/workflows/latest.yml @@ -38,7 +38,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: ./ file: ./Dockerfile diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml old mode 100755 new mode 100644 index dffa63e..4f264e8 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -36,7 +36,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: context: ./ file: ./Dockerfile From 220fe3cae39060d38b843f579fc611c5d507c65a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 01:21:44 +0000 Subject: [PATCH 3/9] Bump pre-commit from 2.20.0 to 3.0.4 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.20.0 to 3.0.4. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v2.20.0...v3.0.4) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e4a9677..6f7c1c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ flake8==6.0.0 -pre-commit==2.20.0 +pre-commit==3.0.4 qbittorrent-api==2023.2.42 requests==2.28.1 retrying==1.3.4 From d83ea098b079a1be405ad70c909360562e0eec30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 02:25:45 +0000 Subject: [PATCH 4/9] Bump requests from 2.28.1 to 2.28.2 Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.28.2. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.28.2) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6f7c1c7..0d92fca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ flake8==6.0.0 pre-commit==3.0.4 qbittorrent-api==2023.2.42 -requests==2.28.1 +requests==2.28.2 retrying==1.3.4 ruamel.yaml==0.17.21 schedule==1.1.0 From 85711d93e99561f0dafa09f8ebfe794d81c90b19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 00:31:18 +0000 Subject: [PATCH 5/9] Bump pre-commit from 3.0.4 to 3.1.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.0.4 to 3.1.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.0.4...v3.1.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0d92fca..45b0b50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ flake8==6.0.0 -pre-commit==3.0.4 +pre-commit==3.1.0 qbittorrent-api==2023.2.42 requests==2.28.2 retrying==1.3.4 From 983dbe3457613c8b428593059d691a8b213d68a3 Mon Sep 17 00:00:00 2001 From: bobokun Date: Tue, 28 Feb 2023 19:46:55 -0500 Subject: [PATCH 6/9] update qbitorrent-api to 2023.2.43 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 45b0b50..f78ce92 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ flake8==6.0.0 pre-commit==3.1.0 -qbittorrent-api==2023.2.42 +qbittorrent-api==2023.2.43 requests==2.28.2 retrying==1.3.4 ruamel.yaml==0.17.21 From 761e9f2bb5eae42b2214c7b21bcd76dd12f4c50a Mon Sep 17 00:00:00 2001 From: bobokun Date: Tue, 28 Feb 2023 19:47:34 -0500 Subject: [PATCH 7/9] 3.4.4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6cb9d3d..f989260 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.4.3 +3.4.4 From f6f314a0f72de21fef81560d93dfbff80faa9f6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 01:12:04 +0000 Subject: [PATCH 8/9] Bump pre-commit from 3.1.0 to 3.1.1 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f78ce92..d37d565 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ flake8==6.0.0 -pre-commit==3.1.0 +pre-commit==3.1.1 qbittorrent-api==2023.2.43 requests==2.28.2 retrying==1.3.4 From 1cb4d21ed2e6247c9bf13e4305f6d71c3fd80e19 Mon Sep 17 00:00:00 2001 From: bobokun Date: Sun, 5 Mar 2023 11:04:51 -0500 Subject: [PATCH 9/9] Updates github workflows and automates changelog --- .../dependabot-approve-and-auto-merge.yml | 36 +++++++++++++++++++ .github/workflows/version.yml | 10 +++++- CHANGELOG | 7 ++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dependabot-approve-and-auto-merge.yml create mode 100644 CHANGELOG diff --git a/.github/workflows/dependabot-approve-and-auto-merge.yml b/.github/workflows/dependabot-approve-and-auto-merge.yml new file mode 100644 index 0000000..bf45d4e --- /dev/null +++ b/.github/workflows/dependabot-approve-and-auto-merge.yml @@ -0,0 +1,36 @@ +name: Dependabot Pull Request Approve and Merge + +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + # Checking the actor will prevent your Action run failing on non-Dependabot + # PRs but also ensures that it only does work for Dependabot PRs. + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + # This first step will fail if there's no metadata and so the approval + # will not occur. + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v1.1.1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + # Here the PR gets approved. + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Finally, this sets the PR to allow auto-merging for patch and minor + # 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 --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 4f264e8..7b6b4b1 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -32,7 +32,7 @@ jobs: - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - name: Build and push id: docker_build @@ -43,3 +43,11 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/qbit_manage:${{ steps.get_version.outputs.VERSION }} + + - name: Create release + id: create_release + uses: softprops/action-gh-release@v1 + with: + body_path: CHANGELOG + token: ${{ secrets.PAT }} + tag_name: ${{ steps.get_version.outputs.VERSION }} diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..eaa9ef1 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,7 @@ +# Requirements Updated +- Bump qbittorrent-api from 2022.11.42 to 2023.2.43 + +# Bug Fixes +- Fixes NoHL torrents being removed when criteria not met (#205) + +**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v3.4.3...v3.4.4