mirror of
https://github.com/Viren070/MediaFusion.git
synced 2025-12-01 23:21:11 +01:00
#210: Add category field to QBittorrent
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -143,6 +143,11 @@
|
||||
<input class="form-control" type="number" id="play_video_after_download" name="play_video_after_download" placeholder="Enter Play Video After Download"
|
||||
value="{{ user_data.streaming_provider.qbittorrent_config.play_video_after if user_data.streaming_provider.qbittorrent_config else 100 }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="category">Category: <span class="bi bi-question-circle" data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
title="Enter the category for the torrents to be tagged in qBittorrent."></span></label>
|
||||
<input class="form-control" type="text" id="category" name="category" value="{{ user_data.streaming_provider.qbittorrent_config.category if user_data.streaming_provider.qbittorrent_config else 'MediaFusion' }}">
|
||||
</div>
|
||||
|
||||
<!-- WebDAV Configuration -->
|
||||
<h5 class="mt-3">WebDAV Configuration</h5>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user