Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
shell: pwsh
run: "Compress-Archive dist/* ${{ steps.archieve.outputs.NAME }}.zip\n"
- name: Upload Artifact
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: automated-build-${{ steps.archieve.outputs.NAME }}
path: ${{ steps.archieve.outputs.NAME }}.*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
shell: pwsh
run: "Compress-Archive dist/* ${{ steps.archive.outputs.NAME }}.zip\n"
- name: Upload Artifact
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: automated-build-${{ steps.archive.outputs.NAME }}
path: ${{ steps.archive.outputs.NAME }}.*
Expand Down
29 changes: 16 additions & 13 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -5872,7 +5872,11 @@ def _should_leave_alone(
remove_torrent = False

hnr_override = False
if is_downloading and remove_torrent and not self._hnr_safe_to_remove(torrent, data_settings):
if (
is_downloading
and remove_torrent
and not self._hnr_safe_to_remove(torrent, data_settings)
):
self.logger.debug(
"HnR protection: keeping downloading torrent [%s] (ratio=%.2f, seeding=%s)",
torrent.name,
Expand All @@ -5885,7 +5889,9 @@ def _should_leave_alone(
if hnr_override:
return_value = True
else:
return_value = not (is_uploading and self.torrent_limit_check(torrent, seeding_time_limit, ratio_limit))
return_value = not (
is_uploading and self.torrent_limit_check(torrent, seeding_time_limit, ratio_limit)
)
if data_settings.get("super_seeding", False) or data_torrent.get("super_seeding", False):
return_value = True
if self.in_tags(torrent, "qBitrr-free_space_paused", instance_name):
Expand Down Expand Up @@ -5955,22 +5961,18 @@ def _process_single_torrent_trackers(
)
if monitored_trackers and most_important_tracker:
if (
(r := most_important_tracker.get(
r := most_important_tracker.get(
"DownloadRateLimit", self.seeding_mode_global_download_limit
))
!= 0
and torrent.dl_limit != r
):
)
) != 0 and torrent.dl_limit != r:
torrent.set_download_limit(limit=r)
elif r < 0:
torrent.set_upload_limit(limit=-1)
if (
(r := most_important_tracker.get(
r := most_important_tracker.get(
"UploadRateLimit", self.seeding_mode_global_upload_limit
))
!= 0
and torrent.up_limit != r
):
)
) != 0 and torrent.up_limit != r:
torrent.set_upload_limit(limit=r)
elif r < 0:
torrent.set_upload_limit(limit=-1)
Expand Down Expand Up @@ -6174,7 +6176,8 @@ def _process_single_torrent(
self._process_single_torrent_process_files(torrent, True)
elif torrent.hash in self.timed_ignore_cache:
if (
torrent.state_enum in (TorrentStates.STOPPED_DOWNLOAD, TorrentStates.STOPPED_UPLOAD)
torrent.state_enum
in (TorrentStates.STOPPED_DOWNLOAD, TorrentStates.STOPPED_UPLOAD)
and not self.in_tags(torrent, "qBitrr-free_space_paused", instance_name)
and not self.in_tags(torrent, "qBitrr-ignored", instance_name)
):
Expand Down
2 changes: 2 additions & 0 deletions qBitrr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def process_flags() -> argparse.Namespace | bool:
IGNORE_TORRENTS_YOUNGER_THAN = ENVIRO_CONFIG.settings.ignore_torrents_younger_than or CONFIG.get(
"Settings.IgnoreTorrentsYoungerThan", fallback=180
)


def _has_any_qbit_section() -> bool:
return any(s == "qBit" or s.startswith("qBit-") for s in CONFIG.sections())

Expand Down
4 changes: 1 addition & 3 deletions qBitrr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ def _initialize_qbit_instances(self) -> None:
self._init_instance(section, section)
self.logger.info("Initialized qBit instance: %s", section)
except Exception as e:
self.logger.error(
"Failed to initialize qBit instance '%s': %s", section, e
)
self.logger.error("Failed to initialize qBit instance '%s': %s", section, e)
self.instance_health[section] = False

# Set current_qbit_version from the first initialized instance (for legacy compatibility)
Expand Down
19 changes: 13 additions & 6 deletions qBitrr/qbit_category_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,18 @@ def _process_single_torrent(self, torrent: TorrentDictionary, category: str):
self._apply_tags(torrent, tags)
# Merge tracker overrides into effective config (tracker wins over category
# for seeding fields; skip non-seeding tracker metadata keys)
_skip = {"URI", "Priority", "Name", "AddTags", "HitAndRunMode",
"MinSeedRatio", "MinSeedingTimeDays", "HitAndRunMinimumDownloadPercent",
"HitAndRunPartialSeedRatio", "TrackerUpdateBuffer"}
_skip = {
"URI",
"Priority",
"Name",
"AddTags",
"HitAndRunMode",
"MinSeedRatio",
"MinSeedingTimeDays",
"HitAndRunMinimumDownloadPercent",
"HitAndRunPartialSeedRatio",
"TrackerUpdateBuffer",
}
effective_config = {
**config,
**{k: v for k, v in tracker_config.items() if k not in _skip},
Expand Down Expand Up @@ -363,9 +372,7 @@ def _get_tracker_config(self, torrent: TorrentDictionary) -> dict | None:
cfg_host = _extract_tracker_host(uri)
# Use apex/suffix matching: cfg_host "example.com" matches both
# "example.com" (exact) and "sub.example.com" (subdomain)
host_match = any(
h == cfg_host or h.endswith("." + cfg_host) for h in torrent_hosts
)
host_match = any(h == cfg_host or h.endswith("." + cfg_host) for h in torrent_hosts)
if cfg_host and host_match and priority > best_priority:
best = tracker_cfg
best_priority = priority
Expand Down
Loading