From ad8bcbbfd07b723151749cb87f89c30955661e3b Mon Sep 17 00:00:00 2001 From: saltydk Date: Sat, 5 Oct 2024 16:56:40 +0200 Subject: [PATCH] qbittorrent: change default delete behaviour --- roles/qbittorrent/defaults/main.yml | 2 ++ .../qbittorrent/tasks/subtasks/pre-install/main.yml | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/roles/qbittorrent/defaults/main.yml b/roles/qbittorrent/defaults/main.yml index 20588bdde5..96eca9735b 100644 --- a/roles/qbittorrent/defaults/main.yml +++ b/roles/qbittorrent/defaults/main.yml @@ -21,6 +21,8 @@ qbittorrent_webui_custom_headers_enabled: "{{ 'true' if qbittorrent_themepark_en qbittorrent_webui_custom_headers_default: "{{ (qbittorrent_themepark_headers if qbittorrent_themepark_enabled and global_themepark_plugin_enabled else '') + qbittorrent_webui_custom_headers_custom }}" qbittorrent_webui_custom_headers_custom: "" qbittorrent_webui_custom_headers: "{{ (qbittorrent_webui_custom_headers_default | trim + ' ' + qbittorrent_webui_custom_headers_custom | trim) | trim }}" +# Options are: Delete or MoveToTrash +qbittorrent_torrent_content_remove_option: "Delete" ################################ # Host Install diff --git a/roles/qbittorrent/tasks/subtasks/pre-install/main.yml b/roles/qbittorrent/tasks/subtasks/pre-install/main.yml index 02a6edeb1d..a656bc1150 100644 --- a/roles/qbittorrent/tasks/subtasks/pre-install/main.yml +++ b/roles/qbittorrent/tasks/subtasks/pre-install/main.yml @@ -51,6 +51,18 @@ group: "{{ user.name }}" mode: "0664" + - name: Pre-Install | Settings | Update Session\TorrentContentRemoveOption in 'qBittorrent.conf' config settings + community.general.ini_file: + path: "{{ qbittorrent_paths_conf }}" + section: BitTorrent + option: Session\TorrentContentRemoveOption + value: "{{ lookup('vars', qbittorrent_name + '_torrent_content_remove_option', default=qbittorrent_torrent_content_remove_option) }}" + no_extra_spaces: true + state: present + owner: "{{ user.name }}" + group: "{{ user.name }}" + mode: "0664" + - name: Pre-Install | Settings | Update Connection\PortRangeMin in 'qBittorrent.conf' config settings (legacy) community.general.ini_file: path: "{{ qbittorrent_paths_conf }}"