Fixed some issues, first release beta.

This commit is contained in:
Roger Far 2020-04-07 18:40:58 -06:00
parent c96ce980d5
commit 76b8513d6b
19 changed files with 222 additions and 86 deletions

3
.gitignore vendored
View file

@ -38,3 +38,6 @@ server/*.user
# Common node modules locations # Common node modules locations
server/wwwroot/ server/wwwroot/
server/.vs server/.vs
server/RdtClient.Web/wwwroot/
server/RdtClient.Web/Properties/PublishProfiles/FolderProfile.pubxml.user
*.user

View file

@ -1,6 +1,6 @@
{ {
"/Api": { "/Api": {
"target": "http://localhost:4201/", "target": "http://localhost:6500/",
"secure": false "secure": false
} }
} }

View file

@ -17,7 +17,7 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-devkit/build-angular:browser",
"options": { "options": {
"outputPath": "dist/rdt-client", "outputPath": "../server/RdtClient.Web/wwwroot",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",

127
client/package-lock.json generated
View file

@ -12,6 +12,17 @@
"requires": { "requires": {
"@angular-devkit/core": "9.1.0", "@angular-devkit/core": "9.1.0",
"rxjs": "6.5.4" "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": { "@angular-devkit/build-angular": {
@ -81,6 +92,17 @@
"webpack-sources": "1.4.3", "webpack-sources": "1.4.3",
"webpack-subresource-integrity": "1.4.0", "webpack-subresource-integrity": "1.4.0",
"worker-plugin": "4.0.2" "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": { "@angular-devkit/build-optimizer": {
@ -105,6 +127,17 @@
"@angular-devkit/architect": "0.901.0", "@angular-devkit/architect": "0.901.0",
"@angular-devkit/core": "9.1.0", "@angular-devkit/core": "9.1.0",
"rxjs": "6.5.4" "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": { "@angular-devkit/core": {
@ -118,6 +151,17 @@
"magic-string": "0.25.7", "magic-string": "0.25.7",
"rxjs": "6.5.4", "rxjs": "6.5.4",
"source-map": "0.7.3" "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": { "@angular-devkit/schematics": {
@ -129,6 +173,17 @@
"@angular-devkit/core": "9.1.0", "@angular-devkit/core": "9.1.0",
"ora": "4.0.3", "ora": "4.0.3",
"rxjs": "6.5.4" "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": { "@angular/animations": {
@ -1427,6 +1482,17 @@
"enhanced-resolve": "4.1.1", "enhanced-resolve": "4.1.1",
"rxjs": "6.5.4", "rxjs": "6.5.4",
"webpack-sources": "1.4.3" "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": { "@npmcli/ci-detect": {
@ -1513,6 +1579,17 @@
"rxjs": "6.5.4", "rxjs": "6.5.4",
"semver": "7.1.3", "semver": "7.1.3",
"semver-intersect": "1.4.0" "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": { "@tootallnate/once": {
@ -1566,9 +1643,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "12.12.34", "version": "13.11.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.34.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz",
"integrity": "sha512-BneGN0J9ke24lBRn44hVHNeDlrXRYF+VRp0HbSUNnEZahXGAysHZIqnf/hER6aabdBgzM4YOV4jrR8gj4Zfi0g==", "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==",
"dev": true "dev": true
}, },
"@types/q": { "@types/q": {
@ -6318,12 +6395,20 @@
"dev": true "dev": true
}, },
"jasmine-spec-reporter": { "jasmine-spec-reporter": {
"version": "4.2.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-5.0.1.tgz",
"integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", "integrity": "sha512-RrOZ+bSPnbk1/9KKs5lm0Nl0cqDCh/XXVlCmu3nkhEJH6HTDh4hoJZu3q8e9aq37C0eXEf/JEJnYy+t4m3arZQ==",
"dev": true, "dev": true,
"requires": { "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": { "jasminewd2": {
@ -6548,9 +6633,9 @@
} }
}, },
"karma-jasmine": { "karma-jasmine": {
"version": "3.0.3", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-3.0.3.tgz", "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-3.1.1.tgz",
"integrity": "sha512-80iBR8/hLFY2Uw3S2GG6EndWtMCGMJjrCYNwYROWsJFVTjWrRSsLqcA2ye+U3ygW5sjOQo8f+78L8cGUxjC/+A==", "integrity": "sha512-pxBmv5K7IkBRLsFSTOpgiK/HzicQT3mfFF+oHAC7nxMfYKhaYFgxOa5qjnHW4sL5rUnmdkSajoudOnnOdPyW4Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"jasmine-core": "^3.5.0" "jasmine-core": "^3.5.0"
@ -9696,9 +9781,9 @@
} }
}, },
"rxjs": { "rxjs": {
"version": "6.5.4", "version": "6.5.5",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz",
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==",
"requires": { "requires": {
"tslib": "^1.9.0" "tslib": "^1.9.0"
} }
@ -11321,16 +11406,16 @@
"dev": true "dev": true
}, },
"ts-node": { "ts-node": {
"version": "8.3.0", "version": "8.8.2",
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.2.tgz",
"integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", "integrity": "sha512-duVj6BpSpUpD/oM4MfhO98ozgkp3Gt9qIp3jGxwU2DFvl/3IRaEAvbLa8G60uS7C77457e/m5TMowjedeRxI1Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"arg": "^4.1.0", "arg": "^4.1.0",
"diff": "^4.0.1", "diff": "^4.0.1",
"make-error": "^1.1.1", "make-error": "^1.1.1",
"source-map-support": "^0.5.6", "source-map-support": "^0.5.6",
"yn": "^3.0.0" "yn": "3.1.1"
} }
}, },
"tslib": { "tslib": {
@ -11339,9 +11424,9 @@
"integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA=="
}, },
"tslint": { "tslint": {
"version": "6.1.0", "version": "6.1.1",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.0.tgz", "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz",
"integrity": "sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ==", "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
@ -11352,7 +11437,7 @@
"glob": "^7.1.1", "glob": "^7.1.1",
"js-yaml": "^3.13.1", "js-yaml": "^3.13.1",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.3",
"resolve": "^1.3.2", "resolve": "^1.3.2",
"semver": "^5.3.0", "semver": "^5.3.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",

View file

@ -22,29 +22,29 @@
"@fortawesome/fontawesome-free": "^5.13.0", "@fortawesome/fontawesome-free": "^5.13.0",
"bulma": "^0.8.1", "bulma": "^0.8.1",
"ngx-filesize": "^2.0.13", "ngx-filesize": "^2.0.13",
"rxjs": "~6.5.4", "rxjs": "~6.5.5",
"tslib": "^1.10.0", "tslib": "^1.11.1",
"zone.js": "~0.10.2" "zone.js": "~0.10.3"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.901.0", "@angular-devkit/build-angular": "~0.901.0",
"@angular/cli": "~9.1.0", "@angular/cli": "~9.1.0",
"@angular/compiler-cli": "~9.1.0", "@angular/compiler-cli": "~9.1.0",
"@angular/language-service": "~9.1.0", "@angular/language-service": "~9.1.0",
"@types/node": "^12.11.1", "@types/node": "^13.11.0",
"@types/jasmine": "~3.5.0", "@types/jasmine": "~3.5.10",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.8",
"codelyzer": "^5.1.2", "codelyzer": "^5.2.2",
"jasmine-core": "~3.5.0", "jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~5.0.1",
"karma": "~4.4.1", "karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0", "karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0", "karma-coverage-istanbul-reporter": "~2.1.1",
"karma-jasmine": "~3.0.1", "karma-jasmine": "~3.1.1",
"karma-jasmine-html-reporter": "^1.4.2", "karma-jasmine-html-reporter": "^1.5.3",
"protractor": "~5.4.3", "protractor": "~5.4.3",
"ts-node": "~8.3.0", "ts-node": "~8.8.2",
"tslint": "~6.1.0", "tslint": "~6.1.1",
"typescript": "~3.8.3" "typescript": "~3.8.3"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 948 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using RdtClient.Data.Enums; using RdtClient.Data.Enums;
@ -35,12 +36,9 @@ namespace RdtClient.Data.Data
.Include(m => m.Downloads) .Include(m => m.Downloads)
.ToListAsync(); .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; return results;
@ -53,9 +51,12 @@ namespace RdtClient.Data.Data
.Include(m => m.Downloads) .Include(m => m.Downloads)
.FirstOrDefaultAsync(m => m.TorrentId == id); .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; return results;
@ -68,9 +69,12 @@ namespace RdtClient.Data.Data
.Include(m => m.Downloads) .Include(m => m.Downloads)
.FirstOrDefaultAsync(m => m.Hash == hash); .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; return results;

View file

@ -79,14 +79,11 @@ namespace RdtClient.Service.Services
ActiveDownloads[download.DownloadId].Progress = (Int32) (fileStream.Length * 100 / responseLength); ActiveDownloads[download.DownloadId].Progress = (Int32) (fileStream.Length * 100 / responseLength);
if (DateTime.UtcNow > ActiveDownloads[download.DownloadId] if (DateTime.UtcNow > ActiveDownloads[download.DownloadId].NextUpdate)
.NextUpdate)
{ {
ActiveDownloads[download.DownloadId].Speed = fileStream.Length - ActiveDownloads[download.DownloadId].BytesLastUpdate; ActiveDownloads[download.DownloadId].Speed = fileStream.Length - ActiveDownloads[download.DownloadId].BytesLastUpdate;
ActiveDownloads[download.DownloadId].NextUpdate = DateTime.UtcNow.AddSeconds(1); ActiveDownloads[download.DownloadId].NextUpdate = DateTime.UtcNow.AddSeconds(1);
ActiveDownloads[download.DownloadId].BytesLastUpdate = fileStream.Length; ActiveDownloads[download.DownloadId].BytesLastUpdate = fileStream.Length;
Debug.WriteLine($"{fileStream.Length}/{responseLength} {ActiveDownloads[download.DownloadId].Speed}");
} }
} }
else else

View file

@ -255,10 +255,10 @@ namespace RdtClient.Service.Services
NumSeeds = 100, NumSeeds = 100,
Priority = ++prio, Priority = ++prio,
Progress = (Int64) (torrent.RdProgress / 100.0), Progress = (Int64) (torrent.RdProgress / 100.0),
Ratio = 9999, Ratio = 1,
RatioLimit = -2, RatioLimit = 1,
SavePath = savePath, SavePath = savePath,
SeedingTimeLimit = -2, SeedingTimeLimit = 1,
SeenComplete = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), SeenComplete = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
SeqDl = false, SeqDl = false,
Size = torrent.RdSize, Size = torrent.RdSize,
@ -320,7 +320,7 @@ namespace RdtClient.Service.Services
PiecesNum = torrent.Files.Count, PiecesNum = torrent.Files.Count,
Reannounce = 0, Reannounce = 0,
SavePath = savePath, SavePath = savePath,
SeedingTime = torrent.RdEnded.HasValue ? (Int32) (DateTimeOffset.UtcNow - torrent.RdEnded.Value).TotalSeconds : 0, SeedingTime = 1,
Seeds = 100, Seeds = 100,
SeedsTotal = 100, SeedsTotal = 100,
ShareRatio = 9999, ShareRatio = 9999,

View file

@ -1,5 +1,4 @@
using System.IO; using System.Linq;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Hangfire; using Hangfire;
using RdtClient.Data.Enums; using RdtClient.Data.Enums;
@ -53,10 +52,8 @@ namespace RdtClient.Service.Services
return; return;
} }
var folderPath = Path.Combine(destinationFolderPath, download.Torrent.RdName);
download.Torrent = null; download.Torrent = null;
BackgroundJob.Enqueue(() => DownloadManager.Download(download, folderPath)); BackgroundJob.Enqueue(() => DownloadManager.Download(download, destinationFolderPath));
await Task.Delay(1000); await Task.Delay(1000);
} }

View file

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "3.1.3",
"commands": [
"dotnet-ef"
]
}
}
}

View file

@ -50,7 +50,7 @@ namespace RdtClient.Web.Controllers
[AllowAnonymous] [AllowAnonymous]
[Route("auth/login")] [Route("auth/login")]
[HttpPost] [HttpPost]
public async Task<ActionResult> AuthLoginPost([FromBody] QBAuthLoginRequest request) public async Task<ActionResult> AuthLoginPost([FromForm] QBAuthLoginRequest request)
{ {
return await AuthLogin(request); return await AuthLogin(request);
} }
@ -72,7 +72,6 @@ namespace RdtClient.Web.Controllers
} }
} }
[Authorize]
[Route("app/version")] [Route("app/version")]
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
@ -81,7 +80,6 @@ namespace RdtClient.Web.Controllers
return Ok("v4.2.3"); return Ok("v4.2.3");
} }
[Authorize]
[Route("app/webapiVersion")] [Route("app/webapiVersion")]
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
@ -90,7 +88,6 @@ namespace RdtClient.Web.Controllers
return Ok("2.4.1"); return Ok("2.4.1");
} }
[Authorize]
[Route("app/buildInfo")] [Route("app/buildInfo")]
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
@ -202,7 +199,7 @@ namespace RdtClient.Web.Controllers
[Authorize] [Authorize]
[Route("torrents/properties")] [Route("torrents/properties")]
[HttpPost] [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); return await TorrentsProperties(request);
} }
@ -259,7 +256,7 @@ namespace RdtClient.Web.Controllers
[Authorize] [Authorize]
[Route("torrents/delete")] [Route("torrents/delete")]
[HttpPost] [HttpPost]
public async Task<ActionResult> TorrentsDeletePost([FromBody] QBTorrentsDeleteRequest request) public async Task<ActionResult> TorrentsDeletePost([FromForm] QBTorrentsDeleteRequest request)
{ {
return await TorrentsDelete(request); return await TorrentsDelete(request);
} }
@ -289,7 +286,7 @@ namespace RdtClient.Web.Controllers
[Authorize] [Authorize]
[Route("torrents/add")] [Route("torrents/add")]
[HttpPost] [HttpPost]
public async Task<ActionResult> TorrentsAddPost([FromBody] QBTorrentsAddRequest request) public async Task<ActionResult> TorrentsAddPost([FromForm] QBTorrentsAddRequest request)
{ {
return await TorrentsAdd(request); return await TorrentsAdd(request);
} }
@ -319,7 +316,7 @@ namespace RdtClient.Web.Controllers
[Authorize] [Authorize]
[Route("torrents/setCategory")] [Route("torrents/setCategory")]
[HttpPost] [HttpPost]
public async Task<ActionResult> TorrentsSetCategoryPost([FromBody] QBTorrentsSetCategoryRequest request) public async Task<ActionResult> TorrentsSetCategoryPost([FromForm] QBTorrentsSetCategoryRequest request)
{ {
return await TorrentsSetCategory(request); return await TorrentsSetCategory(request);
} }

View file

@ -1,7 +1,10 @@
using System; using System;
using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using RdtClient.Data.Models.Internal;
namespace RdtClient.Web namespace RdtClient.Web
{ {
@ -9,22 +12,32 @@ namespace RdtClient.Web
{ {
public static void Main(String[] args) public static void Main(String[] args)
{ {
CreateHostBuilder(args) var configuration = new ConfigurationBuilder()
.Build() .SetBasePath(Directory.GetCurrentDirectory())
.Run(); .AddJsonFile("appsettings.json", true, false)
} .Build();
private static IHostBuilder CreateHostBuilder(String[] args) var hostUrl = configuration["HostUrl"];
{
return Host if (String.IsNullOrWhiteSpace(hostUrl))
.CreateDefaultBuilder(args) {
hostUrl = "http://0.0.0.0:6500";
}
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureLogging(logging => .ConfigureLogging(logging =>
{ {
logging.ClearProviders(); logging.ClearProviders();
logging.AddConsole(); logging.AddConsole();
logging.AddFile($"{AppContext.BaseDirectory}app.log"); logging.AddFile($"{AppContext.BaseDirectory}app.log");
}) })
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); .CaptureStartupErrors(false)
.UseUrls(hostUrl)
.UseKestrel()
.UseIISIntegration()
.Build()
.Run();
} }
} }
} }

View file

@ -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>

View file

@ -17,12 +17,11 @@
}, },
"RdtClient.Web": { "RdtClient.Web": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true,
"launchUrl": "weatherforecast", "launchUrl": "weatherforecast",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
}, },
"applicationUrl": "https://localhost:5001;http://localhost:5000" "applicationUrl": "http://localhost:6500"
} }
} }
} }

View file

@ -17,6 +17,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="3.1.3" /> <PackageReference Include="Microsoft.Extensions.Identity.Core" Version="3.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NReco.Logging.File" Version="1.0.5" /> <PackageReference Include="NReco.Logging.File" Version="1.0.5" />

View file

@ -54,8 +54,6 @@ namespace RdtClient.Web
}); });
}); });
services.AddHttpsRedirection(options => { options.HttpsPort = 443; });
services.AddHttpClient(); services.AddHttpClient();
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
@ -104,10 +102,6 @@ namespace RdtClient.Web
app.UseCors("Dev"); app.UseCors("Dev");
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
else
{
app.UseHttpsRedirection();
}
app.Use(async (context, next) => app.Use(async (context, next) =>
{ {

View file

@ -13,5 +13,6 @@
"MaxRollingFiles": 5 "MaxRollingFiles": 5
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*",
"HostUrl": "http://0.0.0.0:6500"
} }

View file

@ -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>