Added setting to set the category when a torrent is imported from RealDebrid or other provider.

This commit is contained in:
Roger Far 2022-02-06 16:46:18 -07:00
parent 05df0cb558
commit dc16108983
8 changed files with 26 additions and 2 deletions

View file

@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.7] - 2022-02-06
- Added setting to set the category when a torrent is imported from RealDebrid or other provider.
## [2.0.6] - 2022-02-06 ## [2.0.6] - 2022-02-06
### Added ### Added
- Added setting to automatically delete torrents in the state of error after a certain amount of time. - Added setting to automatically delete torrents in the state of error after a certain amount of time.

View file

@ -69,6 +69,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="field">
<label class="label">Automatically import category.</label>
<div class="control">
<input class="input" type="text" maxlength="100" [(ngModel)]="settingProviderAutoImportCategory" />
</div>
<p class="help">When a torrent is imported assign it this category.</p>
</div>
<div class="field"> <div class="field">
<div class="control"> <div class="control">
<label class="checkbox"> <label class="checkbox">

View file

@ -28,6 +28,7 @@ export class SettingsComponent implements OnInit {
public settingLogLevel: string; public settingLogLevel: string;
public settingProvider: string; public settingProvider: string;
public settingProviderAutoImport: boolean; public settingProviderAutoImport: boolean;
public settingProviderAutoImportCategory: string;
public settingProviderAutoDelete: boolean; public settingProviderAutoDelete: boolean;
public settingRealDebridApiKey: string; public settingRealDebridApiKey: string;
public settingDownloadPath: string; public settingDownloadPath: string;
@ -62,6 +63,7 @@ export class SettingsComponent implements OnInit {
(results) => { (results) => {
this.settingProvider = this.getSetting(results, 'Provider'); this.settingProvider = this.getSetting(results, 'Provider');
this.settingProviderAutoImport = this.getSetting(results, 'ProviderAutoImport') === '1'; this.settingProviderAutoImport = this.getSetting(results, 'ProviderAutoImport') === '1';
this.settingProviderAutoImportCategory = this.getSetting(results, 'ProviderAutoImportCategory');
this.settingProviderAutoDelete = this.getSetting(results, 'ProviderAutoDelete') === '1'; this.settingProviderAutoDelete = this.getSetting(results, 'ProviderAutoDelete') === '1';
this.settingRealDebridApiKey = this.getSetting(results, 'RealDebridApiKey'); this.settingRealDebridApiKey = this.getSetting(results, 'RealDebridApiKey');
this.settingLogLevel = this.getSetting(results, 'LogLevel'); this.settingLogLevel = this.getSetting(results, 'LogLevel');
@ -102,6 +104,10 @@ export class SettingsComponent implements OnInit {
settingId: 'ProviderAutoImport', settingId: 'ProviderAutoImport',
value: this.settingProviderAutoImport ? '1' : '0', value: this.settingProviderAutoImport ? '1' : '0',
}, },
{
settingId: 'ProviderAutoImportCategory',
value: this.settingProviderAutoImportCategory,
},
{ {
settingId: 'ProviderAutoDelete', settingId: 'ProviderAutoDelete',
value: this.settingProviderAutoDelete ? '1' : '0', value: this.settingProviderAutoDelete ? '1' : '0',

View file

@ -1,6 +1,6 @@
{ {
"name": "rdt-client", "name": "rdt-client",
"version": "2.0.6", "version": "2.0.7",
"description": "This is a web interface to manage your torrents on Real-Debrid.", "description": "This is a web interface to manage your torrents on Real-Debrid.",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {

View file

@ -53,6 +53,12 @@ namespace RdtClient.Data.Data
Value = "0" Value = "0"
}, },
new Setting new Setting
{
SettingId = "ProviderAutoImportCategory",
Type = "String",
Value = ""
},
new Setting
{ {
SettingId = "ProviderAutoDelete", SettingId = "ProviderAutoDelete",
Type = "Int32", Type = "Int32",

View file

@ -50,6 +50,7 @@ namespace RdtClient.Data.Data
{ {
Provider = GetString("Provider"), Provider = GetString("Provider"),
ProviderAutoImport = GetInt32("ProviderAutoImport"), ProviderAutoImport = GetInt32("ProviderAutoImport"),
ProviderAutoImportCategory = GetString("ProviderAutoImportCategory"),
ProviderAutoDelete = GetInt32("ProviderAutoDelete"), ProviderAutoDelete = GetInt32("ProviderAutoDelete"),
RealDebridApiKey = GetString("RealDebridApiKey"), RealDebridApiKey = GetString("RealDebridApiKey"),
DownloadPath = GetString("DownloadPath"), DownloadPath = GetString("DownloadPath"),

View file

@ -6,6 +6,7 @@ namespace RdtClient.Data.Models.Internal
{ {
public String Provider { get; set; } public String Provider { get; set; }
public Int32 ProviderAutoImport { get; set; } public Int32 ProviderAutoImport { get; set; }
public String ProviderAutoImportCategory { get; set; }
public Int32 ProviderAutoDelete { get; set; } public Int32 ProviderAutoDelete { get; set; }
public String RealDebridApiKey { get; set; } public String RealDebridApiKey { get; set; }
public String DownloadPath { get; set; } public String DownloadPath { get; set; }

View file

@ -360,7 +360,7 @@ namespace RdtClient.Service.Services
{ {
var newTorrent = new Torrent var newTorrent = new Torrent
{ {
Category = null, Category = Settings.Get.ProviderAutoImportCategory,
DownloadAction = TorrentDownloadAction.DownloadManual, DownloadAction = TorrentDownloadAction.DownloadManual,
FinishedAction = TorrentFinishedAction.None, FinishedAction = TorrentFinishedAction.None,
DownloadMinSize = 0, DownloadMinSize = 0,