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

Api tags patch #4

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
93759bd
api tags patch
Jan 16, 2023
ccbf5a2
Update README.md
snack32 Jan 22, 2023
b21b364
Update README.md
snack32 Jan 22, 2023
48eb9e5
Update README.md
snack32 Jan 22, 2023
cf24735
Update README.md
snack32 Jan 22, 2023
1f3d33f
Create check_updates_and_custom_build.yml
snack32 Jan 24, 2023
c7eae38
Update README.md
snack32 Jan 24, 2023
c56c960
Update check_updates_and_custom_build.yml
snack32 Jan 24, 2023
dc63d83
Update check_updates_and_custom_build.yml
snack32 Jan 24, 2023
5ce346a
use local repo for patches
userdocs Jan 26, 2023
cad503e
Merge branch 'userdocs:main' into main
github-actions[bot] Jan 30, 2023
3c272ab
Merge branch 'userdocs:main' into main
github-actions[bot] Feb 6, 2023
8005a30
Merge branch 'userdocs:main' into main
github-actions[bot] Mar 6, 2023
dee128f
Merge branch 'userdocs:main' into main
github-actions[bot] Mar 13, 2023
63cd8ad
Merge branch 'userdocs:main' into main
github-actions[bot] Apr 10, 2023
5563115
Update check_updates_and_custom_build.yml
snack32 Apr 10, 2023
13d06dd
Merge branch 'userdocs:main' into main
github-actions[bot] May 29, 2023
cc70326
Merge branch 'userdocs:main' into main
snack32 Jun 12, 2023
caa12ff
Merge branch 'userdocs:main' into main
github-actions[bot] Jul 17, 2023
f09d777
Merge branch 'userdocs:main' into main
snack32 Sep 11, 2023
144410d
Merge branch 'userdocs:main' into main
github-actions[bot] Oct 2, 2023
62cd318
Merge branch 'userdocs:main' into main
snack32 Oct 15, 2023
2492f73
Merge branch 'userdocs:main' into main
snack32 Oct 31, 2023
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
88 changes: 88 additions & 0 deletions .github/workflows/check_updates_and_custom_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: check updates and custom build

on:
workflow_dispatch:
schedule:
- cron: '15 3 * * 1'

jobs:
merge_upstream_repo:
name: Sync fork with the upstream repository
runs-on: ubuntu-latest
steps:
- run: |
_response="$(curl -sSw "\n%{http_code}\n" -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -d '{"branch":"main"}' https://api.github.com/repos/${{ github.repository }}/merge-upstream)"
rc_http="$(echo "$_response" | tail -n 1)"
if [ "$rc_http" != "200" ]; then
m_http="$(echo "$_response" | head -n -1 | jq -r '.message')"
echo "::error::$m_http"
exit 1
fi

check_required_build:
name: Check required build
needs: merge_upstream_repo
runs-on: ubuntu-latest
outputs:
required_build: ${{ steps.required_build.outputs.required_build }}
steps:
- id: required_build
run: |
upstream_dependency_versions="$(curl -sL "https://github.com/userdocs/qbittorrent-nox-static-legacy/releases/latest/download/dependency-version.json")"
saved_dependency_versions="$(curl -sL "https://github.com/${{ github.repository }}/releases/latest/download/upstream-dependency-version.json")"
if [ -z "$upstream_dependency_versions" ]; then
echo "::error::Upstream dependency version file (not found!)"
exit 1
elif ! echo "$upstream_dependency_versions" | jq &> /dev/null; then
echo "::error::Upstream dependency version file (invalid json!)"
exit 1
elif ! diff <(echo "$upstream_dependency_versions" | sort) <(echo "$saved_dependency_versions" | sort) &>/dev/null; then
echo "required_build=true" >> $GITHUB_OUTPUT
echo "::notice::Dependency version files mismatch. Required build."
else
echo "required_build=false" >> $GITHUB_OUTPUT
fi
trigger_build:
name: Trigger build
needs: check_required_build
if: needs.check_required_build.outputs.required_build == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get repository name
run: echo "OWN_REPO_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV

- name: Trigger workflow build and wait
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: "${{ github.repository_owner }}"
repo: "${{ env.OWN_REPO_NAME }}"
github_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
workflow_file_name: matrix_multi_build_and_release_customs_tags.yml
wait_interval: 60
propagate_failure: true
wait_workflow: true
client_payload: '{"skip_rerun":false}'

finish_tasks:
name: Finish tasks
needs: trigger_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get upstream dependency file and latest version tag
id: latest_release_tag
run: |
curl -sL "https://github.com/userdocs/qbittorrent-nox-static-legacy/releases/latest/download/dependency-version.json" > upstream-dependency-version.json
latest_release_tag="$(curl -s -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name')"
echo "latest_release_tag=$latest_release_tag" >> $GITHUB_OUTPUT
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: "${{ steps.latest_release_tag.outputs.latest_release_tag }}"
asset_name: upstream-dependency-version.json
file: upstream-dependency-version.json
overwrite: true
27 changes: 27 additions & 0 deletions patches/qbittorrent/4.3.9/patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- qBittorrent/src/webui/api/torrentscontroller.cpp
+++ torrentscontroller-edited.cpp
@@ -246,6 +246,7 @@
// GET params:
// - filter (string): all, downloading, seeding, completed, paused, resumed, active, inactive, stalled, stalled_uploading, stalled_downloading
// - category (string): torrent category for filtering by it (empty string means "uncategorized"; no "category" param presented means "any category")
+// - tag (string): torrent tag for filtering by it (empty string means "untagged"; no "tag" param presented means "any tag")
// - hashes (string): filter by hashes, can contain multiple hashes separated by |
// - sort (string): name of column for sorting by its value
// - reverse (bool): enable reverse sorting
@@ -255,6 +256,7 @@
{
const QString filter {params()["filter"]};
const QString category {params()["category"]};
+ const QString tag {params()["tag"]};
const QString sortedColumn {params()["sort"]};
const bool reverse {parseBool(params()["reverse"]).value_or(false)};
int limit {params()["limit"].toInt()};
@@ -265,7 +267,7 @@
for (const QString &hash : hashes)
idSet.insert(BitTorrent::TorrentID::fromString(hash));

- const TorrentFilter torrentFilter(filter, (hashes.isEmpty() ? TorrentFilter::AnyID : idSet), category);
+ const TorrentFilter torrentFilter(filter, (hashes.isEmpty() ? TorrentFilter::AnyID : idSet), category, tag);
QVariantList torrentList;
for (const BitTorrent::Torrent *torrent : asConst(BitTorrent::Session::instance()->torrents()))
{