Fixed some issues, first release beta.
This commit is contained in:
parent
c96ce980d5
commit
76b8513d6b
19 changed files with 222 additions and 86 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -38,3 +38,6 @@ server/*.user
|
|||
# Common node modules locations
|
||||
server/wwwroot/
|
||||
server/.vs
|
||||
server/RdtClient.Web/wwwroot/
|
||||
server/RdtClient.Web/Properties/PublishProfiles/FolderProfile.pubxml.user
|
||||
*.user
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"/Api": {
|
||||
"target": "http://localhost:4201/",
|
||||
"target": "http://localhost:6500/",
|
||||
"secure": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "dist/rdt-client",
|
||||
"outputPath": "../server/RdtClient.Web/wwwroot",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
|
|
|
|||
127
client/package-lock.json
generated
127
client/package-lock.json
generated
|
|
@ -12,6 +12,17 @@
|
|||
"requires": {
|
||||
"@angular-devkit/core": "9.1.0",
|
||||
"rxjs": "6.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@angular-devkit/build-angular": {
|
||||
|
|
@ -81,6 +92,17 @@
|
|||
"webpack-sources": "1.4.3",
|
||||
"webpack-subresource-integrity": "1.4.0",
|
||||
"worker-plugin": "4.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@angular-devkit/build-optimizer": {
|
||||
|
|
@ -105,6 +127,17 @@
|
|||
"@angular-devkit/architect": "0.901.0",
|
||||
"@angular-devkit/core": "9.1.0",
|
||||
"rxjs": "6.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@angular-devkit/core": {
|
||||
|
|
@ -118,6 +151,17 @@
|
|||
"magic-string": "0.25.7",
|
||||
"rxjs": "6.5.4",
|
||||
"source-map": "0.7.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@angular-devkit/schematics": {
|
||||
|
|
@ -129,6 +173,17 @@
|
|||
"@angular-devkit/core": "9.1.0",
|
||||
"ora": "4.0.3",
|
||||
"rxjs": "6.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@angular/animations": {
|
||||
|
|
@ -1427,6 +1482,17 @@
|
|||
"enhanced-resolve": "4.1.1",
|
||||
"rxjs": "6.5.4",
|
||||
"webpack-sources": "1.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@npmcli/ci-detect": {
|
||||
|
|
@ -1513,6 +1579,17 @@
|
|||
"rxjs": "6.5.4",
|
||||
"semver": "7.1.3",
|
||||
"semver-intersect": "1.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@tootallnate/once": {
|
||||
|
|
@ -1566,9 +1643,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "12.12.34",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.34.tgz",
|
||||
"integrity": "sha512-BneGN0J9ke24lBRn44hVHNeDlrXRYF+VRp0HbSUNnEZahXGAysHZIqnf/hER6aabdBgzM4YOV4jrR8gj4Zfi0g==",
|
||||
"version": "13.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz",
|
||||
"integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/q": {
|
||||
|
|
@ -6318,12 +6395,20 @@
|
|||
"dev": true
|
||||
},
|
||||
"jasmine-spec-reporter": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz",
|
||||
"integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==",
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-5.0.1.tgz",
|
||||
"integrity": "sha512-RrOZ+bSPnbk1/9KKs5lm0Nl0cqDCh/XXVlCmu3nkhEJH6HTDh4hoJZu3q8e9aq37C0eXEf/JEJnYy+t4m3arZQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colors": "1.1.2"
|
||||
"colors": "1.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"colors": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
|
||||
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"jasminewd2": {
|
||||
|
|
@ -6548,9 +6633,9 @@
|
|||
}
|
||||
},
|
||||
"karma-jasmine": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-3.0.3.tgz",
|
||||
"integrity": "sha512-80iBR8/hLFY2Uw3S2GG6EndWtMCGMJjrCYNwYROWsJFVTjWrRSsLqcA2ye+U3ygW5sjOQo8f+78L8cGUxjC/+A==",
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-3.1.1.tgz",
|
||||
"integrity": "sha512-pxBmv5K7IkBRLsFSTOpgiK/HzicQT3mfFF+oHAC7nxMfYKhaYFgxOa5qjnHW4sL5rUnmdkSajoudOnnOdPyW4Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jasmine-core": "^3.5.0"
|
||||
|
|
@ -9696,9 +9781,9 @@
|
|||
}
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"version": "6.5.5",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz",
|
||||
"integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
|
|
@ -11321,16 +11406,16 @@
|
|||
"dev": true
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz",
|
||||
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==",
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.2.tgz",
|
||||
"integrity": "sha512-duVj6BpSpUpD/oM4MfhO98ozgkp3Gt9qIp3jGxwU2DFvl/3IRaEAvbLa8G60uS7C77457e/m5TMowjedeRxI1Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arg": "^4.1.0",
|
||||
"diff": "^4.0.1",
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^3.0.0"
|
||||
"yn": "3.1.1"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
|
|
@ -11339,9 +11424,9 @@
|
|||
"integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA=="
|
||||
},
|
||||
"tslint": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.0.tgz",
|
||||
"integrity": "sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ==",
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz",
|
||||
"integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
|
|
@ -11352,7 +11437,7 @@
|
|||
"glob": "^7.1.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mkdirp": "^0.5.3",
|
||||
"resolve": "^1.3.2",
|
||||
"semver": "^5.3.0",
|
||||
"tslib": "^1.10.0",
|
||||
|
|
|
|||
|
|
@ -22,29 +22,29 @@
|
|||
"@fortawesome/fontawesome-free": "^5.13.0",
|
||||
"bulma": "^0.8.1",
|
||||
"ngx-filesize": "^2.0.13",
|
||||
"rxjs": "~6.5.4",
|
||||
"tslib": "^1.10.0",
|
||||
"zone.js": "~0.10.2"
|
||||
"rxjs": "~6.5.5",
|
||||
"tslib": "^1.11.1",
|
||||
"zone.js": "~0.10.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.901.0",
|
||||
"@angular/cli": "~9.1.0",
|
||||
"@angular/compiler-cli": "~9.1.0",
|
||||
"@angular/language-service": "~9.1.0",
|
||||
"@types/node": "^12.11.1",
|
||||
"@types/jasmine": "~3.5.0",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"codelyzer": "^5.1.2",
|
||||
"@types/node": "^13.11.0",
|
||||
"@types/jasmine": "~3.5.10",
|
||||
"@types/jasminewd2": "~2.0.8",
|
||||
"codelyzer": "^5.2.2",
|
||||
"jasmine-core": "~3.5.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"jasmine-spec-reporter": "~5.0.1",
|
||||
"karma": "~4.4.1",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.1.0",
|
||||
"karma-jasmine": "~3.0.1",
|
||||
"karma-jasmine-html-reporter": "^1.4.2",
|
||||
"karma-coverage-istanbul-reporter": "~2.1.1",
|
||||
"karma-jasmine": "~3.1.1",
|
||||
"karma-jasmine-html-reporter": "^1.5.3",
|
||||
"protractor": "~5.4.3",
|
||||
"ts-node": "~8.3.0",
|
||||
"tslint": "~6.1.0",
|
||||
"ts-node": "~8.8.2",
|
||||
"tslint": "~6.1.1",
|
||||
"typescript": "~3.8.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using RdtClient.Data.Enums;
|
||||
|
|
@ -35,12 +36,9 @@ namespace RdtClient.Data.Data
|
|||
.Include(m => m.Downloads)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var torrent in results)
|
||||
foreach (var file in results.SelectMany(torrent => torrent.Downloads))
|
||||
{
|
||||
foreach (var file in torrent.Downloads)
|
||||
{
|
||||
file.Torrent = null;
|
||||
}
|
||||
file.Torrent = null;
|
||||
}
|
||||
|
||||
return results;
|
||||
|
|
@ -53,9 +51,12 @@ namespace RdtClient.Data.Data
|
|||
.Include(m => m.Downloads)
|
||||
.FirstOrDefaultAsync(m => m.TorrentId == id);
|
||||
|
||||
foreach (var file in results.Downloads)
|
||||
if (results != null)
|
||||
{
|
||||
file.Torrent = null;
|
||||
foreach (var file in results.Downloads)
|
||||
{
|
||||
file.Torrent = null;
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
|
|
@ -68,9 +69,12 @@ namespace RdtClient.Data.Data
|
|||
.Include(m => m.Downloads)
|
||||
.FirstOrDefaultAsync(m => m.Hash == hash);
|
||||
|
||||
foreach (var file in results.Downloads)
|
||||
if (results != null)
|
||||
{
|
||||
file.Torrent = null;
|
||||
foreach (var file in results.Downloads)
|
||||
{
|
||||
file.Torrent = null;
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
|
|
|
|||
|
|
@ -79,14 +79,11 @@ namespace RdtClient.Service.Services
|
|||
|
||||
ActiveDownloads[download.DownloadId].Progress = (Int32) (fileStream.Length * 100 / responseLength);
|
||||
|
||||
if (DateTime.UtcNow > ActiveDownloads[download.DownloadId]
|
||||
.NextUpdate)
|
||||
if (DateTime.UtcNow > ActiveDownloads[download.DownloadId].NextUpdate)
|
||||
{
|
||||
ActiveDownloads[download.DownloadId].Speed = fileStream.Length - ActiveDownloads[download.DownloadId].BytesLastUpdate;
|
||||
ActiveDownloads[download.DownloadId].NextUpdate = DateTime.UtcNow.AddSeconds(1);
|
||||
ActiveDownloads[download.DownloadId].BytesLastUpdate = fileStream.Length;
|
||||
|
||||
Debug.WriteLine($"{fileStream.Length}/{responseLength} {ActiveDownloads[download.DownloadId].Speed}");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -255,10 +255,10 @@ namespace RdtClient.Service.Services
|
|||
NumSeeds = 100,
|
||||
Priority = ++prio,
|
||||
Progress = (Int64) (torrent.RdProgress / 100.0),
|
||||
Ratio = 9999,
|
||||
RatioLimit = -2,
|
||||
Ratio = 1,
|
||||
RatioLimit = 1,
|
||||
SavePath = savePath,
|
||||
SeedingTimeLimit = -2,
|
||||
SeedingTimeLimit = 1,
|
||||
SeenComplete = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
|
||||
SeqDl = false,
|
||||
Size = torrent.RdSize,
|
||||
|
|
@ -320,7 +320,7 @@ namespace RdtClient.Service.Services
|
|||
PiecesNum = torrent.Files.Count,
|
||||
Reannounce = 0,
|
||||
SavePath = savePath,
|
||||
SeedingTime = torrent.RdEnded.HasValue ? (Int32) (DateTimeOffset.UtcNow - torrent.RdEnded.Value).TotalSeconds : 0,
|
||||
SeedingTime = 1,
|
||||
Seeds = 100,
|
||||
SeedsTotal = 100,
|
||||
ShareRatio = 9999,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Hangfire;
|
||||
using RdtClient.Data.Enums;
|
||||
|
|
@ -53,10 +52,8 @@ namespace RdtClient.Service.Services
|
|||
return;
|
||||
}
|
||||
|
||||
var folderPath = Path.Combine(destinationFolderPath, download.Torrent.RdName);
|
||||
|
||||
download.Torrent = null;
|
||||
BackgroundJob.Enqueue(() => DownloadManager.Download(download, folderPath));
|
||||
BackgroundJob.Enqueue(() => DownloadManager.Download(download, destinationFolderPath));
|
||||
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
|
|
|
|||
12
server/RdtClient.Web/.config/dotnet-tools.json
Normal file
12
server/RdtClient.Web/.config/dotnet-tools.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-ef": {
|
||||
"version": "3.1.3",
|
||||
"commands": [
|
||||
"dotnet-ef"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ namespace RdtClient.Web.Controllers
|
|||
[AllowAnonymous]
|
||||
[Route("auth/login")]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> AuthLoginPost([FromBody] QBAuthLoginRequest request)
|
||||
public async Task<ActionResult> AuthLoginPost([FromForm] QBAuthLoginRequest request)
|
||||
{
|
||||
return await AuthLogin(request);
|
||||
}
|
||||
|
|
@ -72,7 +72,6 @@ namespace RdtClient.Web.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[Route("app/version")]
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
|
|
@ -81,7 +80,6 @@ namespace RdtClient.Web.Controllers
|
|||
return Ok("v4.2.3");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[Route("app/webapiVersion")]
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
|
|
@ -90,7 +88,6 @@ namespace RdtClient.Web.Controllers
|
|||
return Ok("2.4.1");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[Route("app/buildInfo")]
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
|
|
@ -202,7 +199,7 @@ namespace RdtClient.Web.Controllers
|
|||
[Authorize]
|
||||
[Route("torrents/properties")]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<IList<TorrentInfo>>> TorrentsPropertiesPost([FromBody] QBTorrentsHashRequest request)
|
||||
public async Task<ActionResult<IList<TorrentInfo>>> TorrentsPropertiesPost([FromForm] QBTorrentsHashRequest request)
|
||||
{
|
||||
return await TorrentsProperties(request);
|
||||
}
|
||||
|
|
@ -259,7 +256,7 @@ namespace RdtClient.Web.Controllers
|
|||
[Authorize]
|
||||
[Route("torrents/delete")]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> TorrentsDeletePost([FromBody] QBTorrentsDeleteRequest request)
|
||||
public async Task<ActionResult> TorrentsDeletePost([FromForm] QBTorrentsDeleteRequest request)
|
||||
{
|
||||
return await TorrentsDelete(request);
|
||||
}
|
||||
|
|
@ -289,7 +286,7 @@ namespace RdtClient.Web.Controllers
|
|||
[Authorize]
|
||||
[Route("torrents/add")]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> TorrentsAddPost([FromBody] QBTorrentsAddRequest request)
|
||||
public async Task<ActionResult> TorrentsAddPost([FromForm] QBTorrentsAddRequest request)
|
||||
{
|
||||
return await TorrentsAdd(request);
|
||||
}
|
||||
|
|
@ -319,7 +316,7 @@ namespace RdtClient.Web.Controllers
|
|||
[Authorize]
|
||||
[Route("torrents/setCategory")]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> TorrentsSetCategoryPost([FromBody] QBTorrentsSetCategoryRequest request)
|
||||
public async Task<ActionResult> TorrentsSetCategoryPost([FromForm] QBTorrentsSetCategoryRequest request)
|
||||
{
|
||||
return await TorrentsSetCategory(request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using RdtClient.Data.Models.Internal;
|
||||
|
||||
namespace RdtClient.Web
|
||||
{
|
||||
|
|
@ -9,22 +12,32 @@ namespace RdtClient.Web
|
|||
{
|
||||
public static void Main(String[] args)
|
||||
{
|
||||
CreateHostBuilder(args)
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory())
|
||||
.AddJsonFile("appsettings.json", true, false)
|
||||
.Build();
|
||||
|
||||
private static IHostBuilder CreateHostBuilder(String[] args)
|
||||
{
|
||||
return Host
|
||||
.CreateDefaultBuilder(args)
|
||||
var hostUrl = configuration["HostUrl"];
|
||||
|
||||
if (String.IsNullOrWhiteSpace(hostUrl))
|
||||
{
|
||||
hostUrl = "http://0.0.0.0:6500";
|
||||
}
|
||||
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>()
|
||||
.ConfigureLogging(logging =>
|
||||
{
|
||||
logging.ClearProviders();
|
||||
logging.AddConsole();
|
||||
logging.AddFile($"{AppContext.BaseDirectory}app.log");
|
||||
})
|
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
||||
.CaptureStartupErrors(false)
|
||||
.UseUrls(hostUrl)
|
||||
.UseKestrel()
|
||||
.UseIISIntegration()
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>False</ExcludeApp_Data>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<ProjectGuid>a8c7f095-89c6-4cd1-afb2-27106f470d62</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<publishUrl>bin\Release\netcoreapp3.1\publish\</publishUrl>
|
||||
<DeleteExistingFiles>True</DeleteExistingFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -17,12 +17,11 @@
|
|||
},
|
||||
"RdtClient.Web": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||
"applicationUrl": "http://localhost:6500"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="3.1.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="NReco.Logging.File" Version="1.0.5" />
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@ namespace RdtClient.Web
|
|||
});
|
||||
});
|
||||
|
||||
services.AddHttpsRedirection(options => { options.HttpsPort = 443; });
|
||||
|
||||
services.AddHttpClient();
|
||||
|
||||
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
|
||||
|
|
@ -104,10 +102,6 @@ namespace RdtClient.Web
|
|||
app.UseCors("Dev");
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseHttpsRedirection();
|
||||
}
|
||||
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@
|
|||
"MaxRollingFiles": 5
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"HostUrl": "http://0.0.0.0:6500"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1,13 @@
|
|||
Test
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Real-Debrid Torrent Client</title>
|
||||
<base href="/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
<link rel="stylesheet" href="styles.8d1160aad8efbde1424d.css"></head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
<script src="runtime-es2015.c9afb3256f2870e161de.js" type="module"></script><script src="runtime-es5.c9afb3256f2870e161de.js" nomodule defer></script><script src="polyfills-es5.0e4e1968447fab48e788.js" nomodule defer></script><script src="polyfills-es2015.bbb42ff2e1c488ff52d5.js" type="module"></script><script src="main-es2015.949c41a1b6780ff9f3a9.js" type="module"></script><script src="main-es5.949c41a1b6780ff9f3a9.js" nomodule defer></script></body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in a new issue