From 2a7a75498ff4e4c62ecace96a1a59bfd7daa4430 Mon Sep 17 00:00:00 2001 From: mhdzumair Date: Sun, 16 Jun 2024 22:40:24 +0530 Subject: [PATCH] #210: Add category field to QBittorrent --- db/schemas.py | 1 + resources/html/configure.html | 5 +++++ resources/js/config_script.js | 2 ++ streaming_providers/qbittorrent/utils.py | 1 + 4 files changed, 9 insertions(+) diff --git a/db/schemas.py b/db/schemas.py index 0d254f2..5f81ee6 100644 --- a/db/schemas.py +++ b/db/schemas.py @@ -91,6 +91,7 @@ class QBittorrentConfig(BaseModel): seeding_time_limit: int = 1440 # 24 hours seeding_ratio_limit: float = 1.0 play_video_after: int = Field(default=100, le=100, ge=0) + category: str = "MediaFusion" webdav_url: str webdav_username: str webdav_password: str diff --git a/resources/html/configure.html b/resources/html/configure.html index 7b4cb77..588f3b1 100644 --- a/resources/html/configure.html +++ b/resources/html/configure.html @@ -143,6 +143,11 @@ +
+ + +
WebDAV Configuration
diff --git a/resources/js/config_script.js b/resources/js/config_script.js index 1985108..7ed1848 100644 --- a/resources/js/config_script.js +++ b/resources/js/config_script.js @@ -276,6 +276,7 @@ function getUserData() { seeding_time_limit: parseInt(document.getElementById('seeding_time_limit').value, 10), seeding_ratio_limit: parseFloat(document.getElementById('seeding_ratio_limit').value), play_video_after: parseInt(document.getElementById('play_video_after_download').value, 10), + category: document.getElementById('category').value, webdav_url: document.getElementById('webdav_url').value, webdav_username: document.getElementById('webdav_username').value, webdav_password: document.getElementById('webdav_password').value, @@ -286,6 +287,7 @@ function getUserData() { validateInput('seeding_time_limit', !isNaN(streamingProviderData.qbittorrent_config.seeding_time_limit)); validateInput('seeding_ratio_limit', !isNaN(streamingProviderData.qbittorrent_config.seeding_ratio_limit)); validateInput('play_video_after_download', !isNaN(streamingProviderData.qbittorrent_config.play_video_after)); + validateInput('category', streamingProviderData.qbittorrent_config.category); } else { validateInput('provider_token', document.getElementById('provider_token').value); streamingProviderData.token = document.getElementById('provider_token').value; diff --git a/streaming_providers/qbittorrent/utils.py b/streaming_providers/qbittorrent/utils.py index ee533b1..37cb08d 100644 --- a/streaming_providers/qbittorrent/utils.py +++ b/streaming_providers/qbittorrent/utils.py @@ -42,6 +42,7 @@ async def add_magnet( .ratio_limit( user_data.streaming_provider.qbittorrent_config.seeding_ratio_limit ) + .category(user_data.streaming_provider.qbittorrent_config.category) .build() ) except AddTorrentError: