Compare commits
980 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
858bd7c95c | ||
|
|
2822653d3b | ||
|
|
e8a86cf806 | ||
|
|
38530cd6fd | ||
|
|
a7fb1e3e9d | ||
|
|
5c8a078927 | ||
|
|
f369e97d6e | ||
|
|
a9013e0c2a | ||
|
|
c6f6008591 | ||
|
|
b8e467652b | ||
|
|
e1635a43a9 | ||
|
|
f5cee6e2f3 | ||
|
|
767038528a | ||
|
|
a82e895a03 | ||
|
|
68edd4d80d | ||
|
|
d6f747c8d8 | ||
|
|
4eb34cbef9 | ||
|
|
5b7b526390 | ||
|
|
49ab603708 | ||
|
|
1166e9ba99 | ||
|
|
a86056a3ef | ||
|
|
1645320199 | ||
|
|
0e00062992 | ||
|
|
157fc8b2f2 | ||
|
|
45279115dc | ||
|
|
489bf6d7e0 | ||
|
|
5518e7f06b | ||
|
|
84cbd5056f | ||
|
|
c769bd08f0 | ||
|
|
8142225ee9 | ||
|
|
284ef44e30 | ||
|
|
fe6a2da266 | ||
|
|
8e49e500ea | ||
|
|
b292df22fe | ||
|
|
7aa6c03fee | ||
|
|
62e286104a | ||
|
|
bd48ea02a0 | ||
|
|
bc9fb89ecb | ||
|
|
d68b8b9bfe | ||
|
|
cc977cfe29 | ||
|
|
4afee6938b | ||
|
|
6a4603617b | ||
|
|
a62d84779e | ||
|
|
6c5d1fb39d | ||
|
|
f5ea1e0f10 | ||
|
|
75ad8e848d | ||
|
|
2d8983050d | ||
|
|
cd1310c1e9 | ||
|
|
7c1169d0dd | ||
|
|
9ea2219df7 | ||
|
|
fd5ece0e4d | ||
|
|
8c7c384bce | ||
|
|
7f60f9de5a | ||
|
|
5d09053327 | ||
|
|
f2bfae5f85 | ||
|
|
3d21ca245c | ||
|
|
d6bf1845d8 | ||
|
|
147b1db4a5 | ||
|
|
b037809c0e | ||
|
|
32aa57a561 | ||
|
|
4dd6ae5626 | ||
|
|
4920700853 | ||
|
|
1efc682cca | ||
|
|
28b7c79a6b | ||
|
|
797c58e654 | ||
|
|
63fd8caee9 | ||
|
|
5c71ecc211 | ||
|
|
145ea9a8ff | ||
|
|
d576ee7f01 | ||
|
|
8664993ff6 | ||
|
|
2627e03e97 | ||
|
|
9c4ddb66ad | ||
|
|
0abdde346d | ||
|
|
ea9fc0b167 | ||
|
|
75e02cfb82 | ||
|
|
59cff632eb | ||
|
|
53f985d80d | ||
|
|
f717f18f8e | ||
|
|
d4e1502c60 | ||
|
|
5054ca4ae1 | ||
|
|
66bd4560a8 | ||
|
|
683ac44c12 | ||
|
|
351e1eb7c8 | ||
|
|
390ab390da | ||
|
|
042b1e32e4 | ||
|
|
095a25f04a | ||
|
|
a4706a5830 | ||
|
|
cf278e2964 | ||
|
|
0d6369750f | ||
|
|
76dc3e0b98 | ||
|
|
e2195944e4 | ||
|
|
004ed45144 | ||
|
|
6743bd472e | ||
|
|
1dd7ab9c8e | ||
|
|
c0bbab5fa4 | ||
|
|
41787077db | ||
|
|
67afe189b5 | ||
|
|
b7090eeb3a | ||
|
|
0b726792cb | ||
|
|
7ec977b36e | ||
|
|
a7dd01eb42 | ||
|
|
178270084e | ||
|
|
2743089b3f | ||
|
|
41f816ab80 | ||
|
|
81dd3dd9f8 | ||
|
|
0af0b41bb8 | ||
|
|
e01cd6a979 | ||
|
|
480d881d92 | ||
|
|
11ccf5a2d4 | ||
|
|
b7df2bfb15 | ||
|
|
7c94528847 | ||
|
|
f4e1cf4717 | ||
|
|
d023bddd24 | ||
|
|
8e5238844e | ||
|
|
9e69020df8 | ||
|
|
bcb24e3bfd | ||
|
|
e36a5a07e5 | ||
|
|
db511929cd | ||
|
|
6dedb621d1 | ||
|
|
2db2af4cea | ||
|
|
3eda321d64 | ||
|
|
f32e8316e2 | ||
|
|
0ca2517eb6 | ||
|
|
6d0cb6ceb5 | ||
|
|
f2dab9f6e1 | ||
|
|
ed397f8223 | ||
|
|
a023d33d90 | ||
|
|
6572ba752c | ||
|
|
ccee652572 | ||
|
|
d6020594ef | ||
|
|
d0242f235c | ||
|
|
991ecefe3c | ||
|
|
33d8c2d825 | ||
|
|
f25cef711b | ||
|
|
40be170677 | ||
|
|
a5f9cd353b | ||
|
|
e93e4f6f22 | ||
|
|
d76d26131c | ||
|
|
580c7132c6 | ||
|
|
e51e5cde45 | ||
|
|
a68eec1bfa | ||
|
|
0c5e38e01a | ||
|
|
7aca0eaedd | ||
|
|
da576ef2c4 | ||
|
|
01a26c614b | ||
|
|
871802ad34 | ||
|
|
0f8921e1fb | ||
|
|
6b85d7bbbc | ||
|
|
25c06ab6fc | ||
|
|
ca325aaac1 | ||
|
|
99b2ad8e27 | ||
|
|
b539e8933e | ||
|
|
a9648248f4 | ||
|
|
24321a55c9 | ||
|
|
028c9f06ec | ||
|
|
b74b5dd7a9 | ||
|
|
42ebd2c74b | ||
|
|
9454ea1bd1 | ||
|
|
6cef70b979 | ||
|
|
15af54ed24 | ||
|
|
47355030b5 | ||
|
|
a7bb8da1d5 | ||
|
|
371a13e060 | ||
|
|
e606501834 | ||
|
|
6db556ed5c | ||
|
|
f12f28a8bb | ||
|
|
57ea1b3881 | ||
|
|
ed218d76ce | ||
|
|
27398ba993 | ||
|
|
994f167ab3 | ||
|
|
c51f8cb503 | ||
|
|
1080143fce | ||
|
|
90c1092fe5 | ||
|
|
123c4f29c6 | ||
|
|
dadab50840 | ||
|
|
eb80e9083b | ||
|
|
02a97f3170 | ||
|
|
2e8a7ce080 | ||
|
|
48f00e0459 | ||
|
|
21dd80a061 | ||
|
|
044e04c694 | ||
|
|
f3d0b31fea | ||
|
|
25032a4e65 | ||
|
|
d9858409db | ||
|
|
30b9b9a4ad | ||
|
|
1be3e98ad7 | ||
|
|
6bc9c06faa | ||
|
|
1fe407ba5a | ||
|
|
6d57aafcfe | ||
|
|
3bc657dbb2 | ||
|
|
0461058d86 | ||
|
|
a24928f9eb | ||
|
|
a7cab6d0dc | ||
|
|
6909fb3851 | ||
|
|
f5f2760f80 | ||
|
|
08c1750def | ||
|
|
aa512d1a33 | ||
|
|
3626f8cb97 | ||
|
|
6277a4ca5e | ||
|
|
e48f1d91a4 | ||
|
|
2e7c97d023 | ||
|
|
2b95b8d714 | ||
|
|
c1e48d35a5 | ||
|
|
4fb9e972f5 | ||
|
|
070d80a6fa | ||
|
|
ed354e93a9 | ||
|
|
9d0528902a | ||
|
|
cb29187f72 | ||
|
|
32fe929f48 | ||
|
|
60263ca685 | ||
|
|
63322f3b94 | ||
|
|
98042f8040 | ||
|
|
479239c94d | ||
|
|
4be3280c3a | ||
|
|
1973b73b3c | ||
|
|
bb9cc67ff7 | ||
|
|
452d8cc1cf | ||
|
|
408c475af5 | ||
|
|
2e04129b00 | ||
|
|
80a8a1020c | ||
|
|
a06e0202d9 | ||
|
|
d989e4a497 | ||
|
|
4801b94c64 | ||
|
|
772816ced0 | ||
|
|
2a38d43a1b | ||
|
|
6ec3b1072b | ||
|
|
f131726cce | ||
|
|
b7efb78814 | ||
|
|
a5d0f7b564 | ||
|
|
a0cbe54152 | ||
|
|
75202ed5a9 | ||
|
|
f93109cc27 | ||
|
|
e17c8c5c1a | ||
|
|
5de0bac9d5 | ||
|
|
ae66b40a3d | ||
|
|
e6a22f6780 | ||
|
|
ba821ebc2f | ||
|
|
e7c2b42bd2 | ||
|
|
ea3839514d | ||
|
|
9319f099fa | ||
|
|
fed6d022f8 | ||
|
|
94e9a8ccd0 | ||
|
|
e28749e465 | ||
|
|
757d112d01 | ||
|
|
6faa064d94 | ||
|
|
a306500d76 | ||
|
|
1d707940a8 | ||
|
|
e6686aa35d | ||
|
|
d8da1a47a7 | ||
|
|
0265a48aa8 | ||
|
|
4f770d923a | ||
|
|
fa499395bd | ||
|
|
8929ba19d2 | ||
|
|
40df762c90 | ||
|
|
7154cc55cf | ||
|
|
03459d0129 | ||
|
|
5ba630ff52 | ||
|
|
a4f20fd3a4 | ||
|
|
e10de75494 | ||
|
|
995fb1c6cf | ||
|
|
447b48dcf1 | ||
|
|
b620e29209 | ||
|
|
b1d40e6891 | ||
|
|
fcbc0b0b35 | ||
|
|
49ad0f185f | ||
|
|
11c341b7f8 | ||
|
|
fab14f1f3f | ||
|
|
a2f031e757 | ||
|
|
c40ea173fa | ||
|
|
2009ed6ec9 | ||
|
|
827e94ca89 | ||
|
|
a1a4e1031d | ||
|
|
87efa9dc00 | ||
|
|
a25cd62ab0 | ||
|
|
781937dc8f | ||
|
|
b4385bcaad | ||
|
|
ea4a25ed93 | ||
|
|
b0061abdeb | ||
|
|
5270375f5c | ||
|
|
1db70100e2 | ||
|
|
15d7e7b0cc | ||
|
|
d436ea2482 | ||
|
|
c651d21e81 | ||
|
|
a9485827ce | ||
|
|
1dff00c3f1 | ||
|
|
478cc0e714 | ||
|
|
75f115fd42 | ||
|
|
1ce3d20541 | ||
|
|
770e32c2cb | ||
|
|
88358c8272 | ||
|
|
ab3ff4a064 | ||
|
|
2e028ed17c | ||
|
|
ba8dacd01c | ||
|
|
c34eaf2968 | ||
|
|
8117d61566 | ||
|
|
80da992d5d | ||
|
|
84d144ed7b | ||
|
|
a660a86bb4 | ||
|
|
f5317de9de | ||
|
|
ef4245006c | ||
|
|
282ebe4a5e | ||
|
|
b0676d31d2 | ||
|
|
158f4587e2 | ||
|
|
953e208b18 | ||
|
|
6f67f38600 | ||
|
|
aa3f24ff50 | ||
|
|
3f4fb6d20a | ||
|
|
d267a3451a | ||
|
|
3780a954a2 | ||
|
|
99ea3f008f | ||
|
|
5a1b96b909 | ||
|
|
9841ab6399 | ||
|
|
720696f5ec | ||
|
|
2fbfc43f6c | ||
|
|
38c8c57672 | ||
|
|
f70ddb87b6 | ||
|
|
c7020f1056 | ||
|
|
605868fe70 | ||
|
|
53a1407ef8 | ||
|
|
b3f45ece20 | ||
|
|
091b976b9b | ||
|
|
83cd14f807 | ||
|
|
7340fb3183 | ||
|
|
3d4e656121 | ||
|
|
2eddeaecb7 | ||
|
|
67b699605a | ||
|
|
d4d2689772 | ||
|
|
2be825e248 | ||
|
|
0b7749376a | ||
|
|
7eb1a610b4 | ||
|
|
74e6d2cf95 | ||
|
|
9fa0252624 | ||
|
|
4459706e79 | ||
|
|
e9c4544d34 | ||
|
|
ab5a013edb | ||
|
|
e6f7db0763 | ||
|
|
609c67e0c6 | ||
|
|
aa6e6c7df5 | ||
|
|
b4bb775617 | ||
|
|
93fac23128 | ||
|
|
afc7d1a964 | ||
|
|
7a822bef5c | ||
|
|
7d1aeed85c | ||
|
|
bd96795f34 | ||
|
|
9d57466472 | ||
|
|
fd7bc529c8 | ||
|
|
bf023b333b | ||
|
|
7019c79814 | ||
|
|
6b211c6e7c | ||
|
|
9525498671 | ||
|
|
edf443adfc | ||
|
|
10176357e4 | ||
|
|
ea9c90552b | ||
|
|
087653e5b6 | ||
|
|
85a0e7b04f | ||
|
|
dc9c7ff050 | ||
|
|
469f1dbbad | ||
|
|
b6cd6ceddd | ||
|
|
f68911e9c2 | ||
|
|
b333c738be | ||
|
|
d6efff2fb5 | ||
|
|
c50afe9e64 | ||
|
|
0cc15d26c3 | ||
|
|
7615883fdb | ||
|
|
2b2c5462f1 | ||
|
|
88af15b3bc | ||
|
|
e776236270 | ||
|
|
983e357a01 | ||
|
|
d4ba114772 | ||
|
|
f21fd6d8f3 | ||
|
|
2ae3b85dac | ||
|
|
097ea93410 | ||
|
|
f8587d1bc8 | ||
|
|
818d9f06b2 | ||
|
|
a366328472 | ||
|
|
193b195218 | ||
|
|
207767dbce | ||
|
|
309a91ace2 | ||
|
|
794eec8666 | ||
|
|
5c987a9057 | ||
|
|
13bb353644 | ||
|
|
861854b4f1 | ||
|
|
680904cb94 | ||
|
|
e9becefb1c | ||
|
|
1034f342ed | ||
|
|
9cf28d8274 | ||
|
|
1abaeb598e | ||
|
|
0fd3f2a467 | ||
|
|
706be01a40 | ||
|
|
d40e686845 | ||
|
|
765a5b0543 | ||
|
|
2b6e51b5cf | ||
|
|
537845ea80 | ||
|
|
2944101657 | ||
|
|
816c72f418 | ||
|
|
a02fcc6c1e | ||
|
|
b95dbcc824 | ||
|
|
7d8e6eb788 | ||
|
|
0dc9d687b9 | ||
|
|
8d7552609b | ||
|
|
d11900a127 | ||
|
|
4a5be33247 | ||
|
|
91ee1f8462 | ||
|
|
e06c1efb6a | ||
|
|
b4f950bc7c | ||
|
|
49e3155f9c | ||
|
|
2846be3a33 | ||
|
|
6b7e9b2943 | ||
|
|
d683c45dbd | ||
|
|
85d6b820f3 | ||
|
|
3fc44163a9 | ||
|
|
7436e2d036 | ||
|
|
115a1dcc56 | ||
|
|
a4b95923b2 | ||
|
|
f0310e2b00 | ||
|
|
ee62bc3098 | ||
|
|
206d3c56cb | ||
|
|
0ec9a2bbbe | ||
|
|
d292fbaee8 | ||
|
|
8e1f61472a | ||
|
|
439b266946 | ||
|
|
66f0ae0e7c | ||
|
|
5a78125053 | ||
|
|
29914138aa | ||
|
|
c43be84507 | ||
|
|
1d15b0d651 | ||
|
|
e0264a6e29 | ||
|
|
95ef1f42b8 | ||
|
|
f4ca137e83 | ||
|
|
3dee900be6 | ||
|
|
2bbbf0fd10 | ||
|
|
c546bd0173 | ||
|
|
fd073b4762 | ||
|
|
daf8a9c6da | ||
|
|
95307f2933 | ||
|
|
fe241db5db | ||
|
|
7c3c1fb24c | ||
|
|
9299314b14 | ||
|
|
e5e64e6946 | ||
|
|
1ac325e8c9 | ||
|
|
3b8f14cc1a | ||
|
|
311156f0aa | ||
|
|
f8505edf7f | ||
|
|
09d929db17 | ||
|
|
f57ee1e53d | ||
|
|
56c25770c3 | ||
|
|
7b4facd46f | ||
|
|
c005bda484 | ||
|
|
f58b7d3e72 | ||
|
|
780d0e5118 | ||
|
|
82b44cccde | ||
|
|
26f1f26cd1 | ||
|
|
9e223de32e | ||
|
|
f1bdc7d8b4 | ||
|
|
48766e3d44 | ||
|
|
56a61ad012 | ||
|
|
303244127b | ||
|
|
f2207be000 | ||
|
|
20fbf8833a | ||
|
|
d6d1813340 | ||
|
|
7902f56d66 | ||
|
|
4198b6ab55 | ||
|
|
a9cd30364e | ||
|
|
ce14a1d62e | ||
|
|
59c47bfe1a | ||
|
|
dc2ec486d7 | ||
|
|
a566f47988 | ||
|
|
24c759e4e6 | ||
|
|
809903eebb | ||
|
|
ef8142453f | ||
|
|
0a705e6720 | ||
|
|
f379d4efb8 | ||
|
|
881c74f2b7 | ||
|
|
0c9de86531 | ||
|
|
82f0bb8bbe | ||
|
|
beb0299a0b | ||
|
|
1e749a9bfe | ||
|
|
062787143f | ||
|
|
eeef6fb7fe | ||
|
|
85e07f3c90 | ||
|
|
db1760b36e | ||
|
|
ce223d3e2c | ||
|
|
3ed80909de | ||
|
|
b8c183c079 | ||
|
|
e449bd7928 | ||
|
|
353b9ca07b | ||
|
|
b33ecd6b1c | ||
|
|
735912da5d | ||
|
|
7d2d7fa35f | ||
|
|
00e499593e | ||
|
|
d6305c26f8 | ||
|
|
56934e3183 | ||
|
|
38a3bc1537 | ||
|
|
8fe277fa52 | ||
|
|
7b97ab8cd2 | ||
|
|
ee9e80f7d2 | ||
|
|
d5ee5d209c | ||
|
|
d43774d9b5 | ||
|
|
e700939cfa | ||
|
|
268bb6826c | ||
|
|
79164d54ca | ||
|
|
c958b4960b | ||
|
|
0026541dca | ||
|
|
8518cc1e10 | ||
|
|
34aec3d45d | ||
|
|
8205e0e652 | ||
|
|
409e47920e | ||
|
|
fa0f535858 | ||
|
|
065afe9461 | ||
|
|
6afef14855 | ||
|
|
78daeeeaf3 | ||
|
|
e21dc7279a | ||
|
|
9a2d59afe0 | ||
|
|
f5c528645d | ||
|
|
1ad3dc51dd | ||
|
|
ea364eefc5 | ||
|
|
98c4b2ae9b | ||
|
|
1a27be8309 | ||
|
|
adc976067d | ||
|
|
e92b197ddb | ||
|
|
ac6300a504 | ||
|
|
9d03c20aaa | ||
|
|
350185b702 | ||
|
|
a1599ee716 | ||
|
|
f9335be163 | ||
|
|
346982fe8d | ||
|
|
3364deecbb | ||
|
|
dffce96a45 | ||
|
|
c34c62f879 | ||
|
|
1a9a0ddf3c | ||
|
|
4351c7541c | ||
|
|
a91ea71dcb | ||
|
|
165d83361b | ||
|
|
a335ce2bdd | ||
|
|
99c30bbc4f | ||
|
|
8b16bd8ee2 | ||
|
|
8bd83dffbf | ||
|
|
116ca29131 | ||
|
|
d932089b90 | ||
|
|
f33380e77b | ||
|
|
ee5b5f8dc3 | ||
|
|
7573492bcf | ||
|
|
c9c4b4550b | ||
|
|
154b6187e7 | ||
|
|
b12f6812cf | ||
|
|
ec4e160288 | ||
|
|
b78f0cdd95 | ||
|
|
3bae4501a5 | ||
|
|
5e52e2dd8c | ||
|
|
c562e75a97 | ||
|
|
d15b1a2c01 | ||
|
|
c6beedf675 | ||
|
|
fcbd9d8096 | ||
|
|
9104197000 | ||
|
|
047326a30f | ||
|
|
df084bcebe | ||
|
|
194b9fd2a3 | ||
|
|
446b1c0180 | ||
|
|
6bac21b426 | ||
|
|
0987b1f18c | ||
|
|
320c52c4be | ||
|
|
35f959ee26 | ||
|
|
96bc3308f6 | ||
|
|
8266e53435 | ||
|
|
b66b864cae | ||
|
|
b1f93d1892 | ||
|
|
af87a1e6e6 | ||
|
|
078bbe4bfb | ||
|
|
cc52f5f7f5 | ||
|
|
fae983237a | ||
|
|
f65e3fb405 | ||
|
|
227c8efeaf | ||
|
|
4a5c9a1169 | ||
|
|
78df45a159 | ||
|
|
70584d1acb | ||
|
|
91dcdb9d7c | ||
|
|
e20dd84e1d | ||
|
|
e60059a5bd | ||
|
|
183798db2d | ||
|
|
754588091d | ||
|
|
c34f91fc27 | ||
|
|
395f83847e | ||
|
|
fc9ea4c29a | ||
|
|
6d4440de20 | ||
|
|
bb354b6a36 | ||
|
|
c1e165c14c | ||
|
|
02113a43dd | ||
|
|
788fe654be | ||
|
|
7a8a0946d1 | ||
|
|
a356632d50 | ||
|
|
772631d47f | ||
|
|
258a4ae34b | ||
|
|
8dd0eec654 | ||
|
|
343d2d078c | ||
|
|
617ae547cf | ||
|
|
2ec3a3b5ca | ||
|
|
297816d671 | ||
|
|
86eaccd439 | ||
|
|
2bf1c997d8 | ||
|
|
06c034f18a | ||
|
|
73823233fd | ||
|
|
a79e0849d6 | ||
|
|
06a667918e | ||
|
|
6a984cc145 | ||
|
|
d5aaad866b | ||
|
|
5cf73e97af | ||
|
|
dbb502a164 | ||
|
|
0bfb4974d8 | ||
|
|
eb21211a0c | ||
|
|
ed8637931d | ||
|
|
05dd562be1 | ||
|
|
8972db8938 | ||
|
|
ba94039b24 | ||
|
|
acb57dc1ea | ||
|
|
575ae6af5a | ||
|
|
d36b9cf889 | ||
|
|
367e195ed6 | ||
|
|
949bd7cfd2 | ||
|
|
22ea602fea | ||
|
|
d6e549bb67 | ||
|
|
c44ed2a51c | ||
|
|
508e2f1d7f | ||
|
|
bec2dcd20b | ||
|
|
c21d578a23 | ||
|
|
e5dfb0e027 | ||
|
|
45c805eb00 | ||
|
|
3b72463663 | ||
|
|
74b988effa | ||
|
|
d172da80b5 | ||
|
|
995cee66f3 | ||
|
|
716d89680d | ||
|
|
2ef0ddc0b7 | ||
|
|
99a29ca6a8 | ||
|
|
eef7267390 | ||
|
|
2f05e7f60e | ||
|
|
4fb0a8d726 | ||
|
|
f96ef294a7 | ||
|
|
74423b49e9 | ||
|
|
b0823f596d | ||
|
|
ed01900f69 | ||
|
|
a78ff95643 | ||
|
|
71e1aae5ab | ||
|
|
e85366f874 | ||
|
|
6c47ebcfad | ||
|
|
c95f0171f7 | ||
|
|
486cea1006 | ||
|
|
54f1d23181 | ||
|
|
f80f041eeb | ||
|
|
a5709ae52e | ||
|
|
48097f1eb8 | ||
|
|
70aae02d55 | ||
|
|
de9045d3f6 | ||
|
|
2e03ad35f4 | ||
|
|
1817bd7508 | ||
|
|
3b21f830f1 | ||
|
|
d0f7c9fb37 | ||
|
|
d99a9e00ed | ||
|
|
c83982a4d4 | ||
|
|
47f8c587af | ||
|
|
3cfb3cfdbb | ||
|
|
22ba9c7ce6 | ||
|
|
6b0265716e | ||
|
|
dfd97b2c3c | ||
|
|
388411748a | ||
|
|
12eefa028b | ||
|
|
95574847e9 | ||
|
|
2b39f92106 | ||
|
|
8114baa7b8 | ||
|
|
6ad51b036e | ||
|
|
d01cb71866 | ||
|
|
ba243d3e83 | ||
|
|
2cea7ed292 | ||
|
|
ba3a12e305 | ||
|
|
f4e7a9bcf7 | ||
|
|
32dfca5fb1 | ||
|
|
d1042f62f4 | ||
|
|
5b82a2102a | ||
|
|
e87d5af7ee | ||
|
|
d4a7ef3a83 | ||
|
|
30f334088f | ||
|
|
4837f92fa4 | ||
|
|
81c735b3f1 | ||
|
|
dc0541eabf | ||
|
|
c349cd2613 | ||
|
|
1693120d7b | ||
|
|
9f4a34b20e | ||
|
|
cf4527b6c9 | ||
|
|
562ecef75d | ||
|
|
9a5d3e9935 | ||
|
|
a176bf8891 | ||
|
|
21490ee2d5 | ||
|
|
5089690f4e | ||
|
|
ca463fa9fd | ||
|
|
b8e45417b5 | ||
|
|
ee0a631cd9 | ||
|
|
7122dff9e6 | ||
|
|
5a8ab0789a | ||
|
|
d463e690c5 | ||
|
|
c771662629 | ||
|
|
fe77391e7f | ||
|
|
3db5cd7060 | ||
|
|
3488d83af4 | ||
|
|
8d16f7fc57 | ||
|
|
ffa59b5d4c | ||
|
|
2c8eee24c4 | ||
|
|
89a6a748cf | ||
|
|
5c3d357019 | ||
|
|
6ad6da5679 | ||
|
|
89efa76f76 | ||
|
|
9488eae8d1 | ||
|
|
199296dc57 | ||
|
|
f84e698c5b | ||
|
|
56a81cb764 | ||
|
|
67617aa969 | ||
|
|
b8aa834dd1 | ||
|
|
fe0c3a1643 | ||
|
|
7f2e49ab54 | ||
|
|
4bea2f444f | ||
|
|
b0a0772931 | ||
|
|
4b71eec834 | ||
|
|
86fdf23eb8 | ||
|
|
d1da1d7ca5 | ||
|
|
9410b0c83b | ||
|
|
3b9a68c92f | ||
|
|
ee88fb50f5 | ||
|
|
a1e9b00d2d | ||
|
|
1b082c3cd1 | ||
|
|
c1ba030f22 | ||
|
|
db0880b843 | ||
|
|
cb291ad3b0 | ||
|
|
824c107a9f | ||
|
|
418465480a | ||
|
|
0a36a3fd20 | ||
|
|
cac5a3b3fc | ||
|
|
14a7a6373f | ||
|
|
acfe320b8b | ||
|
|
7732649b4b | ||
|
|
8418b26d70 | ||
|
|
dbfc348945 | ||
|
|
37fa505f68 | ||
|
|
5cde1fb154 | ||
|
|
297b61ec61 | ||
|
|
e9c83e30da | ||
|
|
05225c6acc | ||
|
|
8b8943c3c5 | ||
|
|
e1d7c07598 | ||
|
|
2e711ba735 | ||
|
|
ffa5e274b7 | ||
|
|
8595e797b6 | ||
|
|
f165b07421 | ||
|
|
87fd07940f | ||
|
|
7b6f323c84 | ||
|
|
9f711611d7 | ||
|
|
1b9702d59a | ||
|
|
2f30cb5223 | ||
|
|
7616637612 | ||
|
|
f01774fb7d | ||
|
|
2e8ed68ba5 | ||
|
|
43172f2355 | ||
|
|
0326bb277a | ||
|
|
d55bb3ce23 | ||
|
|
158720e114 | ||
|
|
0d9792787e | ||
|
|
db30217509 | ||
|
|
36b4dc2317 | ||
|
|
8b6de76321 | ||
|
|
cb2fa9f155 | ||
|
|
503af68d07 | ||
|
|
ff0c8061b5 | ||
|
|
7974e33fc2 | ||
|
|
caabc769e4 | ||
|
|
b7a6920517 | ||
|
|
311ba78b88 | ||
|
|
c550e47c2b | ||
|
|
0814d2266d | ||
|
|
1c2837008d | ||
|
|
c4ff8acbc0 | ||
|
|
6d65de6f5f | ||
|
|
998ddb05ac | ||
|
|
3974189c5e | ||
|
|
e25e86ed0e | ||
|
|
9d64693c66 | ||
|
|
263557a576 | ||
|
|
e36d04c108 | ||
|
|
805233d73b | ||
|
|
b6c79d32a7 | ||
|
|
729b1a2a31 | ||
|
|
ab64e5dcbd | ||
|
|
56050877e7 | ||
|
|
46f6e06572 | ||
|
|
ee9ce2840b | ||
|
|
f96ba0d20d | ||
|
|
1d959bd7a4 | ||
|
|
a5aab5a358 | ||
|
|
bde0ad591e | ||
|
|
297216dea5 | ||
|
|
187a428ba7 | ||
|
|
95306264fd | ||
|
|
799a7ce83b | ||
|
|
43da8c2220 | ||
|
|
0855366afe | ||
|
|
a775364bfb | ||
|
|
dc5dcbb2d2 | ||
|
|
b33cb7ae21 | ||
|
|
6be9583968 | ||
|
|
95e55e8971 | ||
|
|
8d84b8af79 | ||
|
|
61707108b1 | ||
|
|
a67cca0f2d | ||
|
|
a2e2bb1378 | ||
|
|
599fc5011a | ||
|
|
78408278af | ||
|
|
0247eac9e0 | ||
|
|
3b507730e4 | ||
|
|
aac570f697 | ||
|
|
bd5d96d2c3 | ||
|
|
9a278d4fd3 | ||
|
|
007e154d8d | ||
|
|
e3b38d2834 | ||
|
|
e65942adb7 | ||
|
|
fc15569e1b | ||
|
|
3fe9680e35 | ||
|
|
cd6002b5d6 | ||
|
|
2cff8ec0a6 | ||
|
|
bcffa7ac8c | ||
|
|
dcea8dcc1a | ||
|
|
2d40f0fd0f | ||
|
|
f25d849cfa | ||
|
|
38ca2a199a | ||
|
|
a54075a533 | ||
|
|
6ca403f7f2 | ||
|
|
d4cb09e1a3 | ||
|
|
f75ac43e49 | ||
|
|
aae367d673 | ||
|
|
5cb095de3c | ||
|
|
70a230aa1d | ||
|
|
0f0fc91b64 | ||
|
|
ffecb8507a | ||
|
|
17bd28ed23 | ||
|
|
97d1b519bd | ||
|
|
4040b98176 | ||
|
|
dc16108983 | ||
|
|
05df0cb558 | ||
|
|
d7b22ab433 | ||
|
|
6a2533aa3b | ||
|
|
25f8c70b17 | ||
|
|
444c547b15 | ||
|
|
7cc5de61fb | ||
|
|
8d036847f3 | ||
|
|
d0ef259cae | ||
|
|
2dd5810320 | ||
|
|
5de11cea6e | ||
|
|
be73e1b543 | ||
|
|
3fdad6b2f5 | ||
|
|
24deccccec | ||
|
|
6a569e7264 | ||
|
|
831c7a49e7 | ||
|
|
cdef655a00 | ||
|
|
763ce5a036 | ||
|
|
b9320be928 | ||
|
|
eb39a88e78 | ||
|
|
f1bb018381 | ||
|
|
6e225812b2 | ||
|
|
4d5dfc34a4 | ||
|
|
4dbd2cf8df | ||
|
|
52b5aa1b09 | ||
|
|
4837c5c673 | ||
|
|
b9889dbbc3 | ||
|
|
8774243d2f | ||
|
|
723cc82b11 | ||
|
|
dd8102b0b6 | ||
|
|
b3dd856410 | ||
|
|
a0d000138c | ||
|
|
075f494ec6 | ||
|
|
0d5d28483b | ||
|
|
799316413a | ||
|
|
5fa5f416c7 | ||
|
|
5d58bc9082 | ||
|
|
d16e7f0c88 | ||
|
|
545e476d80 | ||
|
|
6ac0265d2d | ||
|
|
e9e16bedf0 | ||
|
|
0f4d896e53 | ||
|
|
11c65d0017 | ||
|
|
337b70ba01 | ||
|
|
9583eeeeb0 | ||
|
|
c90c336e70 | ||
|
|
ae41865bb2 | ||
|
|
399456c815 | ||
|
|
d6327e44b6 | ||
|
|
0d6304a237 | ||
|
|
1a326ab0bb | ||
|
|
c728e17bb3 | ||
|
|
b8b50ca55a | ||
|
|
dbdf2acc9c | ||
|
|
9947a4dc97 | ||
|
|
a15a36ccd9 | ||
|
|
cd8e3b14dd | ||
|
|
55560a865a | ||
|
|
6cf8b32ba9 | ||
|
|
732e8d9691 | ||
|
|
a8dc196dfe | ||
|
|
7931568803 | ||
|
|
06b4422ab8 | ||
|
|
1f754daf1f | ||
|
|
05e565ff1f | ||
|
|
a121593829 | ||
|
|
e4c001b0ce | ||
|
|
697cd58023 | ||
|
|
553d46c68d | ||
|
|
ca17db4f5e | ||
|
|
3ee687f615 | ||
|
|
fa11dc9bc7 | ||
|
|
4daa5ba4dc | ||
|
|
3e832cc416 | ||
|
|
e4d522b00e | ||
|
|
0e1e547c71 | ||
|
|
3a2d33435e | ||
|
|
16dfda50b9 | ||
|
|
a77e42f91b | ||
|
|
4a87a57a65 | ||
|
|
34422d7167 | ||
|
|
fa9c839be0 | ||
|
|
94804d7cba | ||
|
|
0e2cb36080 | ||
|
|
f63758521a | ||
|
|
a3ea5c61f2 | ||
|
|
71c9eb17fb | ||
|
|
f151312d47 | ||
|
|
a01137daf4 | ||
|
|
9fae26e21d | ||
|
|
bf3ba9dc64 | ||
|
|
3380bc6820 | ||
|
|
97b94900fd | ||
|
|
5e490e8b0d | ||
|
|
7872836ae7 | ||
|
|
9a7aefaa71 | ||
|
|
1f50cda389 | ||
|
|
75875af36a | ||
|
|
5bdf224e1b | ||
|
|
fe3b7d8867 | ||
|
|
659675d538 | ||
|
|
3cc3c1eeda | ||
|
|
24aa54319d | ||
|
|
ad5e5b48ce | ||
|
|
058e67b03e | ||
|
|
e6a261dfd6 | ||
|
|
6a1c2a1f0f | ||
|
|
cc7abc82ba | ||
|
|
fbcfdfc8f5 | ||
|
|
8ea3f0ecaf | ||
|
|
32cb03a5b3 | ||
|
|
49beb60894 | ||
|
|
9c236bbe67 | ||
|
|
3037179a27 | ||
|
|
04d580bc5c | ||
|
|
2cb81e2c41 | ||
|
|
a15c2473c5 | ||
|
|
c4a7c1e5ed | ||
|
|
d7c6c36118 | ||
|
|
58a80e45e1 | ||
|
|
1764bdc803 | ||
|
|
c7e3e14fab | ||
|
|
0489ab1115 | ||
|
|
8817d8df3b | ||
|
|
3e1b30ad1a | ||
|
|
8b85521839 | ||
|
|
2a258dcf58 | ||
|
|
2659759d59 | ||
|
|
5265a8b442 | ||
|
|
e291989ace | ||
|
|
bbf2217718 | ||
|
|
e22e5bbeab | ||
|
|
e4411e8fa1 | ||
|
|
290ed4c7de | ||
|
|
fda4727439 | ||
|
|
5803ee306d | ||
|
|
58a6fafbc2 | ||
|
|
426ff20273 | ||
|
|
d46e6f8997 |
338 changed files with 49417 additions and 18970 deletions
14
.devcontainer/Dockerfile
Normal file
14
.devcontainer/Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
FROM mcr.microsoft.com/devcontainers/dotnet:2-10.0-noble
|
||||
|
||||
ARG NODE_MAJOR=22
|
||||
ARG ANGULAR_CLI_VERSION=21
|
||||
|
||||
RUN curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR}.x" | bash - \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends nodejs sqlite3 \
|
||||
&& npm install -g "@angular/cli@^${ANGULAR_CLI_VERSION}" \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir -p /data/db /data/downloads \
|
||||
&& chown -R vscode:vscode /data
|
||||
51
.devcontainer/devcontainer.json
Normal file
51
.devcontainer/devcontainer.json
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"name": "rdt-client",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
"NODE_MAJOR": "22"
|
||||
}
|
||||
},
|
||||
"remoteUser": "vscode",
|
||||
"runArgs": ["--init"],
|
||||
"containerEnv": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"BASE_PATH": "",
|
||||
"DOTNET_USE_POLLING_FILE_WATCHER": "1",
|
||||
"CHOKIDAR_USEPOLLING": "true"
|
||||
},
|
||||
"forwardPorts": [4200, 6500],
|
||||
"portsAttributes": {
|
||||
"4200": {
|
||||
"label": "Angular client",
|
||||
"onAutoForward": "notify"
|
||||
},
|
||||
"6500": {
|
||||
"label": "RdtClient backend",
|
||||
"onAutoForward": "silent"
|
||||
}
|
||||
},
|
||||
"mounts": [
|
||||
"source=rdtclient-data-db,target=/data/db,type=volume",
|
||||
"source=rdtclient-data-downloads,target=/data/downloads,type=volume",
|
||||
"source=rdtclient-nuget,target=/home/vscode/.nuget,type=volume",
|
||||
"source=rdtclient-npm-cache,target=/home/vscode/.npm,type=volume"
|
||||
],
|
||||
"postCreateCommand": "/bin/bash .devcontainer/post-create.sh",
|
||||
"postStartCommand": "/bin/bash .devcontainer/post-start.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp",
|
||||
"ms-dotnettools.csdevkit",
|
||||
"Angular.ng-template",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode"
|
||||
],
|
||||
"settings": {
|
||||
"dotnet.defaultSolution": "server/RdtClient.sln",
|
||||
"terminal.integrated.defaultProfile.linux": "zsh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
.devcontainer/post-create.sh
Executable file
16
.devcontainer/post-create.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
sudo install -d -m 0775 -o vscode -g vscode \
|
||||
/data/db \
|
||||
/data/downloads \
|
||||
/home/vscode/.nuget \
|
||||
/home/vscode/.nuget/NuGet \
|
||||
/home/vscode/.nuget/packages \
|
||||
/home/vscode/.npm
|
||||
|
||||
sudo chown -R vscode:vscode /data /home/vscode/.nuget /home/vscode/.npm
|
||||
|
||||
dotnet restore server/RdtClient.sln
|
||||
npm install --prefix client
|
||||
13
.devcontainer/post-start.sh
Executable file
13
.devcontainer/post-start.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
sudo install -d -m 0775 -o vscode -g vscode \
|
||||
/data/db \
|
||||
/data/downloads \
|
||||
/home/vscode/.nuget \
|
||||
/home/vscode/.nuget/NuGet \
|
||||
/home/vscode/.nuget/packages \
|
||||
/home/vscode/.npm
|
||||
|
||||
sudo chown -R vscode:vscode /data /home/vscode/.nuget /home/vscode/.npm
|
||||
|
|
@ -37,4 +37,4 @@ server/**/.vs
|
|||
server/RdtClient.Web/wwwroot/
|
||||
|
||||
build/
|
||||
publish/
|
||||
publish/data
|
||||
|
|
|
|||
20
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Use this template to report actual bugs. If you are looking for general help, please post a discussion.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**What version are you using?**
|
||||
|
||||
**What OS are you running?**
|
||||
|
||||
**Are you using Docker or as a service?**
|
||||
|
||||
**Which debrid provider are you using?**
|
||||
|
||||
**Which downloader are you using?**
|
||||
|
||||
**Please attach a log file here with the log setting set to debug**
|
||||
141
.github/workflows/build-docker-image.yml
vendored
Normal file
141
.github/workflows/build-docker-image.yml
vendored
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
name: Release Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
env:
|
||||
APP_NAME: rdtclient
|
||||
DOCKER_FILE: ./Dockerfile
|
||||
ENABLE_DOCKERHUB: 1
|
||||
ENABLE_GHCR: 1
|
||||
|
||||
concurrency: ${{ github.sha }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
outputs:
|
||||
digest-amd64: ${{ steps.digest.outputs.digest-amd64 }}
|
||||
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- arch: amd64
|
||||
runs-on: ubuntu-latest
|
||||
platform: linux/amd64
|
||||
- arch: arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
platform: linux/arm64
|
||||
runs-on: ${{ matrix.config.runs-on }}
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Extract version and patch .csproj
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME#v}"
|
||||
sed -i "s|<Version>.*</Version>|<Version>$VERSION</Version>|" server/RdtClient.Web/RdtClient.Web.csproj
|
||||
sed -i "s|<AssemblyVersion>.*</AssemblyVersion>|<AssemblyVersion>$VERSION</AssemblyVersion>|" server/RdtClient.Web/RdtClient.Web.csproj
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: ${{ env.ENABLE_DOCKERHUB == 1 }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GHCR
|
||||
if: ${{ env.ENABLE_GHCR == 1 }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker Metadata action
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}
|
||||
ghcr.io/${{ github.repository_owner }}/${{ env.APP_NAME }}
|
||||
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}
|
||||
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
- name: Export digest
|
||||
id: digest
|
||||
run: |
|
||||
echo "digest-${{ matrix.config.arch }}=${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
push-images:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
if: ${{ env.ENABLE_DOCKERHUB == 1 }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GHCR
|
||||
if: ${{ env.ENABLE_GHCR == 1 }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker Metadata action
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}
|
||||
ghcr.io/${{ github.repository_owner }}/${{ env.APP_NAME }}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
|
||||
- name: Create manifest list and push
|
||||
run: |
|
||||
docker buildx imagetools create \
|
||||
$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< '${{ steps.meta.outputs.json }}') \
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}@${{ needs.build.outputs.digest-amd64 }} \
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}@${{ needs.build.outputs.digest-arm64 }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Docker Hub Registry Description
|
||||
if: ${{ env.ENABLE_DOCKERHUB == 1 }}
|
||||
uses: peter-evans/dockerhub-description@v4
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}
|
||||
short-description: |
|
||||
A web interface to manage your torrents on debrid providers.
|
||||
readme-filepath: ./README-DOCKER.md
|
||||
99
.github/workflows/build-release.yaml
vendored
Normal file
99
.github/workflows/build-release.yaml
vendored
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
name: Create GitHub Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test, Build, and Bundle
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
|
||||
- name: Set up .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: '10'
|
||||
|
||||
- name: Install Frontend Dependencies
|
||||
working-directory: client
|
||||
run: npm install
|
||||
|
||||
- name: Build Frontend
|
||||
working-directory: client
|
||||
run: npm run build
|
||||
|
||||
- name: Restore Backend Dependencies
|
||||
working-directory: server
|
||||
run: dotnet restore
|
||||
|
||||
- name: Build and Publish Backend
|
||||
working-directory: server
|
||||
shell: pwsh
|
||||
run: |
|
||||
$v = "${{ github.ref_name }}".TrimStart('v')
|
||||
dotnet build -c Release --no-restore -p:Version=$v -p:AssemblyVersion=$v
|
||||
dotnet publish RdtClient.Web/RdtClient.Web.csproj -c Release --no-build -p:Version=$v -p:AssemblyVersion=$v -o ../publish
|
||||
|
||||
- name: Create ZIP
|
||||
shell: pwsh
|
||||
run: Compress-Archive -Path publish\* -DestinationPath RealDebridClient.zip
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RealDebridClient.zip
|
||||
path: RealDebridClient.zip
|
||||
|
||||
release:
|
||||
name: Create GitHub release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Strip 'v' from tag
|
||||
id: version
|
||||
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get latest release info
|
||||
id: query-release-info
|
||||
uses: release-flow/keep-a-changelog-action@v2
|
||||
with:
|
||||
command: query
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: RealDebridClient.zip
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: ${{ github.ref_name }}
|
||||
body: ${{ steps.query-release-info.outputs.release-notes }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: RealDebridClient.zip
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
24
.github/workflows/dotnet-test.yml
vendored
Normal file
24
.github/workflows/dotnet-test.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: dotnet test
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v5
|
||||
with:
|
||||
dotnet-version: 10.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore server
|
||||
- name: Build
|
||||
run: dotnet build --no-restore server
|
||||
- name: Test
|
||||
run: dotnet test --no-build --verbosity normal server
|
||||
44
.gitignore
vendored
44
.gitignore
vendored
|
|
@ -1,41 +1,11 @@
|
|||
### Angular ###
|
||||
# compiled output
|
||||
client/dist/
|
||||
client/tmp/
|
||||
client/app/**/*.js
|
||||
client/app/**/*.js.map
|
||||
|
||||
# dependencies
|
||||
client/node_modules/
|
||||
client/bower_components/
|
||||
|
||||
# IDEs and editors
|
||||
client/.idea/
|
||||
|
||||
# misc
|
||||
client/.sass-cache/
|
||||
client/connect.lock/
|
||||
client/coverage/
|
||||
client/libpeerconnection.log/
|
||||
client/npm-debug.log
|
||||
client/testem.log
|
||||
client/typings/
|
||||
|
||||
# e2e
|
||||
client/e2e/*.js
|
||||
client/e2e/*.map
|
||||
|
||||
#System Files
|
||||
**/.DS_Store/
|
||||
|
||||
### DotnetCore ###
|
||||
# .NET Core build folders
|
||||
server/**/bin
|
||||
server/**/obj
|
||||
server/**/*.user
|
||||
server/**/.vs
|
||||
server/RdtClient.Web/wwwroot/
|
||||
|
||||
build/
|
||||
publish/
|
||||
server/Downloader/
|
||||
node_modules/
|
||||
RealDebridClient.zip
|
||||
server/RdtClient.Web/appsettings.Development.json
|
||||
data
|
||||
Dockerfile.dev
|
||||
test.bat
|
||||
.DS_Store
|
||||
|
|
|
|||
983
CHANGELOG.md
Normal file
983
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,983 @@
|
|||
# Changelog
|
||||
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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased
|
||||
|
||||
## [2.0.138] - 2026-06-05
|
||||
### Fixed
|
||||
- SABnzbd fixes.
|
||||
|
||||
## [2.0.137] - 2026-06-05
|
||||
### Fixed
|
||||
- Fix torbox save path mapping for single file downloads.
|
||||
|
||||
## [2.0.136] - 2026-05-30
|
||||
### Added
|
||||
- Added devcontainer development workflow.
|
||||
|
||||
### Changed
|
||||
- Upgraded torbox.net dependency.
|
||||
|
||||
## [2.0.135] - 2026-05-27
|
||||
### Changed
|
||||
- When adding a torrent through the qBittorrent endpoints, it will wait to see if the torrent gets added properly or errors out, resulting in a better experience for infringing files and Sonarr / Radarr.
|
||||
- Upgraded torbox.net dependency.
|
||||
- Support SABnzbd API key auth, thanks to @ALenfant!
|
||||
|
||||
## [2.0.134] - 2026-05-22
|
||||
### Changed
|
||||
- Upgraded torbox.net dependency.
|
||||
|
||||
## [2.0.133] - 2026-05-17
|
||||
### Added
|
||||
- Added NZB support for Premiumize, thanks to @ALenfant!
|
||||
|
||||
## [2.0.132] - 2026-05-17
|
||||
### Changed
|
||||
- Fixed for Cleanuparr
|
||||
- Upgrade Torbox.NET dependency
|
||||
|
||||
## [2.0.131] - 2026-05-14
|
||||
### Changed
|
||||
- Fixes to the rate limiting.
|
||||
|
||||
## [2.0.130] - 2026-04-28
|
||||
### Changed
|
||||
- Fixes to unit tests
|
||||
- Upgraded .NET and Angular dependencies
|
||||
- Added better qBittorrent capabilities for Cleanuparr
|
||||
- Performance fixes
|
||||
|
||||
## [2.0.129] - 2026-04-06
|
||||
### Added
|
||||
- Optimized mobile views, thanks to @sylvaindd!
|
||||
|
||||
## [2.0.128] - 2026-04-06
|
||||
### Changed
|
||||
- Fixed some qBittorrent endpoints.
|
||||
|
||||
## [2.0.127] - 2026-03-15
|
||||
### Added
|
||||
- Implement qBittorrent endpoint for counting torrents, thanks to @vinodmishra!
|
||||
|
||||
## [2.0.126] - 2026-03-14
|
||||
### Added
|
||||
- qBittorrent hash filtering on the /torrrents/info endpoint, thanks to @jfrconley!
|
||||
- Category select as a dropdown when adding a new torrent, thanks to @sylvaindd!
|
||||
|
||||
### Changed
|
||||
- Rate limiting fixes, thanks to @omgbeez!
|
||||
- AllDebrid Symlink fixes, thanks to @AlexandreVassard!
|
||||
|
||||
## [2.0.125] - 2026-03-01
|
||||
### Added
|
||||
- Added extra qBittorrent endpoints for Cleanuparr compatibility.
|
||||
|
||||
## [2.0.124] - 2026-02-23
|
||||
### Added
|
||||
- Added /version/api for qBittorrent to support clients that still want to talk to the old API.
|
||||
- Improved rate limiting handling.
|
||||
|
||||
## [2.0.123] - 2026-02-21
|
||||
### Changed
|
||||
- Reverted SharpCompress to 0.42.1 due to file locking issues.
|
||||
|
||||
## [2.0.122] - 2026-02-21
|
||||
### Added
|
||||
- Sort torrents by added date by default, remember sort order in the browser.
|
||||
|
||||
### Changed
|
||||
- Fixed ETA calculations.
|
||||
- Fixed Torrentbox statuses.
|
||||
- Fixed download progress reports.
|
||||
- Fixed NZB delete actions.
|
||||
|
||||
## [2.0.121] - 2026-02-18
|
||||
### Added
|
||||
- NZB/Usernet support thanks to @omgbeez!
|
||||
|
||||
### Changed
|
||||
- Make some qBittorrent endpoints accessible without authentication.
|
||||
- Improved ETA calculations.
|
||||
- Few performance improvements when the download page has a lot of torrents.
|
||||
- Performance improvements for the sqlite connection.
|
||||
|
||||
## [2.0.120] - 2026-02-11
|
||||
### Changed
|
||||
- Upgrade to .NET 10.
|
||||
- Upgrade to Angular 21.
|
||||
|
||||
## [2.0.119] - 2025-10-13
|
||||
### Removed
|
||||
- Removed internal downloader from the GUI.
|
||||
|
||||
## [2.0.118] - 2025-10-06
|
||||
### Added
|
||||
- Added some fake qBittorrent API calls for decluttarr.
|
||||
|
||||
## [2.0.117] - 2025-10-06
|
||||
### Removed
|
||||
- Removed internal downloader and migrated to the Bezzad downloader.
|
||||
|
||||
## [2.0.116] - 2025-08-04
|
||||
### Added
|
||||
- Added setting to ban certain trackers from being added. Will filter by the torrent source or announcement urls.
|
||||
|
||||
### Changed
|
||||
- Upgraded to Angular 20.
|
||||
|
||||
## [2.0.115] - 2025-07-28
|
||||
### Added
|
||||
- Added setting to delay the finish action.
|
||||
|
||||
### Fixed
|
||||
- Make sure the Real-Debrid provider times out when trying to add a new torrent.
|
||||
|
||||
## [2.0.114] - 2025-06-21
|
||||
### Added
|
||||
- Add Select All functionality to the delete dialog in individual torrent screen, thanks @mentalblank
|
||||
- Add setting to add a list of trackers (from a URL) to every torrent and magnet that's added to rdt-client, thanks @mentalblank
|
||||
|
||||
### Changed
|
||||
- The `User-Agent` header is now set on all requests to debrid providers' APIs.
|
||||
|
||||
## [2.0.113] - 2025-05-22
|
||||
### Fixed
|
||||
- Revert Synolog.Api.Client because of breaking changes.
|
||||
|
||||
## [2.0.112] - 2025-05-18
|
||||
### Added
|
||||
- Add ability to disable the built in unpacking process by setting the "Maximum unpack processes" to 0.
|
||||
|
||||
### Changed
|
||||
- Upgraded Angular to use control flow.
|
||||
|
||||
### Fixed
|
||||
- Fixed dequeing issue.
|
||||
- Fixed logging handler for ProviderUpdater.
|
||||
|
||||
## [2.0.111] - 2025-05-03
|
||||
### Added
|
||||
- Added button to register rdt-client as a handler for magnet links on [supported browsers](https://caniuse.com/mdn-api_navigator_registerprotocolhandler_scheme_parameter_magnet).
|
||||
|
||||
## [2.0.110] - 2025-04-24
|
||||
### Fixed
|
||||
- Fixed build number in the app.
|
||||
|
||||
## [2.0.109] - 2025-04-23
|
||||
### Fixed
|
||||
- Debrid Queue fixes (don't auto delete queued torrents, handle errors when dequeueing).
|
||||
- Censor download station password when logging settings at startup.
|
||||
- Set `HostDownloadAction` when auto-importing torrents.
|
||||
- Build GitHub release .zip on windows not linux.
|
||||
- Use arm GitHub Actions runner to build arm docker image.
|
||||
|
||||
## [2.0.108] - 2025-04-13
|
||||
### Fixed
|
||||
- Fixed websocket UI updating.
|
||||
|
||||
## [2.0.107] - 2025-04-13
|
||||
### Fixed
|
||||
- Fixed Docker release versioning.
|
||||
|
||||
## [2.0.106] - 2025-04-13
|
||||
### Fixed
|
||||
- Changed how the GitHub release is created and how the changelog is generated.
|
||||
|
||||
## [2.0.105] - 2025-04-13
|
||||
### Added
|
||||
- Add feature to limit the amount of torrents that get sent to the provider at the same time.
|
||||
### Fixed
|
||||
- Moved the websocket update process to its own background thread to improve UI update consistency.
|
||||
|
||||
## [2.0.104] - 2025-04-12
|
||||
### Fixed
|
||||
- Update the version number
|
||||
|
||||
## [2.0.103] - 2025-04-12
|
||||
### Added
|
||||
- Button to select all options when deleting a torrent, thanks @EugeneKallis
|
||||
- Add setting to ignore update notifications. A notification will appear regardless of this setting if any GitHub Security Advisories are published in this repo.
|
||||
### Changed
|
||||
- Download .zip of torrent files from TorBox when possible, thanks @asylumexp
|
||||
- Users of AllDebrid and RealDebrid will now have no files downloaded when all files are excluded by filters. Before, if all files were excluded, rdt-client would download all the files in the torrent.
|
||||
- Reduce number of calls to debrid provider API when no torrents need updating
|
||||
### Fixed
|
||||
- The dropdown navigation menu on mobile will now close when you navigate to another page
|
||||
- Long torrent names without spaces will now wrap across lines
|
||||
### Security
|
||||
- Require auth to change debrid api key
|
||||
|
||||
## [2.0.102] - 2025-03-07
|
||||
### Changed
|
||||
- Fixed Angular build for Docker.
|
||||
|
||||
## [2.0.101] - 2025-03-07
|
||||
### Changed
|
||||
- Fixed Angular build (again).
|
||||
|
||||
## [2.0.100] - 2025-03-07
|
||||
### Changed
|
||||
- Fixed Angular build.
|
||||
|
||||
## [2.0.99] - 2025-03-07
|
||||
### Security fix
|
||||
- The Api/Authentication/Update was not protected by authentication, meaning everyone could reset your password and gain access.
|
||||
|
||||
### Added
|
||||
- Set the useragent for the Bezadd downloader to avoid getting blacklisted by Torbox.
|
||||
|
||||
### Changed
|
||||
- Upgraded to Angular 19.
|
||||
- Upgraded to Torbox 1.5.
|
||||
|
||||
|
||||
## [2.0.98] - 2025-02-16
|
||||
### Added
|
||||
- Added unit tests, thanks @Cucumberrbob!
|
||||
|
||||
### Changed
|
||||
- Fixed symlinks for AllDebrid.
|
||||
- Upgraded DebridLink.fr to the latest version.
|
||||
- Fixed nested files in the Premiumize Provider.
|
||||
- Fixed deleting of torrents in the watch folders.
|
||||
|
||||
## [2.0.97] - 2025-02-16
|
||||
### Added
|
||||
- Added support for DebridLink.fr.
|
||||
|
||||
### Fixed
|
||||
- Fixed for the internal downloader.
|
||||
- Added a column for torrent add date.
|
||||
- Upgraded AllDebrid API.
|
||||
|
||||
## [2.0.96] - 2025-01-29
|
||||
### Added
|
||||
- Added support for the synology download manager.
|
||||
- Added a column for torrent add date.
|
||||
|
||||
### Changed
|
||||
- Fixed for the Symlink downloader and AllDebrid.
|
||||
- Fixed setting the downloader when adding a torrent through the GUI.
|
||||
|
||||
## [2.0.95] - 2025-01-19
|
||||
### Added
|
||||
- Added the /api/v2/transfer/info qBittorrent endpoint.
|
||||
|
||||
### Changed
|
||||
- AllDebrid Symlink path fixes.
|
||||
|
||||
## [2.0.94] - 2025-01-05
|
||||
### Changed
|
||||
- AllDebrid path fixes.
|
||||
|
||||
## [2.0.93] - 2025-01-03
|
||||
### Changed
|
||||
- Torbox fixes.
|
||||
|
||||
## [2.0.92] - 2024-12-18
|
||||
### Changed
|
||||
- Torbox fixes.
|
||||
|
||||
## [2.0.91] - 2024-12-11
|
||||
### Changed
|
||||
- Torbox fixes.
|
||||
|
||||
## [2.0.90] - 2024-12-06
|
||||
### Changed
|
||||
- Download individual files from Torbox instead of a zip file.
|
||||
|
||||
### Removed
|
||||
- Removed ability to select instant files from AllDebrid.
|
||||
|
||||
## [2.0.89] - 2024-11-24
|
||||
### Changed
|
||||
- Disabled selecting of files as Real-Debrid was the only provider that supported that.
|
||||
|
||||
## [2.0.88] - 2024-11-24
|
||||
### Changed
|
||||
- Catch disabled instant availability endpoint from Real Debrid.
|
||||
|
||||
## [2.0.87] - 2024-11-18
|
||||
### Added
|
||||
- Torbox support.
|
||||
- qBittorrent API authentication when no authentication is used.
|
||||
### Changed
|
||||
- .NET version changed to .NET 9.
|
||||
- Changed download limit to be split by active torrents.
|
||||
|
||||
## [2.0.86] - 2024-09-03
|
||||
### Changed
|
||||
- Add potential fix for BASE_PATH.
|
||||
- Fixed creation of empty folders.
|
||||
|
||||
## [2.0.85] - 2024-09-03
|
||||
### Changed
|
||||
- Reverted: Prevent the creation of download folders when using symlink.
|
||||
|
||||
## [2.0.84] - 2024-09-02
|
||||
### Changed
|
||||
- Replace docker libssl1.1 with libssl3
|
||||
|
||||
## [2.0.83] - 2024-09-02
|
||||
### Changed
|
||||
- Fixed progress reporting to the qBittorrent API endpoint.
|
||||
- Prevent the creation of download folders when using symlink.
|
||||
|
||||
## [2.0.82] - 2024-09-02
|
||||
### Changed
|
||||
- Update packages and docker alpine version.
|
||||
|
||||
## [2.0.81] - 2024-07-28
|
||||
### Changed
|
||||
- Improved handling of infringed torrents from real debrid.
|
||||
- Force update of torrent data from real-debrid when no filename is found in the local DB.
|
||||
- Fixed real-debrid deserialization issue when checking for instant available files.
|
||||
|
||||
## [2.0.80] - 2024-07-13
|
||||
### Changed
|
||||
- Add rate limiter to retry requests that are rate limited from Real-Debrid.
|
||||
- Optimize calls to Real-Debrid API when torrents are finished and periodic updates.
|
||||
- Update to .NET 8.0.7
|
||||
|
||||
## [2.0.79] - 2024-06-03
|
||||
### Changed
|
||||
- Fixed issue with qBittorrent progress sometimes throwing errors.
|
||||
|
||||
## [2.0.78] - 2024-05-04
|
||||
### Changed
|
||||
- Fixed Aria2c download path issue when a category is set.
|
||||
|
||||
## [2.0.77] - 2024-05-03
|
||||
### Changed
|
||||
- Fixed Aria2c download path issue when a category is set.
|
||||
|
||||
## [2.0.76] - 2024-05-02
|
||||
### Changed
|
||||
- Fixed issues with the qBittorrent endpoint.
|
||||
- Fixed issue that could crash the torrent runner.
|
||||
|
||||
## [2.0.75] - 2024-04-24
|
||||
### Changed
|
||||
- Fixed broken recursive symlink searching.
|
||||
|
||||
## [2.0.74] - 2024-04-20
|
||||
### Added
|
||||
- Added support for symlink recursive searching.
|
||||
|
||||
## [2.0.73] - 2024-04-11
|
||||
### Changed
|
||||
- Fixed another issue with the symlinker and file resolver.
|
||||
|
||||
## [2.0.72] - 2024-04-10
|
||||
### Changed
|
||||
- Fixed issue with download speed test when the symlink downloader is selected.
|
||||
|
||||
## [2.0.71] - 2024-04-10
|
||||
### Changed
|
||||
- Fixed symlink path matching bug.
|
||||
|
||||
## [2.0.70] - 2024-04-10
|
||||
### Added
|
||||
- Added symlink logging.
|
||||
|
||||
## [2.0.69] - 2024-04-09
|
||||
### Added
|
||||
- Added sorting to the GUI columns.
|
||||
### Changed
|
||||
- Fixed reloading on the /settings and other pages.
|
||||
|
||||
## [2.0.68] - 2024-04-09
|
||||
### Changed
|
||||
- Base Href middleware fix that throws error when a response is not 200.
|
||||
|
||||
## [2.0.67] - 2024-04-09
|
||||
### Changed
|
||||
- Symlink fixes.
|
||||
|
||||
## [2.0.66] - 2024-04-08
|
||||
### Changed
|
||||
- Symlink fixes and improvements.
|
||||
|
||||
## [2.0.65] - 2024-04-07
|
||||
### Added
|
||||
- Added option to configure the buffersize for the internal downloader.
|
||||
|
||||
## [2.0.64] - 2024-04-06
|
||||
### Added
|
||||
- Add log level Verbose and add logging for the internal downloader, only works when both log levels are set to Verbose.
|
||||
|
||||
### Changed
|
||||
- Add fixes for the symlink downloader
|
||||
- Add better indication when a torrent is stalled
|
||||
- Fixed download client selection on the torrents
|
||||
|
||||
## [2.0.63] - 2024-03-05
|
||||
### Changed
|
||||
- When Sonarr/Radarr requests a torrent to be deleted, and its files too, then delete those files instead of ingoring it.
|
||||
|
||||
## [2.0.62] - 2024-02-17
|
||||
### Changed
|
||||
- Fixed reporting a torrent as error when some downloads have failed but still need to be retried.
|
||||
- Fixed issue where downloads could get started over and over.
|
||||
|
||||
## [2.0.61] - 2024-01-21
|
||||
### Added
|
||||
- Added setting to include or exclude files based on a given regex.
|
||||
- Add logging.
|
||||
|
||||
## [2.0.60] - 2024-01-21
|
||||
### Changed
|
||||
- Fixed bug where downloads could get stuck in active state while deleted.
|
||||
- Use the RD folder structure when downloading a file.
|
||||
|
||||
## [2.0.59] - 2024-01-21
|
||||
### Changed
|
||||
- Added the simple downloader back and moved the current internal downloader to a new setting.
|
||||
|
||||
## [2.0.58] - 2024-01-10
|
||||
### Changed
|
||||
- Don't automatically count the chunk count.
|
||||
|
||||
## [2.0.57] - 2024-01-09
|
||||
### Changed
|
||||
- Fixed symlink retry.
|
||||
|
||||
## [2.0.56] - 2024-01-07
|
||||
### Changed
|
||||
- Add retry mechanism for the downloaders.
|
||||
|
||||
## [2.0.55] - 2024-01-07
|
||||
### Changed
|
||||
- Tweaked the internal downloader to prevent memory issues.
|
||||
- Add retry mechanism for the symlink downloader.
|
||||
|
||||
## [2.0.54] - 2024-01-07
|
||||
### Changed
|
||||
- Added some logging for the symlink downloader to troubleshoot.
|
||||
- Added some logging when deleting torrents and the symlinker overrides the finish action.
|
||||
|
||||
## [2.0.53] - 2024-01-05
|
||||
### Added
|
||||
- Add setting to set the download path on the aria2 instance.
|
||||
|
||||
## [2.0.52] - 2024-01-05
|
||||
### Added
|
||||
- Add BASE_PATH environment variable for the base path setting.
|
||||
- Expose the Post Torrent Download Action setting on the Provider settings.
|
||||
|
||||
## [2.0.51] - 2024-01-05
|
||||
### Added
|
||||
- Added setting to store magnets and torrents to a directory after adding.
|
||||
- Added bulk settings change on the index pages.
|
||||
### Changed
|
||||
- Swapped the internal downloader back to the one that was before, this one is giving too many headaches.
|
||||
- Prevent deleting torrents from the debrid provider when the symlink downloader is used.
|
||||
- Fixed %F parameter on the external program.
|
||||
- Run the external program before the deletion process is ran.
|
||||
- Remove the 100 char limit on inputs.
|
||||
|
||||
## [2.0.50] - 2023-11-25
|
||||
### Changed
|
||||
- Fixed Docker Builds for arm64.
|
||||
|
||||
## [2.0.49] - 2023-11-24
|
||||
### Changed
|
||||
- Fixed memory issue in internal downloader.
|
||||
- Changed unpack process to handle cancels.
|
||||
|
||||
## [2.0.48] - 2023-11-15
|
||||
### Changed
|
||||
- Reverted dockerfile again as the packagemanager still doesn't have .net 8.
|
||||
|
||||
## [2.0.47] - 2023-11-15
|
||||
### Changed
|
||||
- Changed docker to use the package manager again.
|
||||
|
||||
## [2.0.46] - 2023-11-15
|
||||
### Changed
|
||||
- Fix in internal downloader.
|
||||
|
||||
## [2.0.45] - 2023-11-15
|
||||
### Changed
|
||||
- Optimizations to the internal downloader.
|
||||
|
||||
## [2.0.44] - 2023-11-15
|
||||
### Changed
|
||||
- Revert broken upgrade.
|
||||
|
||||
## [2.0.43] - 2023-11-15
|
||||
### Changed
|
||||
- Improvements to the internal downloader.
|
||||
|
||||
## [2.0.42] - 2023-11-14
|
||||
### Changed
|
||||
- Fixed docker build as .NET8 isn't published yet.
|
||||
|
||||
## [2.0.41] - 2023-11-14
|
||||
### Changed
|
||||
- Upgraded to .NET8 to see if downloader perf improves.
|
||||
|
||||
## [2.0.40] - 2023-10-03
|
||||
### Changed
|
||||
- Symlink downloader fixes.
|
||||
|
||||
## [2.0.39] - 2023-09-21
|
||||
### Changed
|
||||
- Fixed docker build
|
||||
|
||||
## [2.0.38] - 2023-09-20
|
||||
### Added
|
||||
- Added Symlink downloader to allow the use of rclone.
|
||||
- Added extra logging.
|
||||
- Added bulk retry on the index.
|
||||
|
||||
### Changed
|
||||
- Lower password requirements
|
||||
|
||||
## [2.0.37] - 2023-08-03
|
||||
### Changed
|
||||
- Fixed docker build process.
|
||||
|
||||
## [2.0.36] - 2023-08-02
|
||||
### Changed
|
||||
- Fixed docker build process and upgraded to Node18.
|
||||
|
||||
## [2.0.35] - 2023-08-02
|
||||
### Removed
|
||||
- Docker arm32/v7 images because the base image does not support it anymore: https://www.linuxserver.io/blog/a-farewell-to-arm-hf
|
||||
|
||||
## [2.0.34] - 2023-08-01
|
||||
### Changed
|
||||
- Update docker image to alpine 3.14.
|
||||
|
||||
## [2.0.33] - 2023-08-01
|
||||
### Changed
|
||||
- Fixed sub folders on Premiumize.
|
||||
- Fixed serialization errors on Premiumize.
|
||||
- Filter illegal path and filename characters when setting the download paths.
|
||||
### Added
|
||||
- Add the option "Post Download Action" to the Torrent settings popup.
|
||||
- Add a 2nd "Add Torrent" button on the add torrent page.
|
||||
- Add the Aria2c downloader to the Docker container and set it as the default downloader when running in docker.
|
||||
|
||||
## [2.0.32] - 2023-06-27
|
||||
### Changed
|
||||
- Fixed the BaseURL content-length setting.
|
||||
|
||||
## [2.0.31] - 2023-06-11
|
||||
### Added
|
||||
- Added setting to set the BaseURL.
|
||||
|
||||
### Changed
|
||||
- Added some logging.
|
||||
|
||||
## [2.0.30] - 2023-04-09
|
||||
### Changed
|
||||
- Improved the internal downloader bandwidth limiter.
|
||||
|
||||
## [2.0.29] - 2023-04-09
|
||||
### Changed
|
||||
- Testing Github actions automatic build to Docker.
|
||||
|
||||
## [2.0.28] - 2023-04-09
|
||||
### Changed
|
||||
- Added link to repository from the version link.
|
||||
|
||||
## [2.0.27] - 2023-04-08
|
||||
### Changed
|
||||
- Fixed Premiumize selecting of files.
|
||||
- Updated internal downloader to report download speeds better.
|
||||
|
||||
## [2.0.26] - 2023-03-30
|
||||
### Changed
|
||||
- Add some logging for Premiumize to better understand errors.
|
||||
- Changed Premiumize to download each file individually instead of creating a zip first.
|
||||
- Swapped the internal downloader for a new version.
|
||||
- Fixed issue when switching providers and it not switching over properly.
|
||||
|
||||
## [2.0.25] - 2023-03-17
|
||||
### Changed
|
||||
- Fixed docker run issues.
|
||||
|
||||
## [2.0.24] - 2023-03-16
|
||||
### Changed
|
||||
- Fixed docker run issues.
|
||||
|
||||
## [2.0.23] - 2023-03-15
|
||||
### Changed
|
||||
- Fixed docker build issues.
|
||||
|
||||
## [2.0.22] - 2023-03-11
|
||||
### Added
|
||||
- Add support for Premiumize
|
||||
|
||||
## [2.0.21] - 2023-03-09
|
||||
### Changed
|
||||
- Fixed docker build by pinning the .NET version to LTS.
|
||||
|
||||
## [2.0.20] - 2023-03-08
|
||||
### Added
|
||||
- Add support for multi-level unpacking.
|
||||
- Add settings to specify the Error and Processed paths for the watch folders.
|
||||
- Option to disable authentication completely.
|
||||
|
||||
### Changed
|
||||
- Removed the Simple Downloader and replaced it with https://github.com/bezzad/Downloader as the Internal Downloader.
|
||||
- Fixed setting the Base Href for sub folder hosting.
|
||||
|
||||
## [2.0.19] - 2022-10-18
|
||||
### Changed
|
||||
- Changed the AllDebrid provider to use HTTPS instead of HTTP.
|
||||
|
||||
## [2.0.18] - 2022-10-18
|
||||
### Added
|
||||
- Added the option to bulk delete torrents, thanks kanazaca!
|
||||
- Added option to remove the torrent only from the client after downloads are completed.
|
||||
- Added option to change the category of an existing torrent.
|
||||
- Added option to not download files to the host.
|
||||
### Changed
|
||||
- If a watched file gives an error when adding, move it to an error folder.
|
||||
|
||||
## [2.0.17] - 2022-05-24
|
||||
### Changed
|
||||
- Fixed issue with some settings not saving.
|
||||
|
||||
## [2.0.16] - 2022-05-24
|
||||
### Changed
|
||||
- Fixed MacOS pre-fill on the login screen.
|
||||
|
||||
## [2.0.15] - 2022-05-15
|
||||
### Changed
|
||||
- Remove settings for Finish Action and Category for the qBittorrent integration, these should always be set to None and the category comes from the integration.
|
||||
|
||||
## [2.0.14] - 2022-05-14
|
||||
### Changed
|
||||
- Fixed Windows Service issue
|
||||
- For service users: the appsettings.json is slightly changed: HostUrl is now Port. Important if you used a non standard (6500) port.
|
||||
|
||||
## [2.0.13] - 2022-05-14
|
||||
### Changed
|
||||
- Rewrote the settings storage. Added more settings to set defaults for importing.
|
||||
- Fixed filtering of torrents when a category is passed to the TorrentsInfo endpoint, fixing Radarr/Sonarr integrations.
|
||||
### Added
|
||||
- Added settings to control the timeout and polling interval to RealDebrid/AllDebrid.
|
||||
|
||||
## [2.0.12] - 2022-03-20
|
||||
### Changed
|
||||
- Fixed the AllDebrid client.
|
||||
|
||||
## [2.0.11] - 2022-03-19
|
||||
### Changed
|
||||
- Fixed the "Progress" for the AllDebrid client, thanks @23doors.
|
||||
|
||||
## [2.0.10] - 2022-03-19
|
||||
### Added
|
||||
- When changing the download speed setting for the simple downloader it will apply the setting to active downloads.
|
||||
- Add running of external applications when the torrent is finished.
|
||||
### Changed
|
||||
- Fixed deserialization of the availability check for RealDebrid.
|
||||
- Fixed the simple downloader download limiter.
|
||||
|
||||
## [2.0.9] - 2022-03-12
|
||||
### Changed
|
||||
- Updated packages, added logging to the RD and AD providers when serialization fails.
|
||||
|
||||
## [2.0.8] - 2022-02-28
|
||||
### Changed
|
||||
- Fixed issue with AllDebrid sometimes returning NULL links.
|
||||
|
||||
## [2.0.7] - 2022-02-06
|
||||
### Changed
|
||||
- Added setting to set the category when a torrent is imported from RealDebrid or other provider.
|
||||
|
||||
## [2.0.6] - 2022-02-06
|
||||
### Added
|
||||
- Added setting to automatically delete torrents in the state of error after a certain amount of time.
|
||||
- Added lifetime setting to automatically expire torrents after a certain amount of time.
|
||||
|
||||
## [2.0.5] - 2022-01-11
|
||||
### Changed
|
||||
- Updated AllDebrid provider to fix issue with ID's not being a number.
|
||||
|
||||
## [2.0.4] - 2022-01-08
|
||||
### Changed
|
||||
- Fixed bug where the QBittorrent API didn't report the error state correctly when an error ocurred in the debrid provider.
|
||||
|
||||
## [2.0.3] - 2022-01-02
|
||||
### Changed
|
||||
- Fixed automatic adding of AllDebrid torrents.
|
||||
### Added
|
||||
- Added update notification.
|
||||
|
||||
## [2.0.2] - 2021-11-24
|
||||
### Changed
|
||||
- Fixed update timer for providers.
|
||||
|
||||
## [2.0.1] - 2021-11-24
|
||||
### Changed
|
||||
- Fixed potential issue with the Real-Debrid mapper.
|
||||
- Fixed serialization issue for AllDebrid.
|
||||
|
||||
## [2.0.0] - 2021-11-21
|
||||
### Changed
|
||||
- Update projects to .NET6 and Angular 13.
|
||||
### Added
|
||||
- Added setting to automatically import torrents from RealDebrid / AllDebrid.
|
||||
- Added setting to automatically delete torrents from RealDebridClient when they have been removed from RealDebrid / AllDebrid.
|
||||
|
||||
## [1.9.8] - 2021-10-30
|
||||
### Added
|
||||
- Add speed limit setting on the Simple downloader.
|
||||
|
||||
## [1.9.7] - 2021-10-30
|
||||
### Added
|
||||
- Add AllDebrid support.
|
||||
|
||||
## [1.9.6] - 2021-10-30
|
||||
### Added
|
||||
- Improved handling of errors on the torrent itself
|
||||
- Added retry counts when adding torrents
|
||||
- Added retry counts on the Sonarr/Radarr settings page
|
||||
|
||||
## [1.9.5] - 2021-10-28
|
||||
### Changed
|
||||
- Fixed issues with the simple downloader.
|
||||
- Fixed issue with retrying downloads.
|
||||
|
||||
### Added
|
||||
- Added torrent uploading status from Real Debrid.
|
||||
- Restored removing of torrents when deleted from Real Debrid.
|
||||
|
||||
## [1.9.4] - 2021-10-28
|
||||
### Changed
|
||||
- Fixed issues retrying torrents after multiple failed downloads in large torrents.
|
||||
|
||||
## [1.9.3] - 2021-10-27
|
||||
### Changed
|
||||
- Fixed issue with the unpack queue.
|
||||
|
||||
## [1.9.2] - 2021-10-27
|
||||
### Changed
|
||||
- Fixed issue where not the correct torrent was used for a download.
|
||||
|
||||
## [1.9.1] - 2021-10-27
|
||||
### Added
|
||||
- Added automatic torrent retrying when RealDebrid reports an error on the torrent.
|
||||
|
||||
### Changed
|
||||
- Changed how Aria2 is polled, this will result in less RPC calls for a large amount of torrents.
|
||||
- Add more and better logging for the torrent runner in Debug.
|
||||
- Add Aria2 checks to see if links get added properly.
|
||||
- Update Aria2.NET and RD.NET, added automatic retrying in case of server failures.
|
||||
|
||||
## [1.9.0] - 2021-10-24
|
||||
### Added
|
||||
- Add priorty for torrents. You can set the priority when adding a new torrent. When added from Sonarr/Radarr it will assume no priority.
|
||||
- Added support for the Sonarr/Radarr/qBittorrent setPrio command. It will set the priority of a torrent to 1.
|
||||
- Added support for the Sonarr/Radarr/qBittorrent pause and resume commands. This only works with the Aria2 downloader.
|
||||
|
||||
### Changed
|
||||
- Fixed issues when downloads get deleted when they are still being checked.
|
||||
- Improved timings and retrying of adding of downloads to Aria2. Will now try 5 times before failing.
|
||||
|
||||
## [1.8.9] - 2021-10-23
|
||||
### Changed
|
||||
- Add delays between adding downloads to Aria2 to avoid Aria2 going down when adding a large amount of downloads.
|
||||
|
||||
## [1.8.8] - 2021-10-21
|
||||
### Changed
|
||||
- Fixed starting downloads when RealDebrid reports ghost links in torrents.
|
||||
|
||||
## [1.8.7] - 2021-10-11
|
||||
### Added
|
||||
- Add Aria2 test connection button.
|
||||
- Add full torrent retry mechanism, by default it will now retry the torrent 2 times when a download fails for more than 3 times.
|
||||
|
||||
### Changed
|
||||
- Improved Aria2 download handling.
|
||||
|
||||
## [1.8.6] - 2021-10-09
|
||||
### Added
|
||||
- Experimental support for a Aria2 download client. Check the readme for usage.
|
||||
|
||||
### Changed
|
||||
- Fixed potential error when sonarr is querying and the torrent isn't added to RealDebrid yet.
|
||||
- Fixed interface randomly stop updating.
|
||||
- Upgrade dependencies.
|
||||
|
||||
## [1.8.5] - 2021-10-07
|
||||
### Changed
|
||||
- Fixed issue where deleting a torrent could error out.
|
||||
|
||||
## [1.8.4] - 2021-08-05
|
||||
### Changed
|
||||
- Changed the default timeout for Real-Debrid communication to 10 seconds instead of 100 seconds.
|
||||
|
||||
## [1.8.3] - 2021-08-05
|
||||
### Changed
|
||||
- Fixed potential issue with duplicates categories.
|
||||
|
||||
## [1.8.2] - 2021-08-02
|
||||
### Changed
|
||||
- Fixed issue with starting downloads.
|
||||
|
||||
## [1.8.1] - 2021-07-31
|
||||
### Changed
|
||||
- Fixed issue where downloads were hanging the full interface.
|
||||
|
||||
## [1.8.0] - 2021-07-18
|
||||
### Added
|
||||
- Fixed support for categories. They are now saved persistently in the database.
|
||||
- Added new "settings" page.
|
||||
- Added new "add new" page. Added more options when manually adding a torrent, including the ability to manually select files.
|
||||
- Added dedicated torrent pages with more information when selecting a torrent on the main page.
|
||||
- Add ability to retry individual downloads.
|
||||
|
||||
### Changed
|
||||
- Fixed enter key on the login and setup screen.
|
||||
- Fixed an issue with selecting files and getting the links. This process could take a long time and would hang the client while waiting for a response.
|
||||
|
||||
### Removed
|
||||
- Removed the retry and delete button from the main page and moved them to the torrent page.
|
||||
- Removed the ability to retry all downloads.
|
||||
|
||||
## [1.7.8] - 2021-06-17
|
||||
### Changed
|
||||
- Fixed issue for real this time with a broken response from RDT when the available files returns in a format different than normal.
|
||||
|
||||
## [1.7.7] - 2021-06-09
|
||||
### Changed
|
||||
- Fixed some issues with download error handling.
|
||||
- Fixed issue where files aren't always properly selected.
|
||||
|
||||
## [1.7.6] - 2021-06-05
|
||||
### Changed
|
||||
- Fixed build for Raspberry PI.
|
||||
|
||||
## [1.7.5] - 2021-06-05
|
||||
### Changed
|
||||
- Reduced the frequency of database reads and writes by adding caches for settings and torrents.
|
||||
- Updated dependency of RD.NET to improve serialization error reporting.
|
||||
- Changed how the base href is determined to support path proxies.
|
||||
- Fixed issue with handling of renamed torrents.
|
||||
|
||||
## [1.7.4] - 2021-04-22
|
||||
### Changed
|
||||
- Changed how the docker is built.
|
||||
|
||||
## [1.7.3] - 2021-04-19
|
||||
### Changed
|
||||
- Fixed issue (hopefully) where sometimes the name of the torrent would change.
|
||||
|
||||
## [1.7.2] - 2021-04-14
|
||||
### Changed
|
||||
- Fixed issue where sometimes the content path is not recognized by Sonarr.
|
||||
- Fixed reporting errors when a RD torrent errors.
|
||||
|
||||
## [1.7.1] - 2021-04-01
|
||||
### Added
|
||||
- Add Update.ps1 to automatically download the latest version from Github for Windows users.
|
||||
|
||||
## [1.7.0] - 2021-04-01
|
||||
### Added
|
||||
- Add automatic retry functionality for downloads. It will retry downloading a file after an error 3 times.
|
||||
### Changed
|
||||
- Fixed an issue downloads sometimes getting added multiple times.
|
||||
|
||||
## [1.6.3] - 2021-03-15
|
||||
### Changed
|
||||
- Fixed a bug where it sometimes could add a download multiple times when the RD torrent was in a certain state.
|
||||
|
||||
## [1.6.2] - 2021-03-13
|
||||
### Added
|
||||
- Add a retry button in the interface. Giving the possibility to re-download the torrent in RealDebrid or re-download the files locally.
|
||||
### Changed
|
||||
- Fixed some issues with deleting files and the files being in use.
|
||||
- Fixed an issue with some torrents not downloading when finished.
|
||||
### Removed
|
||||
- Removed the "Download" and "Unpack" buttons from the interface.
|
||||
|
||||
## [1.6.1] - 2021-03-12
|
||||
### Changed
|
||||
- Fixed a bug in the torrent runner where it could download the same file multiple times.
|
||||
|
||||
## [1.6.0] - 2021-03-10
|
||||
### Added
|
||||
- Add an option to see which files are available on Real-Debrid on the add torrent modal.
|
||||
### Changed
|
||||
- Update the unrestrict process to only unrestrict links when a download is started instead of when the torrent is added.
|
||||
### Removed
|
||||
- Removed the "Auto download" and "Auto unpack" options, they are now always enabled by default.
|
||||
|
||||
## [1.5.6] - 2021-02-14
|
||||
### Changed
|
||||
- Updated all packages
|
||||
- Updated the multi downloader, this should fix the insufficient disk space issue.
|
||||
|
||||
## [1.5.5] - 2021-02-12
|
||||
### Added
|
||||
- You can now enable debug logging through the setting modal. Debug will give you a lot of information, but also the best picture of what's going on. Default log level is warning to avoid creating big log files.
|
||||
|
||||
### Changed
|
||||
- Fixed the bug where the unpack process would halt if there were downloads pending.
|
||||
|
||||
## [1.5.4] - 2021-02-11
|
||||
### Changed
|
||||
- Fixed an issue where auto extracting wasn't working.
|
||||
|
||||
## [1.5.3] - 2021-02-10
|
||||
### Changed
|
||||
- Fixed issue with selecting files when all files were filtered out.
|
||||
|
||||
## [1.5.2] - 2021-02-09
|
||||
### Added
|
||||
- Add ProxyServer to the Multipart download settings.
|
||||
|
||||
### Changed
|
||||
- Fixed issue with RealDebrid API not returning a proper list of available files.
|
||||
|
||||
## [1.5.1] - 2021-02-06
|
||||
|
||||
### Changed
|
||||
- Fixed bug with the OnlyDownloadAvailable files setting not showing correctly enabled in the setting modal.
|
||||
|
||||
## [1.5.0] - 2021-02-05
|
||||
### Added
|
||||
- Added a new setting to only download files that have been downloaded on Real Debrid, this will make downloading relevant files faster.
|
||||
- Re-added the service-install.bat and service-remove.bat files to whoever wants to run as a service.
|
||||
|
||||
## [1.4.0] - 2021-01-13
|
||||
### Added
|
||||
- This release will now support the Docker image. You can still run it as a service as before.
|
||||
|
||||
### Changed
|
||||
- Lots of changes, but the most notable is that the database is stored an a persistent storage on your host, configured through the docker file. This does mean that any torrents you are currently running will be removed from RDT.
|
||||
- Sonarr and Radarr support have been greatly improved, especially the version 3 releases.
|
||||
- The download/unpack queue process has been rewritten to be more robust.
|
||||
|
||||
## [1.3.0] - 2020-12-01
|
||||
### Changed
|
||||
- Sonarr and Radarr compatibility broke due to the missing files endpint, thank you @alexmckenley for adding the endpoint!
|
||||
|
||||
## [1.2.0] - 2020-10-05
|
||||
### Changed
|
||||
- Fixed small issues when adding torrents and not loading meta data.
|
||||
|
||||
## [1.1.0] - 2020-05-16
|
||||
### Changed
|
||||
- Small bug fixes
|
||||
|
||||
### Changed
|
||||
- test
|
||||
|
||||
### Removed
|
||||
- nothing
|
||||
|
||||
## [1.0.0] - 2020-04-11
|
||||
### Added
|
||||
- First release
|
||||
- Add unraring progress and default auto download / auto remove options.
|
||||
100
Dockerfile
100
Dockerfile
|
|
@ -1,28 +1,100 @@
|
|||
# Stage 1 - Build the frontend
|
||||
FROM amd64/node:15.5-buster AS node-build-env
|
||||
FROM node:lts-alpine AS node-build-env
|
||||
ARG TARGETPLATFORM
|
||||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
||||
ARG BUILDPLATFORM
|
||||
ENV BUILDPLATFORM=${BUILDPLATFORM:-linux/amd64}
|
||||
|
||||
RUN mkdir /appclient
|
||||
WORKDIR /appclient
|
||||
|
||||
COPY client/. .
|
||||
RUN npm ci
|
||||
RUN npx ng build --prod --output-path=out
|
||||
RUN apk add --no-cache git python3 py3-pip make g++
|
||||
|
||||
COPY client ./client
|
||||
COPY root ./root
|
||||
RUN \
|
||||
cd client && \
|
||||
echo "**** Building Code ****" && \
|
||||
npm install && \
|
||||
npx ng build --output-path=out
|
||||
|
||||
RUN ls -FCla /appclient/root
|
||||
|
||||
# Stage 2 - Build the backend
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-1-buster-slim-amd64 AS dotnet-build-env
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS dotnet-build-env
|
||||
ARG TARGETPLATFORM
|
||||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
||||
ARG BUILDPLATFORM
|
||||
ENV BUILDPLATFORM=${BUILDPLATFORM:-linux/amd64}
|
||||
|
||||
RUN mkdir /appserver
|
||||
WORKDIR /appserver
|
||||
|
||||
COPY server/. .
|
||||
|
||||
RUN if [ "$BUILDPLATFORM" = "arm/v7" ] ; then dotnet restore -r linux-arm RdtClient.sln ; else dotnet restore RdtClient.sln ; fi
|
||||
RUN if [ "$BUILDPLATFORM" = "arm/v7" ] ; then dotnet publish -r linux-arm -c Release -o out ; else dotnet publish -c Release -o out ; fi
|
||||
COPY server ./server
|
||||
RUN \
|
||||
echo "**** Building Source Code for $TARGETPLATFORM on $BUILDPLATFORM ****" && \
|
||||
cd server && \
|
||||
dotnet restore --no-cache RdtClient.sln && \
|
||||
dotnet test && \
|
||||
dotnet publish --no-restore -c Release -o out ;
|
||||
|
||||
# Stage 3 - Build runtime image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0.2-buster-slim AS base
|
||||
RUN mkdir /app
|
||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
|
||||
ARG TARGETPLATFORM
|
||||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
||||
ARG BUILDPLATFORM
|
||||
ENV BUILDPLATFORM=${BUILDPLATFORM:-linux/amd64}
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
ARG VERSION
|
||||
LABEL build_version="Linuxserver.io extended version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
||||
LABEL maintainer="ravensorb"
|
||||
|
||||
# set environment variables
|
||||
ARG DEBIAN_FRONTEND="noninteractive"
|
||||
ENV XDG_CONFIG_HOME="/config/xdg"
|
||||
ENV RDTCLIENT_BRANCH="main"
|
||||
|
||||
RUN \
|
||||
mkdir -p /data/downloads /data/db || true && \
|
||||
echo "**** Updating package information ****" && \
|
||||
apk update && \
|
||||
echo "**** Install pre-reqs ****" && \
|
||||
apk add bash icu-libs krb5-libs libgcc libintl libssl3 libstdc++ zlib && \
|
||||
echo "**** Installing dotnet ****" && \
|
||||
mkdir -p /usr/share/dotnet
|
||||
|
||||
RUN \
|
||||
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then \
|
||||
wget https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-musl-arm.tar.gz && \
|
||||
tar zxf aspnetcore-runtime-10.0.0-linux-musl-arm.tar.gz -C /usr/share/dotnet ; \
|
||||
elif [ "$TARGETPLATFORM" = "linux/arm64" ] ; then \
|
||||
wget https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-musl-arm64.tar.gz && \
|
||||
tar zxf aspnetcore-runtime-10.0.0-linux-musl-arm64.tar.gz -C /usr/share/dotnet ; \
|
||||
else \
|
||||
wget https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.0/aspnetcore-runtime-10.0.0-linux-musl-x64.tar.gz && \
|
||||
tar zxf aspnetcore-runtime-10.0.0-linux-musl-x64.tar.gz -C /usr/share/dotnet ; \
|
||||
fi
|
||||
|
||||
RUN \
|
||||
echo "**** Setting permissions ****" && \
|
||||
chown -R abc:abc /data && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/var/cache/apk/* \
|
||||
/var/tmp/* || true
|
||||
|
||||
ENV PATH "$PATH:/usr/share/dotnet"
|
||||
|
||||
# Copy files for app
|
||||
WORKDIR /app
|
||||
COPY --from=dotnet-build-env /appserver/out .
|
||||
COPY --from=node-build-env /appclient/out ./wwwroot
|
||||
ENTRYPOINT ["dotnet", "RdtClient.Web.dll"]
|
||||
COPY --from=dotnet-build-env /appserver/server/out .
|
||||
COPY --from=node-build-env /appclient/client/out/browser ./wwwroot
|
||||
COPY --from=node-build-env /appclient/root/ /
|
||||
|
||||
# ports and volumes
|
||||
EXPOSE 6500
|
||||
|
||||
# Check Status
|
||||
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl --fail http://localhost:6500 || exit
|
||||
|
|
|
|||
190
README-DOCKER.md
Normal file
190
README-DOCKER.md
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
# [rogerfar/rdt-client](https://github.com/rogerfar/rdt-client)
|
||||
Thid docker file follows the [linuxserver.io](https://linuxserver.io) pattern that leverages the [s6-overlay](https://github.com/just-containers/s6-overlay) to run the application as a service within the container. This allows for scripts to be run prior to start of the application to handle initalization and setting of permissions.
|
||||
|
||||
rdt-client is a web a web interface to manage your torrents on Real-Debrid. It supports the following features:
|
||||
|
||||
* Add new torrents through magnets or files
|
||||
* Download all files from Real Debrid to your local machine automatically
|
||||
* Unpack all files when finished downloading
|
||||
* Implements a fake qBittorrent API so you can hook up other applications like Sonarr or Couchpotato.
|
||||
* Built with Angular 11 and .NET 5
|
||||
|
||||
## Supported Architectures
|
||||
|
||||
Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
|
||||
|
||||
Simply pulling `rogerfar/rdtclient` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
|
||||
|
||||
The architectures supported by this image are:
|
||||
|
||||
| Architecture | Tag |
|
||||
| :----: | --- |
|
||||
| x86-64 | amd64-latest |
|
||||
| arm64 | arm64v8-latest |
|
||||
| armhf | arm32v7-latest |
|
||||
|
||||
## Version Tags
|
||||
|
||||
This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them.
|
||||
|
||||
| Tag | Description |
|
||||
| :----: | --- |
|
||||
| latest | Stable releases |
|
||||
|
||||
## Usage
|
||||
|
||||
Here are some example snippets to help you get started creating a container.
|
||||
|
||||
### docker-compose ([recommended](https://docs.linuxserver.io/general/docker-compose))
|
||||
|
||||
Compatible with docker-compose v2 schemas.
|
||||
|
||||
```yaml
|
||||
---
|
||||
version: '3.3'
|
||||
services:
|
||||
rdtclient:
|
||||
image: rogerfar/rdtclient
|
||||
container_name: rdtclient
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/London
|
||||
volumes:
|
||||
- <path to data>:/data/db
|
||||
- <path to downloads>:/data/downloads
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
ports:
|
||||
- 6500:6500
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
### docker cli
|
||||
|
||||
```
|
||||
docker run -d \
|
||||
--name=rdtclient \
|
||||
-e PUID=1000 \
|
||||
-e PGID=1000 \
|
||||
-e TZ=Europe/London \
|
||||
-p 6500:6500 \
|
||||
-v <path to data>:/data/db \
|
||||
-v <path/to/downloads>:/data/downloads \
|
||||
--restart unless-stopped \
|
||||
rogerfar/rdtclient
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
|
||||
|
||||
| Parameter | Function |
|
||||
| :----: | --- |
|
||||
| `-p 6500` | WebUI |
|
||||
| `-e PUID=1000` | for UserID - see below for explanation |
|
||||
| `-e PGID=1000` | for GroupID - see below for explanation |
|
||||
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
|
||||
| `-v /data/db` | App data. |
|
||||
| `-v /data/downloads` | Location of downloads on disk. |
|
||||
|
||||
## Environment variables from files (Docker secrets)
|
||||
|
||||
You can set any environment variable from a file by using a special prepend `FILE__`.
|
||||
|
||||
As an example:
|
||||
|
||||
```
|
||||
-e FILE__PASSWORD=/run/secrets/mysecretpassword
|
||||
```
|
||||
|
||||
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
|
||||
|
||||
## Umask for running applications
|
||||
|
||||
For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional `-e UMASK=022` setting.
|
||||
Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up [here](https://en.wikipedia.org/wiki/Umask) before asking for support.
|
||||
|
||||
## User / Group Identifiers
|
||||
|
||||
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
|
||||
|
||||
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
|
||||
|
||||
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
|
||||
|
||||
```
|
||||
$ id username
|
||||
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Application Setup
|
||||
|
||||
Webui can be found at `<your-ip>:6500`
|
||||
|
||||
## Support Info
|
||||
|
||||
* Shell access whilst the container is running: `docker exec -it rtdclient /bin/bash`
|
||||
* To monitor the logs of the container in realtime: `docker logs -f rdtclient`
|
||||
* container version number
|
||||
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' rdtclient`
|
||||
* image version number
|
||||
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' rogerfar/rdtclient`
|
||||
|
||||
## Updating Info
|
||||
|
||||
Most of our images are static, versioned, and require an image update and container recreation to update the app inside. Please consult the [Application Setup](#application-setup) section above to see if it is recommended for the image.
|
||||
|
||||
Below are the instructions for updating containers:
|
||||
|
||||
### Via Docker Compose
|
||||
* Update all images: `docker-compose pull`
|
||||
* or update a single image: `docker-compose pull rdtclient`
|
||||
* Let compose update all containers as necessary: `docker-compose up -d`
|
||||
* or update a single container: `docker-compose up -d rdtclient`
|
||||
* You can also remove the old dangling images: `docker image prune`
|
||||
|
||||
### Via Docker Run
|
||||
* Update the image: `docker pull rogerfar/rdtclient`
|
||||
* Stop the running container: `docker stop rdtclient`
|
||||
* Delete the container: `docker rm rdtclient`
|
||||
* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/data` folder and settings will be preserved)
|
||||
* You can also remove the old dangling images: `docker image prune`
|
||||
|
||||
### Via Watchtower auto-updater (only use if you don't remember the original parameters)
|
||||
* Pull the latest image at its tag and replace it with the same env variables in one run:
|
||||
```
|
||||
docker run --rm \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
containrrr/watchtower \
|
||||
--run-once rtdclient
|
||||
```
|
||||
* You can also remove the old dangling images: `docker image prune`
|
||||
|
||||
**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
|
||||
|
||||
### Image Update Notifications - Diun (Docker Image Update Notifier)
|
||||
* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
|
||||
|
||||
## Building locally
|
||||
|
||||
If you want to make local modifications to these images for development purposes or just to customize the logic:
|
||||
```
|
||||
git clone https://github.com/ravensorb/docker-rdtclient.git
|
||||
cd docker-rdtclient
|
||||
docker build \
|
||||
--no-cache \
|
||||
--pull \
|
||||
-t rogerfar/rtd-client:latest .
|
||||
```
|
||||
|
||||
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
|
||||
```
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
```
|
||||
|
||||
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
|
||||
241
README.md
241
README.md
|
|
@ -1,74 +1,101 @@
|
|||
# Real-Debrid Torrent Client
|
||||
# Real-Debrid Torrent & Usenet Client
|
||||
|
||||
This is a web interface to manage your torrents on Real-Debrid. It supports the following features:
|
||||
This is a web interface to manage your torrents on Real-Debrid, AllDebrid, Premiumize, TorBox or DebridLink. It supports the following features:
|
||||
|
||||
- Add new torrents through magnets or files
|
||||
- Download all files from Real Debrid to your local machine automatically
|
||||
- Add usenet downloads through NZB files (TorBox and Premiumize only)
|
||||
- Download all files from Real-Debrid, AllDebrid, Premiumize or TorBox to your local machine automatically
|
||||
- Unpack all files when finished downloading
|
||||
- Implements a fake qBittorrent API so you can hook up other applications like Sonarr or Couchpotato.
|
||||
- Built with Angular 11 and .NET 5
|
||||
- Implements a fake qBittorrent API so you can hook up other applications like Sonarr, Radarr or Couchpotato.
|
||||
- Built with Angular 21 and .NET 10
|
||||
|
||||
**You will need a Premium service at Real-Debrid!**
|
||||
**You will need a Premium service at Real-Debrid, AllDebrid, Premiumize, Torbox or DebridLink!**
|
||||
|
||||
[Click here to sign up (referal link so I can get a few free premium days).](https://real-debrid.com/?id=1348683)
|
||||
[Click here to sign up for Real-Debrid.](https://real-debrid.com/?id=1348683)
|
||||
|
||||
[Click here to sign up for AllDebrid.](https://alldebrid.com/?uid=2v91l)
|
||||
|
||||
[Click here to sign up for Premiumize.](https://www.premiumize.me/)
|
||||
|
||||
[Click here to sign up for TorBox.](https://torbox.app/subscription?referral=3d25018e-f30d-4c4b-a714-48c04bc76765)
|
||||
|
||||
[Click here to sign up for DebridLink.](https://debrid-link.fr/id/6duif)
|
||||
|
||||
<sub>(referal links so I can get a few free premium days)</sub>
|
||||
|
||||
## Docker Setup
|
||||
|
||||
You can run the docker container on Windows, Linux. To get started either use _Docker Run_ or _Docker Compose_.
|
||||
Please see our separate Docker setup Read Me.
|
||||
|
||||
### Docker Run
|
||||
[Readme for Docker](README-DOCKER.md)
|
||||
|
||||
```console
|
||||
docker run --cap-add=NET_ADMIN -d \
|
||||
-v /your/download/path/:/data/downloads \
|
||||
-v /your/storage/path/:/data/db \
|
||||
--log-driver json-file \
|
||||
--log-opt max-size=10m \
|
||||
-p 6500:6500 \
|
||||
rogerfar/rdtclient
|
||||
```
|
||||
## Run as a Service
|
||||
|
||||
Replace `/your/download/path/` with your local path to download files to. For Windows i.e. `C:/Downloads`.
|
||||
Replace `/your/storage/path/` with your local path to store persistent database and log files in. For Windows i.e. `C:/Docker/rdt-client`.
|
||||
|
||||
### Docker Compose
|
||||
|
||||
You can use the provided docker compose to run:
|
||||
|
||||
```yaml
|
||||
version: '3.3'
|
||||
services:
|
||||
rdtclient:
|
||||
container_name: rdtclient
|
||||
volumes:
|
||||
- 'D:/Downloads/:/data/downloads'
|
||||
- 'D:/Docker/rdt-client/:/data/db'
|
||||
image: rogerfar/rdtclient
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
ports:
|
||||
- '6500:6500'
|
||||
```
|
||||
|
||||
And to run:
|
||||
|
||||
```console
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Replace the paths in `volumes` as in the above step.
|
||||
Instead of running in Docker you can install it as a service in Windows or Linux.
|
||||
|
||||
## Windows Service
|
||||
|
||||
Instead of running in Docker you can install it as a service in Windows or Linux (not tested).
|
||||
1. Make sure you have the **ASP.NET Core Runtime 10.0.0** and the **SDK** installed: [https://dotnet.microsoft.com/download/dotnet/10.0](https://dotnet.microsoft.com/download/dotnet/10.0)
|
||||
2. Get the latest zip file from the Releases page and extract it to your host.
|
||||
3. Open the `appsettings.json` file and replace the `LogLevel` `Path` to a path on your host.
|
||||
4. In `appsettings.json` replace the `Database` `Path` to a path on your host.
|
||||
5. When using Windows paths, make sure to escape the slashes. For example: `D:\\RdtClient\\db\\rdtclient.db`
|
||||
6. Do one of these:
|
||||
* Run `RdtClient.Web.exe` to start the client.
|
||||
* Run `service-install.bat` to install the client as a service. This will install `RdtClient.Web.exe` as a service which make the client start in the backgorund when the computer starts. (You probably want to do this if you are going to use this with Sonarr etc...)
|
||||
|
||||
1. Get the latest zip file from the Releases page and extract it to your host.
|
||||
1. Open the `appsettings.json` file and replace the `LogLevel` `Path` to a path on your host.
|
||||
1. In `appsettings.json` replace the `Database` `Path` to a path on your host.
|
||||
1. When using Windows paths, make sure to escape the slashes. For example: `D:\\RdtClient\\db\\rdtclient.db`
|
||||
## Linux Service
|
||||
|
||||
Instead of running in Docker you can install it as a service in Linux.
|
||||
|
||||
1. Install .NET: [https://docs.microsoft.com/en-us/dotnet/core/install/linux](https://docs.microsoft.com/en-us/dotnet/core/install/linux)
|
||||
|
||||
Ubuntu 20.04 example:
|
||||
```wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb```
|
||||
|
||||
```sudo dpkg -i packages-microsoft-prod.deb```
|
||||
|
||||
```rm packages-microsoft-prod.deb```
|
||||
|
||||
```sudo apt-get update && sudo apt-get install -y dotnet-sdk-10.0```
|
||||
|
||||
2. Get latest archive from [releases](https://github.com/rogerfar/rdt-client/releases):
|
||||
```wget <zip_url>```
|
||||
3. Extract to path of your choice (~/rtdc in this example):
|
||||
```unzip RealDebridClient.zip -d ~/rdtc && cd ~/rdtc```
|
||||
4. In appsettings.json replace the Database Path to a path on your host. Any directories in path must already exist. Or just remove "/data/db/" for ease.
|
||||
5. Test rdt client runs ok:
|
||||
```dotnet RdtClient.Web.dll```
|
||||
navigate to http://<ipaddress>:6500, if all is good then we'll create a service
|
||||
6. Create a service (systemd in this example):
|
||||
```sudo nano /etc/systemd/system/rdtc.service```
|
||||
|
||||
paste in this service file content and edit path of your directory:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=RdtClient Service
|
||||
|
||||
[Service]
|
||||
|
||||
WorkingDirectory=/home/<username>/rdtc
|
||||
ExecStart=/usr/bin/dotnet RdtClient.Web.dll
|
||||
SyslogIdentifier=RdtClient
|
||||
User=<username>
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
7. enable and start the service:
|
||||
```sudo systemctl daemon-reload```
|
||||
```sudo systemctl enable rdtc```
|
||||
```sudo systemctl start rdtc```
|
||||
|
||||
## Proxmox LXC
|
||||
|
||||
If you use Proxmox for your homelab, you can run rdt-client in a linux container (LXC), check it here:
|
||||
[https://tteck.github.io/Proxmox/](https://tteck.github.io/Proxmox/)
|
||||
|
||||
## Setup
|
||||
|
||||
|
|
@ -83,26 +110,54 @@ Instead of running in Docker you can install it as a service in Windows or Linux
|
|||
|
||||
### Download Clients
|
||||
|
||||
Currently there 2 available download clients:
|
||||
Currently there 4 available download clients:
|
||||
|
||||
#### Simple Downloader
|
||||
#### Bezzad Downloader
|
||||
|
||||
This is a simple 1 connection only download manager. It uses less resources than the multi-part downloader. It downloads straight to the download path.
|
||||
This [downloader](https://github.com/bezzad/Downloader) can be used to download files in parallel and with multiple chunks.
|
||||
|
||||
It has the following options:
|
||||
|
||||
- Maximum parallel downloads: This number indicates how many completed torrents from Real Debrid can be downloaded at the same time. On low powered systems it is recommended to keep this number low.
|
||||
- Download speed (in MB/s): This number indicates the speed in MB/s per download over all parallel downloads and chunks.
|
||||
- Parallel connections per download: This number indicates how many parallel it will use per download. This can increase speed, recommended is no more than 8.
|
||||
- Parallel chunks per download: This number indicates in how many chunks each download is split, recommended is no more than 8.
|
||||
- Connection Timeout: This number indicates the timeout in milliseconds before a download chunk times out. It will retry each chunk 5 times before completely failing.
|
||||
|
||||
#### Multi Part Downloader
|
||||
#### Aria2c downloader
|
||||
|
||||
This [downloader](https://github.com/bezzad/Downloader) as more options and such uses more resources (memory, CPU) to download files. Recommended more powerful systems.
|
||||
This will use an external Aria2c downloader client. You will need to install this client yourself on your host, it is not included in the docker image.
|
||||
|
||||
It has the following options:
|
||||
|
||||
- Temp Download path: Set this path to where the downloader temporarily stores chunks. This path can be an internal path in Docker (i.e. `/data/temp`) but make sure you have enough disk space to complete the whole download. When all chunks are completed the completed file is copied to your download folder.
|
||||
- Maximum parallel downloads: This number indicates how many completed torrents from Real Debrid can be downloaded at the same time.
|
||||
- Parallel connections per download: This number indicates how many threads/connections/parts/chunks it will use per download. This can increase speed, recommended is no more than 8.
|
||||
- Download speed (in MB/s): This number indicates the speed in MB/s per download. If you set this to 10 and `Maximum parallel downloads` to 2, you can download with a maximum of 20MB/s.
|
||||
- Url: The full URL to your Aria2c service. This must end in /jsonrpc. A standard path is `http://192.168.10.2:6800/jsonrpc`.
|
||||
- Secret: Optional secret to connecto to your Aria2c service.
|
||||
|
||||
If Aria2c is selected, none of the above options for `Internal Downloader` are used, you have to configure Aria2c manually.
|
||||
|
||||
#### Symlink downloader
|
||||
|
||||
Symlink downloader requires a rclone mount to be mounted into your filesystem. Be sure to keep the exact path to mounted files in other apps exactly
|
||||
the same as used by rdt-client. Otherwise the symlinks wont resolve the file its trying to point to.
|
||||
|
||||
If the mount path folder cant be found the client wont start downloading anything.
|
||||
|
||||
Required configuration:
|
||||
- Post Download Action = DO NOT SELECT REMOVE FROM PROVIDER
|
||||
- Rclone mount path = /PATH_TO_YOUR_RCLONE_MOUNT/torrents/
|
||||
|
||||
Suggested configuration:
|
||||
- Automatic retry downloads > 3
|
||||
|
||||
#### Synology Download Station
|
||||
|
||||
The Synology Download Station downloader uses an external Download Station server. You will need to set this up yourself.
|
||||
|
||||
It has the following options:
|
||||
|
||||
- Url: The URL to the Synology DownloadStation. A common URL is `http://127.0.0.1:5000`
|
||||
- Username: The username to use when connecting to the Synology DownloadStation.
|
||||
- Password: The password to use when connecting to the Synology DownloadStation.
|
||||
- Download Path: The root path to download the file on the Synology DownloadStation host. If left empty, the default path configured on your Download Station server will be used.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
|
|
@ -111,7 +166,9 @@ It has the following options:
|
|||
|
||||
### Connecting Sonarr/Radarr
|
||||
|
||||
RdtClient emulates the qBittorrent web protocol and allow applications to use those APIs. This way you can use Sonarr and Radarr to download directly from RealDebrid.
|
||||
RdtClient emulates the qBittorrent web protocol and allows applications to use those APIs. This way you can use Sonarr and Radarr to download directly from RealDebrid.
|
||||
|
||||
#### Torrents
|
||||
|
||||
1. Login to Sonarr or Radarr and click `Settings`.
|
||||
1. Go to the `Download Client` tab and click the plus to add.
|
||||
|
|
@ -128,6 +185,28 @@ When downloading files it will append the `category` setting in the Sonarr/Radar
|
|||
|
||||
Notice: the progress and ETA reported in Sonarr's Activity tab will not be accurate, but it will report the torrent as completed so it can be processed after it is done downloading.
|
||||
|
||||
#### Usenet/NZB
|
||||
|
||||
RdtClient also emulates part of the SABnzbd API so Sonarr and Radarr can add NZB downloads. This requires a provider that supports Usenet/NZB downloads, currently TorBox or Premiumize.
|
||||
|
||||
1. Login to Sonarr or Radarr and click `Settings`.
|
||||
1. Go to the `Download Client` tab and click the plus to add.
|
||||
1. Click `SABnzbd` in the list.
|
||||
1. Enter the IP or hostname of RdtClient in the `Host` field.
|
||||
1. Enter `6500` in the `Port` field.
|
||||
1. Enable `Use SSL` only if you access RdtClient through HTTPS.
|
||||
1. Leave `URL Base` empty unless RdtClient is configured with a `BasePath`, for example `/rdt`.
|
||||
1. If RdtClient authentication is enabled, leave `API Key` empty and enter your RdtClient username and password. If your client only supports an API key, enter `{username}:{password}` in `API Key`.
|
||||
1. If RdtClient authentication is disabled, enter any value in `API Key`, for example `rdtclient`, and leave username/password empty.
|
||||
1. Set the category to `sonarr` for Sonarr or `radarr` for Radarr.
|
||||
1. Hit `Test` and then `Save` if all is well.
|
||||
|
||||
When importing completed NZB downloads, Sonarr/Radarr must be able to access the path reported by RdtClient. In Docker setups this may require a Remote Path Mapping from the RdtClient download path to the path mounted inside Sonarr/Radarr.
|
||||
|
||||
### Running within a folder
|
||||
|
||||
By default the application runs in the root of your hosted address (i.e. https://rdt.myserver.com/), but if you want to run it as a relative folder (i.e. https://myserver.com/rdt) you will have to change the `BasePath` setting in the `appsettings.json` file. You can set the `BASE_PATH` environment variable for docker enviroments.
|
||||
|
||||
## Build instructions
|
||||
|
||||
### Prerequisites
|
||||
|
|
@ -135,13 +214,24 @@ Notice: the progress and ETA reported in Sonarr's Activity tab will not be accur
|
|||
- NodeJS
|
||||
- NPM
|
||||
- Angular CLI
|
||||
- .NET 5
|
||||
- Visual Studio 2019
|
||||
- .NET 10
|
||||
- Visual Studio 2025
|
||||
- (optional) Resharper
|
||||
|
||||
### Dev Container
|
||||
|
||||
The repository includes a dev container under `.devcontainer/` for the split development workflow used by this project.
|
||||
|
||||
It installs .NET 10 and Node 22, forwards ports `4200` and `6500`, and persists `/data/db` and `/data/downloads` in named volumes so the local SQLite database, logs, and downloads survive container rebuilds.
|
||||
|
||||
1. Open the repository in the dev container.
|
||||
1. In one terminal run `dotnet watch run --project server/RdtClient.Web`.
|
||||
1. In another terminal run `cd client && npm start`.
|
||||
1. Open `http://localhost:4200`. The Angular dev server proxies `/Api` and `/hub` to the backend running on `6500`.
|
||||
|
||||
1. Open the client folder project in VS Code and run `npm install`.
|
||||
1. To debug run `ng serve`, to build run `ng build --prod`.
|
||||
1. Open the Visual Studio 2019 project `RdtClient.sln` and `Publish` the `RdtClient.Web` to the given `PublishFolder` target.
|
||||
1. To debug run `ng serve`, to build run `ng build -c production`.
|
||||
1. Open the Visual Studio 2025 project `RdtClient.sln` and `Publish` the `RdtClient.Web` to the given `PublishFolder` target.
|
||||
1. When debugging, make sure to run `RdtClient.Web.dll` and not `IISExpress`.
|
||||
1. The result is found in `Publish`.
|
||||
|
||||
|
|
@ -152,3 +242,14 @@ Notice: the progress and ETA reported in Sonarr's Activity tab will not be accur
|
|||
1. To stop: `docker stop rdtclient`
|
||||
1. To remove: `docker rm rdtclient`
|
||||
1. Or use `docker-build.bat`
|
||||
|
||||
## Misc Install Notes
|
||||
|
||||
### Rootless Podman, Linux Host, and CIFS Connections
|
||||
|
||||
RDT Client read and write permission tests fail if the CIFS connection is not setup properly, despite permissions working inspection. In the Web GUI, it will report access denied, and in the log file you will see exceptions like this ([dotnet issue](https://github.com/dotnet/runtime/issues/42790)):
|
||||
```
|
||||
System.IO.IOException: Permission denied
|
||||
```
|
||||
The **nobrl** has to be specified in your CIFS connection - [man page](https://linux.die.net/man/8/mount.cifs).
|
||||
Example: ```Options=_netdev,credentials=/etc/samba/credentials/600file,rw,uid=SUBUID,gid=SBUGID,nobrl,file_mode=0770,dir_mode=0770,noperm```
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
> 0.5%
|
||||
last 2 versions
|
||||
Firefox ESR
|
||||
not dead
|
||||
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
||||
37
client/.eslintrc.json
Normal file
37
client/.eslintrc.json
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"root": true,
|
||||
"ignorePatterns": ["projects/**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"parserOptions": {
|
||||
"project": ["tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": ["plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "attribute",
|
||||
"prefix": "app",
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": "app",
|
||||
"style": "kebab-case"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@angular-eslint/template/recommended"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
46
client/.gitignore
vendored
46
client/.gitignore
vendored
|
|
@ -0,0 +1,46 @@
|
|||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
# Only exists if Bazel was run
|
||||
/bazel-out
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
# profiling files
|
||||
chrome-profiler-events*.json
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.project
|
||||
.classpath
|
||||
.c9/
|
||||
*.launch
|
||||
.settings/
|
||||
*.sublime-workspace
|
||||
|
||||
# IDE - VSCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
.history/*
|
||||
|
||||
# misc
|
||||
/.angular/cache
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
testem.log
|
||||
/typings
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
14
client/.ncurc.js
Normal file
14
client/.ncurc.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const minorOnly = ["eslint", "typescript"];
|
||||
const patchOnly = [];
|
||||
|
||||
module.exports = {
|
||||
target: (name) => {
|
||||
if (minorOnly.indexOf(name) > -1) {
|
||||
return "minor";
|
||||
}
|
||||
if (patchOnly.indexOf(name) > -1) {
|
||||
return "patch";
|
||||
}
|
||||
return "latest";
|
||||
},
|
||||
};
|
||||
2
client/.prettierignore
Normal file
2
client/.prettierignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.angular
|
||||
.vscode
|
||||
|
|
@ -3,11 +3,33 @@
|
|||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"rdt-client": {
|
||||
"client": {
|
||||
"projectType": "application",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"style": "scss"
|
||||
"style": "scss",
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:class": {
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:guard": {
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:interceptor": {
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:pipe": {
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:service": {
|
||||
"skipTests": true
|
||||
},
|
||||
"@schematics/angular:application": {
|
||||
"strict": true
|
||||
}
|
||||
},
|
||||
"root": "",
|
||||
|
|
@ -15,103 +37,115 @@
|
|||
"prefix": "app",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"builder": "@angular/build:application",
|
||||
"options": {
|
||||
"outputPath": "../server/RdtClient.Web/wwwroot",
|
||||
"outputPath": {
|
||||
"base": "../server/RdtClient.Web/wwwroot",
|
||||
"browser": ""
|
||||
},
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"polyfills": ["src/polyfills.ts"],
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"aot": true,
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": ["src/favicon.ico", "src/assets"],
|
||||
"styles": ["src/styles.scss"],
|
||||
"scripts": []
|
||||
"scripts": [],
|
||||
"browser": "src/main.ts",
|
||||
"stylePreprocessorOptions": {
|
||||
"sass": {
|
||||
"silenceDeprecations": ["if-function"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "2mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "2kb",
|
||||
"maximumError": "4kb"
|
||||
}
|
||||
],
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"namedChunks": false,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "5mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "6kb",
|
||||
"maximumError": "10kb"
|
||||
}
|
||||
]
|
||||
"outputHashing": "all"
|
||||
},
|
||||
"development": {
|
||||
"optimization": false,
|
||||
"extractLicenses": false,
|
||||
"sourceMap": true,
|
||||
"namedChunks": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"builder": "@angular/build:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "rdt-client:build",
|
||||
"proxyConfig": "angular-proxy.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "rdt-client:build:production"
|
||||
"buildTarget": "client:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "client:build:development"
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"builder": "@angular/build:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "rdt-client:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.spec.json",
|
||||
"karmaConfig": "karma.conf.js",
|
||||
"assets": ["src/favicon.ico", "src/assets"],
|
||||
"styles": ["src/styles.scss"],
|
||||
"scripts": []
|
||||
"buildTarget": "client:build"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"builder": "@angular-eslint/builder:lint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"tsconfig.app.json",
|
||||
"tsconfig.spec.json",
|
||||
"e2e/tsconfig.json"
|
||||
],
|
||||
"exclude": ["**/node_modules/**"]
|
||||
}
|
||||
},
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "rdt-client:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "rdt-client:serve:production"
|
||||
}
|
||||
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "rdt-client"
|
||||
"cli": {
|
||||
"analytics": false,
|
||||
"schematicCollections": ["@angular-eslint/schematics"]
|
||||
},
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"type": "component"
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"type": "directive"
|
||||
},
|
||||
"@schematics/angular:service": {
|
||||
"type": "service"
|
||||
},
|
||||
"@schematics/angular:guard": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:interceptor": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:module": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:pipe": {
|
||||
"typeSeparator": "."
|
||||
},
|
||||
"@schematics/angular:resolver": {
|
||||
"typeSeparator": "."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client: {
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, './coverage/rdt-client'),
|
||||
reports: ['html', 'lcovonly', 'text-summary'],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false,
|
||||
restartOnFileChange: true
|
||||
});
|
||||
};
|
||||
21535
client/package-lock.json
generated
21535
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,53 +1,54 @@
|
|||
{
|
||||
"name": "rdt-client",
|
||||
"name": "client",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"test": "ng test",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"update": "ng update --force --allow-dirty @angular/cli @angular/core @angular/cdk",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e",
|
||||
"update": "ng update --force --allow-dirty @angular/cli @angular/core"
|
||||
"prettier": "prettier --write .",
|
||||
"precommit": "npm run prettier && npm run lint"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~11.0.5",
|
||||
"@angular/common": "~11.0.5",
|
||||
"@angular/compiler": "~11.0.5",
|
||||
"@angular/core": "~11.0.5",
|
||||
"@angular/forms": "~11.0.5",
|
||||
"@angular/platform-browser": "~11.0.5",
|
||||
"@angular/platform-browser-dynamic": "~11.0.5",
|
||||
"@angular/router": "~11.0.5",
|
||||
"@fortawesome/fontawesome-free": "^5.15.1",
|
||||
"@microsoft/signalr": "^5.0.1",
|
||||
"bulma": "^0.9.1",
|
||||
"curray": "^1.0.8",
|
||||
"ngx-filesize": "^2.0.16",
|
||||
"rxjs": "~6.6.3",
|
||||
"tslib": "^2.0.3",
|
||||
"zone.js": "~0.11.3"
|
||||
"@angular/animations": "^21.2.10",
|
||||
"@angular/cdk": "^21.2.8",
|
||||
"@angular/common": "^21.2.10",
|
||||
"@angular/compiler": "^21.2.10",
|
||||
"@angular/core": "^21.2.10",
|
||||
"@angular/forms": "^21.2.10",
|
||||
"@angular/platform-browser": "^21.2.10",
|
||||
"@angular/platform-browser-dynamic": "^21.2.10",
|
||||
"@angular/router": "^21.2.10",
|
||||
"@fortawesome/fontawesome-free": "^7.2.0",
|
||||
"@microsoft/signalr": "^10.0.0",
|
||||
"bulma": "^1.0.4",
|
||||
"curray": "^1.0.12",
|
||||
"file-saver-es": "^2.0.5",
|
||||
"filesize": "^11.0.17",
|
||||
"rxjs": "^7.8.2",
|
||||
"tslib": "^2.8.1",
|
||||
"zone.js": "^0.16.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.1100.5",
|
||||
"@angular/cli": "~11.0.5",
|
||||
"@angular/compiler-cli": "~11.0.5",
|
||||
"@angular/language-service": "~11.0.5",
|
||||
"@types/node": "^14.14.13",
|
||||
"@types/jasmine": "~3.6.2",
|
||||
"@types/jasminewd2": "~2.0.8",
|
||||
"codelyzer": "^6.0.1",
|
||||
"jasmine-core": "~3.6.0",
|
||||
"jasmine-spec-reporter": "~6.0.0",
|
||||
"karma": "~5.2.3",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.3",
|
||||
"karma-jasmine": "~4.0.1",
|
||||
"karma-jasmine-html-reporter": "^1.5.4",
|
||||
"protractor": "~7.0.0",
|
||||
"ts-node": "~9.1.1",
|
||||
"tslint": "~6.1.0",
|
||||
"typescript": "~4.0.5"
|
||||
"@angular-eslint/builder": "21.3.1",
|
||||
"@angular-eslint/eslint-plugin": "21.3.1",
|
||||
"@angular-eslint/eslint-plugin-template": "21.3.1",
|
||||
"@angular-eslint/schematics": "21.3.1",
|
||||
"@angular-eslint/template-parser": "21.3.1",
|
||||
"@angular/build": "^21.2.8",
|
||||
"@angular/cli": "^21.2.8",
|
||||
"@angular/compiler-cli": "^21.2.10",
|
||||
"@angular/language-service": "^21.2.10",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/file-saver-es": "^2.0.3",
|
||||
"@types/node": "^25.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.59.1",
|
||||
"@typescript-eslint/parser": "^8.59.1",
|
||||
"eslint": "^9.39.4",
|
||||
"prettier": "^3.8.3",
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
301
client/src/app/add-new-torrent/add-new-torrent.component.html
Normal file
301
client/src/app/add-new-torrent/add-new-torrent.component.html
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
<div class="field">
|
||||
<div class="tabs is-toggle is-fullwidth">
|
||||
<ul>
|
||||
<li [class.is-active]="type === 'torrent'">
|
||||
<a (click)="changeType('torrent')">
|
||||
<span class="icon is-small"><i class="fas fa-magnet" aria-hidden="true"></i></span>
|
||||
<span>Torrent</span>
|
||||
</a>
|
||||
</li>
|
||||
<li [class.is-active]="type === 'nzb'">
|
||||
<a (click)="changeType('nzb')">
|
||||
<span class="icon is-small"><i class="fas fa-file-archive" aria-hidden="true"></i></span>
|
||||
<span>NZB</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div [hidden]="type !== 'torrent'">
|
||||
<div class="field">
|
||||
<label class="label">Torrent file</label>
|
||||
<div class="file has-name">
|
||||
<label class="file-label">
|
||||
<input class="file-input" type="file" name="resume" (change)="pickFile($event)" [disabled]="saving" />
|
||||
<span class="file-cta">
|
||||
<span class="file-icon">
|
||||
<i class="fas fa-upload"></i>
|
||||
</span>
|
||||
<span class="file-label"> Pick a torrent file... </span>
|
||||
</span>
|
||||
<span class="file-name">
|
||||
{{ fileName }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Magnet Link</label>
|
||||
<div class="control">
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="Paste your magnet link here"
|
||||
[(ngModel)]="magnetLink"
|
||||
[disabled]="saving"
|
||||
(blur)="checkFiles()"
|
||||
(paste)="onPaste()"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div [hidden]="type !== 'nzb'">
|
||||
<div class="field">
|
||||
<label class="label">NZB file</label>
|
||||
<div class="file has-name">
|
||||
<label class="file-label">
|
||||
<input class="file-input" type="file" name="resume" (change)="pickFile($event)" [disabled]="saving" />
|
||||
<span class="file-cta">
|
||||
<span class="file-icon">
|
||||
<i class="fas fa-upload"></i>
|
||||
</span>
|
||||
<span class="file-label"> Pick an NZB file... </span>
|
||||
</span>
|
||||
<span class="file-name">
|
||||
{{ fileName }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">NZB Link</label>
|
||||
<div class="control">
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="Paste your NZB link here"
|
||||
[(ngModel)]="nzbLink"
|
||||
[disabled]="saving"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field" style="margin-top: 10px">
|
||||
<div class="control">
|
||||
<button class="button is-success" [disabled]="saving" [ngClass]="{ 'is-loading': saving }" (click)="ok()">
|
||||
@if (type === "torrent") {
|
||||
<span>Add Torrent</span>
|
||||
} @else {
|
||||
<span>Add NZB</span>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="separator">Advanced settings</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Downloader</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="downloadClient" (ngModelChange)="setFinishAction()">
|
||||
<option [ngValue]="0">Bezzad</option>
|
||||
<option [ngValue]="1">Aria2c</option>
|
||||
<option [ngValue]="2">Symlink Downloader</option>
|
||||
<option [ngValue]="3">Synology DownloadStation</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">Select which downloader is used to download this from the debrid provider to your host.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Post Download Action</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="hostDownloadAction">
|
||||
<option [ngValue]="0">Download all files to host</option>
|
||||
<option [ngValue]="1">Don't download any files to host</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">
|
||||
When a download is finished on the provider, perform this action. Use this setting if you only want to add files
|
||||
to your debrid provider but not download them to the host.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Minimum file size to download</label>
|
||||
<div class="control">
|
||||
<div class="field has-addons" style="margin-bottom: 0">
|
||||
<div class="control is-expanded">
|
||||
<input class="input" type="number" max="1000" min="0" step="1" [(ngModel)]="downloadMinSize" />
|
||||
</div>
|
||||
<div class="control">
|
||||
<a class="button is-static">MB</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (provider === "AllDebrid") {
|
||||
<p class="help">
|
||||
When downloading with AllDebrid it cannot be guaranteed that only files above this limit will be download as
|
||||
some files are grouped together in 1 large archive.
|
||||
</p>
|
||||
}
|
||||
@if (downloadAction === 2) {
|
||||
<p class="help">This setting does not apply to manually selected files.</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Include files</label>
|
||||
<div class="control">
|
||||
<div class="field" style="margin-bottom: 0">
|
||||
<div class="control is-expanded">
|
||||
<input class="input" type="text" [(ngModel)]="includeRegex" (blur)="verifyRegex()" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">
|
||||
Select only the files that are matching this regular expression. Only use this setting OR the Exclude files
|
||||
setting, not both.
|
||||
</p>
|
||||
@if (downloadAction === 2) {
|
||||
<p class="help">This setting does not apply to manually selected files.</p>
|
||||
}
|
||||
@if (includeRegexError) {
|
||||
<p class="help is-danger">{{ includeRegexError }}</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Exclude files</label>
|
||||
<div class="control">
|
||||
<div class="field" style="margin-bottom: 0">
|
||||
<div class="control is-expanded">
|
||||
<input class="input" type="text" [(ngModel)]="excludeRegex" (blur)="verifyRegex()" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">
|
||||
Ignore files that are matching this regular expression. Only use this setting OR the Include files setting, not
|
||||
both.
|
||||
</p>
|
||||
@if (downloadAction === 2) {
|
||||
<p class="help">This setting does not apply to manually selected files.</p>
|
||||
}
|
||||
@if (excludeRegexError) {
|
||||
<p class="help is-danger">{{ excludeRegexError }}</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Finished action</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="finishedAction">
|
||||
<option [ngValue]="0">Do nothing</option>
|
||||
@if (downloadClient !== 2) {
|
||||
<option [ngValue]="1">Remove from provider and client</option>
|
||||
<option [ngValue]="2">Remove from provider</option>
|
||||
}
|
||||
<option [ngValue]="3">Remove from client</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Finished Action Delay (minutes)</label>
|
||||
<div class="control is-fullwidth">
|
||||
<input class="input" type="number" [(ngModel)]="finishedActionDelay" />
|
||||
</div>
|
||||
<p class="help">
|
||||
When a download is finished on the provider, perform this action. Use this setting if you only want to add files
|
||||
to your debrid provider but not download them to the host.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Category</label>
|
||||
<div class="control category-combo">
|
||||
<input
|
||||
class="input"
|
||||
type="text"
|
||||
[(ngModel)]="category"
|
||||
(focus)="categoryDropdownOpen = true"
|
||||
(input)="categoryDropdownOpen = true"
|
||||
(blur)="onCategoryBlur()"
|
||||
placeholder="Type or select a category"
|
||||
autocomplete="off"
|
||||
/>
|
||||
@if (categoryDropdownOpen && filteredCategories.length > 0) {
|
||||
<div class="category-dropdown">
|
||||
@for (cat of filteredCategories; track $index) {
|
||||
<a class="category-option" (mousedown)="selectCategory(cat)">{{ cat }}</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<p class="help">The category becomes a sub-folder in your main download path.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Priority</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" step="1" [(ngModel)]="priority" />
|
||||
</div>
|
||||
<p class="help">Set the priority where 1 is the highest. When empty it will be assigned the lowest priority.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div>
|
||||
<div class="field">
|
||||
<label class="label">Automatic retry downloads</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="1000" min="0" step="1" [(ngModel)]="downloadRetryAttempts" />
|
||||
</div>
|
||||
<p class="help">When a single download fails it will retry it this many times before marking it as failed.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Automatic retry download</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="1000" min="0" step="1" [(ngModel)]="torrentRetryAttempts" />
|
||||
</div>
|
||||
<p class="help">
|
||||
When a single download has failed multiple times (see setting above) or when the download itself received an
|
||||
error it will retry the full download this many times before marking it failed.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Delete download when in error</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="100000" min="0" step="1" [(ngModel)]="torrentDeleteOnError" />
|
||||
</div>
|
||||
<p class="help">
|
||||
When a download has been in error for this many minutes, delete it from the provider and the client. 0 to
|
||||
disable.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Maximum lifetime</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="100000" min="0" step="1" [(ngModel)]="torrentLifetime" />
|
||||
</div>
|
||||
<p class="help">
|
||||
The maximum lifetime of a download in minutes. When this time has passed, mark it as error. If the download is
|
||||
completed, the lifetime setting will not apply. 0 to disable.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
@if (error) {
|
||||
<div class="notification is-danger is-light">{{ error }}</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
.file-name {
|
||||
max-width: 24em;
|
||||
width: 24em;
|
||||
}
|
||||
|
||||
.separator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
color: darkgray;
|
||||
font-size: 10px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.separator::before,
|
||||
.separator::after {
|
||||
content: "";
|
||||
flex: 1;
|
||||
border-bottom: 1px solid darkgray;
|
||||
}
|
||||
|
||||
.separator:not(:empty)::before {
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
|
||||
.separator:not(:empty)::after {
|
||||
margin-left: 0.25em;
|
||||
}
|
||||
|
||||
.category-combo {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.category-dropdown {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
background: white;
|
||||
border: 1px solid #dbdbdb;
|
||||
border-top: none;
|
||||
border-radius: 0 0 4px 4px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.category-option {
|
||||
display: block;
|
||||
padding: 0.375rem 0.75rem;
|
||||
color: #363636;
|
||||
|
||||
&:hover {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
}
|
||||
333
client/src/app/add-new-torrent/add-new-torrent.component.ts
Normal file
333
client/src/app/add-new-torrent/add-new-torrent.component.ts
Normal file
|
|
@ -0,0 +1,333 @@
|
|||
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { Router } from '@angular/router';
|
||||
import { DownloadType, Torrent, TorrentFileAvailability } from '../models/torrent.model';
|
||||
import { SettingsService } from '../settings.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { NgClass } from '@angular/common';
|
||||
import { TorrentService } from '../torrent.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-new-torrent',
|
||||
templateUrl: './add-new-torrent.component.html',
|
||||
styleUrls: ['./add-new-torrent.component.scss'],
|
||||
imports: [FormsModule, NgClass],
|
||||
standalone: true,
|
||||
})
|
||||
export class AddNewTorrentComponent implements OnInit {
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private router = inject(Router);
|
||||
private torrentService = inject(TorrentService);
|
||||
private settingsService = inject(SettingsService);
|
||||
private activatedRoute = inject(ActivatedRoute);
|
||||
|
||||
public type: 'torrent' | 'nzb' = 'torrent';
|
||||
public fileName: string;
|
||||
public magnetLink: string;
|
||||
public nzbLink: string;
|
||||
private currentTorrentFile: string;
|
||||
|
||||
public provider: string;
|
||||
public downloadClient: number;
|
||||
|
||||
private _category = '';
|
||||
public categories: string[] = [];
|
||||
public filteredCategories: string[] = [];
|
||||
public categoryDropdownOpen = false;
|
||||
public hostDownloadAction: number = 0;
|
||||
public downloadAction: number = 0;
|
||||
public finishedAction: number = 0;
|
||||
public finishedActionDelay: number = 0;
|
||||
public downloadMinSize: number = 0;
|
||||
public includeRegex: string = '';
|
||||
public excludeRegex: string = '';
|
||||
public torrentRetryAttempts: number = 1;
|
||||
public downloadRetryAttempts: number = 3;
|
||||
public torrentDeleteOnError: number = 0;
|
||||
public torrentLifetime: number = 0;
|
||||
public priority: number;
|
||||
|
||||
public availableFiles: TorrentFileAvailability[];
|
||||
public downloadFiles: { [key: string]: boolean } = {};
|
||||
public allSelected: boolean;
|
||||
|
||||
public saving = false;
|
||||
public error: string;
|
||||
|
||||
public includeRegexError: string;
|
||||
public excludeRegexError: string;
|
||||
public regexSelected: TorrentFileAvailability[];
|
||||
|
||||
private selectedFile: File | null = null;
|
||||
|
||||
public get category(): string {
|
||||
return this._category;
|
||||
}
|
||||
|
||||
public set category(value: string) {
|
||||
this._category = value;
|
||||
this.updateFilteredCategories();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.activatedRoute.queryParams.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((params) => {
|
||||
if (params['type'] === 'nzb') {
|
||||
this.type = 'nzb';
|
||||
} else if (params['type'] === 'torrent') {
|
||||
this.type = 'torrent';
|
||||
}
|
||||
|
||||
if (params['magnet']) {
|
||||
this.magnetLink = decodeURIComponent(params['magnet']);
|
||||
this.type = 'torrent';
|
||||
}
|
||||
if (params['nzb']) {
|
||||
this.nzbLink = decodeURIComponent(params['nzb']);
|
||||
this.type = 'nzb';
|
||||
}
|
||||
});
|
||||
|
||||
this.settingsService
|
||||
.get()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe((settings) => {
|
||||
const providerSetting = settings.find((m) => m.key === 'Provider:Provider');
|
||||
this.provider = providerSetting.enumValues[providerSetting.value as number];
|
||||
this.downloadClient = settings.find((m) => m.key === 'DownloadClient:Client')?.value as number;
|
||||
|
||||
this.category = settings.find((m) => m.key === 'Gui:Default:Category')?.value as string;
|
||||
const categoriesSetting = settings.find((m) => m.key === 'General:Categories')?.value as string;
|
||||
this.categories = (categoriesSetting ?? '')
|
||||
.split(',')
|
||||
.map((c) => c.trim())
|
||||
.filter((c) => c.length > 0)
|
||||
.filter((c, i, arr) => arr.findIndex((a) => a.toLowerCase() === c.toLowerCase()) === i);
|
||||
const matchedCategory = this.categories.find((c) => c.toLowerCase() === (this.category ?? '').toLowerCase());
|
||||
if (matchedCategory) {
|
||||
this.category = matchedCategory;
|
||||
} else {
|
||||
this.updateFilteredCategories();
|
||||
}
|
||||
this.hostDownloadAction = this.downloadAction = settings.find((m) => m.key === 'Gui:Default:HostDownloadAction')
|
||||
?.value as number;
|
||||
this.downloadAction =
|
||||
settings.find((m) => m.key === 'Gui:Default:OnlyDownloadAvailableFiles')?.value === true ? 1 : 0;
|
||||
this.finishedAction = settings.find((m) => m.key === 'Gui:Default:FinishedAction')?.value as number;
|
||||
this.finishedActionDelay = settings.find((m) => m.key == 'Gui:Default:FinishedActionDelay')?.value as number;
|
||||
this.downloadMinSize = settings.find((m) => m.key === 'Gui:Default:MinFileSize')?.value as number;
|
||||
this.includeRegex = settings.find((m) => m.key === 'Gui:Default:IncludeRegex')?.value as string;
|
||||
this.excludeRegex = settings.find((m) => m.key === 'Gui:Default:ExcludeRegex')?.value as string;
|
||||
this.torrentRetryAttempts = settings.find((m) => m.key === 'Gui:Default:TorrentRetryAttempts')?.value as number;
|
||||
this.downloadRetryAttempts = settings.find((m) => m.key === 'Gui:Default:DownloadRetryAttempts')
|
||||
?.value as number;
|
||||
this.torrentDeleteOnError = settings.find((m) => m.key === 'Gui:Default:DeleteOnError')?.value as number;
|
||||
this.torrentLifetime = settings.find((m) => m.key === 'Gui:Default:TorrentLifetime')?.value as number;
|
||||
this.priority = settings.find((m) => m.key === 'Gui:Default:Priority')?.value as number;
|
||||
|
||||
this.setFinishAction();
|
||||
});
|
||||
}
|
||||
|
||||
private updateFilteredCategories(): void {
|
||||
if (!this.category) {
|
||||
this.filteredCategories = this.categories;
|
||||
return;
|
||||
}
|
||||
|
||||
const search = this.category.toLowerCase();
|
||||
this.filteredCategories = this.categories.filter((value) => value.toLowerCase().includes(search));
|
||||
}
|
||||
|
||||
public selectCategory(cat: string): void {
|
||||
this.category = cat;
|
||||
this.categoryDropdownOpen = false;
|
||||
}
|
||||
|
||||
public onCategoryBlur(): void {
|
||||
setTimeout(() => (this.categoryDropdownOpen = false), 150);
|
||||
}
|
||||
|
||||
public setFinishAction() {
|
||||
if (this.downloadClient === 2) {
|
||||
if (this.finishedAction === 1) {
|
||||
this.finishedAction = 3;
|
||||
} else if (this.finishedAction === 2) {
|
||||
this.finishedAction = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public changeType(type: 'torrent' | 'nzb'): void {
|
||||
this.type = type;
|
||||
this.fileName = null;
|
||||
this.selectedFile = null;
|
||||
}
|
||||
|
||||
public pickFile(evt: Event): void {
|
||||
const files = (evt.target as HTMLInputElement).files;
|
||||
|
||||
if (files == null || files.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const file = files[0];
|
||||
|
||||
this.fileName = file.name;
|
||||
|
||||
this.selectedFile = file;
|
||||
|
||||
this.checkFiles();
|
||||
}
|
||||
|
||||
public ok(): void {
|
||||
this.saving = true;
|
||||
this.error = null;
|
||||
|
||||
let downloadManualFiles: string = null;
|
||||
|
||||
if (this.downloadAction === 2) {
|
||||
const selectedFiles = [];
|
||||
for (const filePath in this.downloadFiles) {
|
||||
if (this.downloadFiles[filePath] === true) {
|
||||
selectedFiles.push(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedFiles.length === 0) {
|
||||
this.error = 'No files have been selected to download';
|
||||
return;
|
||||
}
|
||||
|
||||
downloadManualFiles = selectedFiles.join(',');
|
||||
}
|
||||
|
||||
const torrent = new Torrent();
|
||||
torrent.category = this.category;
|
||||
torrent.hostDownloadAction = this.hostDownloadAction;
|
||||
torrent.downloadAction = this.downloadAction;
|
||||
torrent.finishedAction = this.finishedAction;
|
||||
torrent.finishedActionDelay = this.finishedActionDelay;
|
||||
torrent.downloadMinSize = this.downloadMinSize;
|
||||
torrent.includeRegex = this.includeRegex;
|
||||
torrent.excludeRegex = this.excludeRegex;
|
||||
torrent.downloadManualFiles = downloadManualFiles;
|
||||
torrent.priority = this.priority;
|
||||
torrent.torrentRetryAttempts = this.torrentRetryAttempts;
|
||||
torrent.downloadRetryAttempts = this.downloadRetryAttempts;
|
||||
torrent.deleteOnError = this.torrentDeleteOnError;
|
||||
torrent.lifetime = this.torrentLifetime;
|
||||
torrent.downloadClient = this.downloadClient;
|
||||
|
||||
if (this.type === 'torrent') {
|
||||
torrent.type = DownloadType.Torrent;
|
||||
if (this.magnetLink) {
|
||||
this.torrentService.uploadMagnet(this.magnetLink, torrent).subscribe({
|
||||
next: () => this.router.navigate(['/']),
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
} else if (this.selectedFile) {
|
||||
this.torrentService.uploadFile(this.selectedFile, torrent).subscribe({
|
||||
next: () => this.router.navigate(['/']),
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.error = 'No magnet or file uploaded';
|
||||
this.saving = false;
|
||||
}
|
||||
} else {
|
||||
if (this.nzbLink) {
|
||||
this.torrentService.uploadNzbLink(this.nzbLink, torrent).subscribe({
|
||||
next: () => this.router.navigate(['/']),
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
} else if (this.selectedFile) {
|
||||
this.torrentService.uploadNzbFile(this.selectedFile, torrent).subscribe({
|
||||
next: () => this.router.navigate(['/']),
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.error = 'No NZB link or file uploaded';
|
||||
this.saving = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public onPaste(): void {
|
||||
setTimeout(() => {
|
||||
this.checkFiles();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
public checkFiles(): void {
|
||||
if (this.type === 'nzb') {
|
||||
return;
|
||||
}
|
||||
if (this.magnetLink && this.magnetLink === this.currentTorrentFile) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.saving = true;
|
||||
this.error = null;
|
||||
this.availableFiles = null;
|
||||
this.downloadFiles = {};
|
||||
this.allSelected = true;
|
||||
|
||||
if (this.magnetLink) {
|
||||
this.torrentService.checkFilesMagnet(this.magnetLink).subscribe({
|
||||
next: (result) => {
|
||||
this.saving = false;
|
||||
this.availableFiles = result;
|
||||
this.currentTorrentFile = this.magnetLink;
|
||||
result.forEach((file) => {
|
||||
this.downloadFiles[file.filename] = true;
|
||||
});
|
||||
},
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
} else if (this.selectedFile) {
|
||||
this.torrentService.checkFiles(this.selectedFile).subscribe({
|
||||
next: (result) => {
|
||||
this.saving = false;
|
||||
this.availableFiles = result;
|
||||
result.forEach((file) => {
|
||||
this.downloadFiles[file.filename] = true;
|
||||
});
|
||||
},
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.saving = false;
|
||||
}
|
||||
}
|
||||
|
||||
public verifyRegex(): void {
|
||||
this.includeRegexError = null;
|
||||
this.excludeRegexError = null;
|
||||
this.regexSelected = null;
|
||||
|
||||
this.torrentService.verifyRegex(this.includeRegex, this.excludeRegex, this.magnetLink).subscribe((result) => {
|
||||
this.includeRegexError = result.includeError;
|
||||
this.excludeRegexError = result.excludeError;
|
||||
this.regexSelected = result.selectedFiles;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AuthResolverService } from './auth-resolver.service';
|
||||
import { AddNewTorrentComponent } from './add-new-torrent/add-new-torrent.component';
|
||||
import { authResolver } from './auth-resolver.service';
|
||||
import { LoginComponent } from './login/login.component';
|
||||
import { MainLayoutComponent } from './main-layout/main-layout.component';
|
||||
import { ProfileComponent } from './profile/profile.component';
|
||||
import { SettingsComponent } from './settings/settings.component';
|
||||
import { SetupComponent } from './setup/setup.component';
|
||||
import { TorrentTableComponent } from './torrent-table/torrent-table.component';
|
||||
import { TorrentComponent } from './torrent/torrent.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
|
|
@ -18,8 +23,30 @@ const routes: Routes = [
|
|||
path: '',
|
||||
component: MainLayoutComponent,
|
||||
resolve: {
|
||||
isLoggedIn: AuthResolverService,
|
||||
isLoggedIn: authResolver,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: TorrentTableComponent,
|
||||
},
|
||||
{
|
||||
path: 'torrent/:id',
|
||||
component: TorrentComponent,
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
component: AddNewTorrentComponent,
|
||||
},
|
||||
{
|
||||
path: 'settings',
|
||||
component: SettingsComponent,
|
||||
},
|
||||
{
|
||||
path: 'profile',
|
||||
component: ProfileComponent,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: '<router-outlet></router-outlet>',
|
||||
styles: [],
|
||||
imports: [RouterOutlet],
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { curray } from 'curray';
|
||||
import { FileSizePipe, NgxFilesizeModule } from 'ngx-filesize';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { AuthInterceptor } from './auth.interceptor';
|
||||
import { DownloadStatusPipe } from './download-status.pipe';
|
||||
import { LoginComponent } from './login/login.component';
|
||||
import { MainLayoutComponent } from './main-layout/main-layout.component';
|
||||
import { AddNewTorrentComponent } from './navbar/add-new-torrent/add-new-torrent.component';
|
||||
import { NavbarComponent } from './navbar/navbar.component';
|
||||
import { SettingsComponent } from './navbar/settings/settings.component';
|
||||
import { SetupComponent } from './setup/setup.component';
|
||||
import { TorrentDownloadComponent } from './torrent-download/torrent-download.component';
|
||||
import { TorrentFileComponent } from './torrent-file/torrent-file.component';
|
||||
import { TorrentRowComponent } from './torrent-row/torrent-row.component';
|
||||
import { TorrentStatusPipe } from './torrent-status.pipe';
|
||||
import { TorrentTableComponent } from './torrent-table/torrent-table.component';
|
||||
|
||||
curray();
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
MainLayoutComponent,
|
||||
NavbarComponent,
|
||||
AddNewTorrentComponent,
|
||||
TorrentTableComponent,
|
||||
TorrentRowComponent,
|
||||
TorrentFileComponent,
|
||||
SettingsComponent,
|
||||
TorrentStatusPipe,
|
||||
DownloadStatusPipe,
|
||||
LoginComponent,
|
||||
SetupComponent,
|
||||
TorrentDownloadComponent,
|
||||
],
|
||||
imports: [BrowserModule, AppRoutingModule, FormsModule, HttpClientModule, NgxFilesizeModule],
|
||||
providers: [FileSizePipe, { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
|
@ -1,15 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Resolve } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { inject } from '@angular/core';
|
||||
import { AuthService } from './auth.service';
|
||||
import { ResolveFn } from '@angular/router';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AuthResolverService implements Resolve<Observable<any>> {
|
||||
constructor(private authService: AuthService) {}
|
||||
|
||||
resolve() {
|
||||
return this.authService.isLoggedIn();
|
||||
}
|
||||
}
|
||||
export const authResolver: ResolveFn<boolean> = () => {
|
||||
return inject(AuthService).isLoggedIn();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class AuthInterceptor implements HttpInterceptor {
|
||||
constructor(private router: Router) {}
|
||||
private router = inject(Router);
|
||||
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
return next.handle(req).pipe(
|
||||
|
|
@ -16,8 +16,8 @@ export class AuthInterceptor implements HttpInterceptor {
|
|||
} else if (error && (error.status === 401 || error.status === 403)) {
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
return throwError(error);
|
||||
})
|
||||
return throwError(() => error);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,48 @@
|
|||
import { APP_BASE_HREF } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AuthService {
|
||||
constructor(private http: HttpClient) {}
|
||||
private http = inject(HttpClient);
|
||||
private baseHref = inject(APP_BASE_HREF);
|
||||
|
||||
public isLoggedIn(): Observable<void> {
|
||||
return this.http.get<void>(`/Api/Authentication/IsLoggedIn`);
|
||||
public isLoggedIn(): Observable<boolean> {
|
||||
return this.http.get<boolean>(`${this.baseHref}Api/Authentication/IsLoggedIn`);
|
||||
}
|
||||
|
||||
public create(userName: string, password: string): Observable<void> {
|
||||
return this.http.post<void>(`/Api/Authentication/Create`, {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Authentication/Create`, {
|
||||
userName,
|
||||
password,
|
||||
});
|
||||
}
|
||||
|
||||
public setupProvider(provider: number, token: string): Observable<void> {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Authentication/SetupProvider`, {
|
||||
provider,
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
public login(userName: string, password: string): Observable<void> {
|
||||
return this.http.post<void>(`/Api/Authentication/Login`, {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Authentication/Login`, {
|
||||
userName,
|
||||
password,
|
||||
});
|
||||
}
|
||||
|
||||
public logout() {
|
||||
return this.http.post<void>(`/Api/Authentication/Logout`, {});
|
||||
return this.http.post<void>(`${this.baseHref}Api/Authentication/Logout`, {});
|
||||
}
|
||||
|
||||
public update(userName: string, password: string): Observable<void> {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Authentication/Update`, {
|
||||
userName,
|
||||
password,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
client/src/app/decode-uri.pipe.ts
Normal file
8
client/src/app/decode-uri.pipe.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({ name: 'decodeURI' })
|
||||
export class DecodeURIPipe implements PipeTransform {
|
||||
transform(input: any) {
|
||||
return decodeURI(input);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { FileSizePipe } from 'ngx-filesize';
|
||||
import { Pipe, PipeTransform, inject } from '@angular/core';
|
||||
import { Download } from './models/download.model';
|
||||
import { FileSizePipe } from './filesize.pipe';
|
||||
|
||||
@Pipe({
|
||||
name: 'downloadStatus',
|
||||
})
|
||||
@Pipe({ name: 'downloadStatus' })
|
||||
export class DownloadStatusPipe implements PipeTransform {
|
||||
constructor(private pipe: FileSizePipe) {}
|
||||
private pipe = inject(FileSizePipe);
|
||||
|
||||
transform(value: Download): string {
|
||||
if (!value) {
|
||||
|
|
@ -14,7 +12,7 @@ export class DownloadStatusPipe implements PipeTransform {
|
|||
}
|
||||
|
||||
if (value.error) {
|
||||
return `Error: ${value.error}`;
|
||||
return value.error;
|
||||
}
|
||||
|
||||
if (value.completed != null) {
|
||||
|
|
@ -26,8 +24,9 @@ export class DownloadStatusPipe implements PipeTransform {
|
|||
}
|
||||
|
||||
if (value.unpackingStarted) {
|
||||
const progress = ((value.bytesDone / value.bytesTotal) * 100).toFixed(2);
|
||||
return `Unpacking ${progress || 0}%`;
|
||||
const progress = (value.bytesDone / value.bytesTotal || 0) * 100;
|
||||
|
||||
return `Unpacking ${progress.toFixed(2)}%`;
|
||||
}
|
||||
|
||||
if (value.unpackingQueued) {
|
||||
|
|
@ -39,10 +38,11 @@ export class DownloadStatusPipe implements PipeTransform {
|
|||
}
|
||||
|
||||
if (value.downloadStarted) {
|
||||
const progress = ((value.bytesDone / value.bytesTotal) * 100).toFixed(2);
|
||||
const progress = (value.bytesDone / value.bytesTotal || 0) * 100;
|
||||
|
||||
const speed = this.pipe.transform(value.speed, 'filesize');
|
||||
|
||||
return `Downloading ${progress || 0}% (${speed}/s)`;
|
||||
return `Downloading ${progress.toFixed(2)}% (${speed}/s)`;
|
||||
}
|
||||
|
||||
if (value.downloadQueued) {
|
||||
|
|
|
|||
17
client/src/app/filesize.pipe.ts
Normal file
17
client/src/app/filesize.pipe.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { filesize } from 'filesize';
|
||||
|
||||
@Pipe({ name: 'filesize' })
|
||||
export class FileSizePipe implements PipeTransform {
|
||||
private static transformOne(value: number, options?: any): string {
|
||||
return filesize(value, options).toString();
|
||||
}
|
||||
|
||||
transform(value: number | number[], options?: any) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map((val) => FileSizePipe.transformOne(val, options));
|
||||
}
|
||||
|
||||
return FileSizePipe.transformOne(value, options);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,39 +3,58 @@
|
|||
<div class="container">
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-5-tablet is-5-desktop is-5-widescreen">
|
||||
<img src="../../assets/logo.png" />
|
||||
<img src="assets/logo.png" />
|
||||
<div class="box">
|
||||
<div class="field">
|
||||
<label for="" class="label">Username</label>
|
||||
<div class="control has-icons-left">
|
||||
<input type="text" placeholder="" class="input" name="userName" [(ngModel)]="userName" required />
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-envelope"></i>
|
||||
</span>
|
||||
<form (ngSubmit)="login()">
|
||||
<div class="field">
|
||||
<label for="userName" class="label">Username</label>
|
||||
<div class="control has-icons-left">
|
||||
<input
|
||||
type="text"
|
||||
placeholder=""
|
||||
class="input"
|
||||
name="userName"
|
||||
id="userName"
|
||||
(change)="setUserName($event)"
|
||||
required
|
||||
/>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-envelope"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="" class="label" name="password">Password</label>
|
||||
<div class="control has-icons-left">
|
||||
<input type="password" class="input" required name="password" [(ngModel)]="password" />
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-lock"></i>
|
||||
</span>
|
||||
<div class="field">
|
||||
<label for="password" class="label">Password</label>
|
||||
<div class="control has-icons-left">
|
||||
<input
|
||||
type="password"
|
||||
class="input"
|
||||
required
|
||||
name="password"
|
||||
id="password"
|
||||
(change)="setPassword($event)"
|
||||
/>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-lock"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="login()"
|
||||
[ngClass]="{ 'is-loading': loggingIn }"
|
||||
[disabled]="loggingIn"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
<div class="notification is-danger is-light" *ngIf="error?.length > 0">
|
||||
{{ error }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
type="submit"
|
||||
[ngClass]="{ 'is-loading': loggingIn }"
|
||||
[disabled]="loggingIn"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
@if (error?.length > 0) {
|
||||
<div class="notification is-danger is-light">
|
||||
{{ error }}
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,33 +1,42 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { NgClass } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.component.html',
|
||||
styleUrls: ['./login.component.scss'],
|
||||
imports: [FormsModule, NgClass],
|
||||
standalone: true,
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
export class LoginComponent {
|
||||
private authService = inject(AuthService);
|
||||
private router = inject(Router);
|
||||
|
||||
public userName: string;
|
||||
public password: string;
|
||||
public error: string;
|
||||
public loggingIn: boolean;
|
||||
|
||||
constructor(private authService: AuthService, private router: Router) {}
|
||||
public setUserName(event: Event): void {
|
||||
this.userName = (event.target as any).value;
|
||||
}
|
||||
|
||||
ngOnInit(): void {}
|
||||
public setPassword(event: Event): void {
|
||||
this.password = (event.target as any).value;
|
||||
}
|
||||
|
||||
public login(): void {
|
||||
this.error = null;
|
||||
this.loggingIn = true;
|
||||
this.authService.login(this.userName, this.password).subscribe(
|
||||
() => {
|
||||
this.router.navigate(['/']);
|
||||
},
|
||||
(err) => {
|
||||
this.authService.login(this.userName, this.password).subscribe({
|
||||
next: () => this.router.navigate(['/']),
|
||||
error: (err) => {
|
||||
this.loggingIn = false;
|
||||
this.error = err.error;
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<app-navbar></app-navbar>
|
||||
<section class="section main-list">
|
||||
<div class="container">
|
||||
<app-torrent-table></app-torrent-table>
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
import { NavbarComponent } from '../navbar/navbar.component';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-main-layout',
|
||||
templateUrl: './main-layout.component.html',
|
||||
styleUrls: ['./main-layout.component.scss'],
|
||||
imports: [NavbarComponent, RouterOutlet],
|
||||
standalone: true,
|
||||
})
|
||||
export class MainLayoutComponent implements OnInit {
|
||||
export class MainLayoutComponent {
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
|
|
|||
6
client/src/app/models/disk-space-status.model.ts
Normal file
6
client/src/app/models/disk-space-status.model.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export interface DiskSpaceStatus {
|
||||
isPaused: boolean;
|
||||
availableSpaceGB: number;
|
||||
thresholdGB: number;
|
||||
lastCheckTime: Date;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
export class Download {
|
||||
public downloadId: string;
|
||||
public torrentId: string;
|
||||
public path: string;
|
||||
public link: string;
|
||||
public added: Date;
|
||||
public downloadQueued: Date;
|
||||
|
|
@ -14,4 +15,5 @@ export class Download {
|
|||
public bytesTotal: number;
|
||||
public bytesDone: number;
|
||||
public speed: number;
|
||||
public retryCount: number;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
export class Profile {
|
||||
public provider: string;
|
||||
public userName: string;
|
||||
public expiration: Date;
|
||||
public currentVersion: string;
|
||||
public latestVersion: string;
|
||||
public isInsecure: boolean;
|
||||
public disableUpdateNotification: boolean;
|
||||
}
|
||||
|
|
|
|||
4
client/src/app/models/rate-limit-status.model.ts
Normal file
4
client/src/app/models/rate-limit-status.model.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export interface RateLimitStatus {
|
||||
nextDequeueTime: Date | null;
|
||||
secondsRemaining: number;
|
||||
}
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
export class Setting {
|
||||
public settingId: string;
|
||||
public value: string;
|
||||
key: string;
|
||||
value: boolean | number | null | string;
|
||||
displayName: null | string;
|
||||
description: null | string;
|
||||
type: string;
|
||||
settings: Setting[];
|
||||
enumValues: { [key: string]: string };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,32 @@ export class Torrent {
|
|||
public torrentId: string;
|
||||
public hash: string;
|
||||
public category: string;
|
||||
public downloadClient: number;
|
||||
public hostDownloadAction: number;
|
||||
public downloadAction: number;
|
||||
public finishedAction: number;
|
||||
public finishedActionDelay: number;
|
||||
public downloadMinSize: number;
|
||||
public includeRegex: string;
|
||||
public excludeRegex: string;
|
||||
public downloadManualFiles: string;
|
||||
|
||||
public added: Date;
|
||||
public filesSelected: Date;
|
||||
public completed: Date;
|
||||
public autoDownload: boolean;
|
||||
public autoUnpack: boolean;
|
||||
public autoDelete: boolean;
|
||||
|
||||
public fileOrMagnet: string;
|
||||
public isFile: boolean;
|
||||
|
||||
public retryCount: number;
|
||||
public downloadRetryAttempts: number;
|
||||
public torrentRetryAttempts: number;
|
||||
public deleteOnError: number;
|
||||
public lifetime: number;
|
||||
|
||||
public priority: number;
|
||||
public type: DownloadType;
|
||||
public error: string;
|
||||
|
||||
public rdId: string;
|
||||
public rdName: string;
|
||||
|
|
@ -23,9 +44,12 @@ export class Torrent {
|
|||
public rdSpeed: number;
|
||||
public rdSeeders: number;
|
||||
public rdFiles: string;
|
||||
public statusText?: string;
|
||||
public filesCount?: number;
|
||||
public downloadsCount?: number;
|
||||
|
||||
public files: TorrentFile[];
|
||||
public downloads: Download[];
|
||||
public files?: TorrentFile[];
|
||||
public downloads?: Download[];
|
||||
}
|
||||
|
||||
export class TorrentFile {
|
||||
|
|
@ -37,11 +61,24 @@ export class TorrentFile {
|
|||
public download: Download;
|
||||
}
|
||||
|
||||
export class TorrentFileAvailability {
|
||||
public filename: string;
|
||||
public filesize: number;
|
||||
}
|
||||
|
||||
export enum RealDebridStatus {
|
||||
Processing = 0,
|
||||
WaitingForFileSelection = 1,
|
||||
Downloading = 2,
|
||||
Finished = 3,
|
||||
Queued = 0,
|
||||
|
||||
Processing = 1,
|
||||
WaitingForFileSelection = 2,
|
||||
Downloading = 3,
|
||||
Finished = 4,
|
||||
Uploading = 5,
|
||||
|
||||
Error = 99,
|
||||
}
|
||||
|
||||
export enum DownloadType {
|
||||
Torrent = 0,
|
||||
Nzb = 1,
|
||||
}
|
||||
|
|
|
|||
3
client/src/app/models/version.model.ts
Normal file
3
client/src/app/models/version.model.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export class Version {
|
||||
public version: string;
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<div class="modal" [class.is-active]="isActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Add New Torrent</p>
|
||||
<button class="delete" aria-label="close" (click)="cancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<div class="field">
|
||||
<label class="label">Magnet Link</label>
|
||||
<div class="control">
|
||||
<textarea
|
||||
class="textarea"
|
||||
placeholder="Paste your magnet link here"
|
||||
[(ngModel)]="magnetLink"
|
||||
[disabled]="saving"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="field">
|
||||
<label class="label">Torrent file</label>
|
||||
<div class="file has-name">
|
||||
<label class="file-label">
|
||||
<input class="file-input" type="file" name="resume" (change)="pickFile($event)" [disabled]="saving" />
|
||||
<span class="file-cta">
|
||||
<span class="file-icon">
|
||||
<i class="fas fa-upload"></i>
|
||||
</span>
|
||||
<span class="file-label"> Pick a torrent file... </span>
|
||||
</span>
|
||||
<span class="file-name">
|
||||
{{ fileName }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="field">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="autoDownload" />
|
||||
Download torrent to host when finished downloading on Real-Debrid
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="autoUnpack" />
|
||||
Unpack files after downloading to host
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="autoDelete" />
|
||||
Remove torrent when finished downloading on host
|
||||
</label>
|
||||
</div>
|
||||
<div class="notification is-danger is-light" *ngIf="error">Cannot add torrent: {{ error | json }}</div>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button is-success" [disabled]="saving" [ngClass]="{ 'is-loading': saving }" (click)="ok()">
|
||||
<span>Add Torrent</span>
|
||||
</button>
|
||||
<button class="button" (click)="cancel()" [disabled]="saving">Cancel</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
.file-name {
|
||||
max-width: 24em;
|
||||
width: 24em;
|
||||
}
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { TorrentService } from 'src/app/torrent.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-new-torrent',
|
||||
templateUrl: './add-new-torrent.component.html',
|
||||
styleUrls: ['./add-new-torrent.component.scss'],
|
||||
})
|
||||
export class AddNewTorrentComponent implements OnInit {
|
||||
@Input()
|
||||
public get open(): boolean {
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
public set open(val: boolean) {
|
||||
this.reset();
|
||||
this.isActive = val;
|
||||
}
|
||||
|
||||
@Output()
|
||||
public openChange = new EventEmitter<boolean>();
|
||||
|
||||
public isActive = false;
|
||||
|
||||
public fileName: string;
|
||||
public magnetLink: string;
|
||||
public autoDownload: boolean;
|
||||
public autoUnpack: boolean;
|
||||
public autoDelete: boolean;
|
||||
|
||||
public saving = false;
|
||||
public error: string;
|
||||
|
||||
private selectedFile: File;
|
||||
|
||||
constructor(private torrentService: TorrentService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
public reset(): void {
|
||||
this.fileName = '';
|
||||
this.magnetLink = '';
|
||||
this.autoDelete = false;
|
||||
this.autoDownload = true;
|
||||
|
||||
this.saving = false;
|
||||
this.selectedFile = null;
|
||||
this.error = null;
|
||||
}
|
||||
|
||||
public pickFile(evt: Event): void {
|
||||
const files = (evt.target as HTMLInputElement).files;
|
||||
|
||||
if (files.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const file = files[0];
|
||||
|
||||
this.fileName = file.name;
|
||||
|
||||
this.selectedFile = file;
|
||||
}
|
||||
|
||||
public ok(): void {
|
||||
this.saving = true;
|
||||
this.error = null;
|
||||
|
||||
if (this.magnetLink) {
|
||||
this.torrentService.uploadMagnet(this.magnetLink, this.autoDownload, this.autoUnpack, this.autoDelete).subscribe(
|
||||
() => {
|
||||
this.cancel();
|
||||
},
|
||||
(err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
}
|
||||
);
|
||||
} else if (this.selectedFile) {
|
||||
this.torrentService.uploadFile(this.selectedFile, this.autoDownload, this.autoUnpack, this.autoDelete).subscribe(
|
||||
() => {
|
||||
this.cancel();
|
||||
},
|
||||
(err) => {
|
||||
this.error = err.error;
|
||||
this.saving = false;
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
this.isActive = false;
|
||||
this.openChange.emit(this.open);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<nav class="navbar is-dark is-fixed-top" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item">
|
||||
<img src="../../assets/logo.png" />
|
||||
<a class="navbar-item" routerLink="/">
|
||||
<img src="assets/logo.png" />
|
||||
</a>
|
||||
|
||||
<a
|
||||
|
|
@ -20,25 +20,36 @@
|
|||
|
||||
<div class="navbar-menu" [class.is-active]="showMobileMenu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" (click)="this.showNewTorrent = true">
|
||||
<a class="navbar-item" routerLink="/">
|
||||
<span class="icon">
|
||||
<i class="fas fa-table" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span>Torrents/NZBs</span>
|
||||
</a>
|
||||
<a class="navbar-item" routerLink="/add" [queryParams]="{ type: 'torrent' }">
|
||||
<span class="icon">
|
||||
<i class="fas fa-plus" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span>Add New Torrent</span>
|
||||
<span>Add Torrent/NZB</span>
|
||||
</a>
|
||||
<a class="navbar-item" (click)="this.showSettings = true">
|
||||
<a class="navbar-item" routerLink="/settings">
|
||||
<span class="icon">
|
||||
<i class="fas fa-cog" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
<a class="navbar-item" *ngIf="profile" href="https://real-debrid.com/?id=1348683" target="_blank" rel="noopener">
|
||||
<span class="icon">
|
||||
<i class="fas fa-euro-sign" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span *ngIf="profile.expiration">Premium Status: {{ profile.expiration | date }}</span>
|
||||
<span *ngIf="!profile.expiration" class="no-premium">Not premium</span>
|
||||
</a>
|
||||
@if (profile) {
|
||||
<a class="navbar-item" href="{{ providerLink }}" target="_blank" rel="noopener">
|
||||
<span class="icon">
|
||||
<i class="fas fa-euro-sign" aria-hidden="true"></i>
|
||||
</span>
|
||||
@if (profile.expiration) {
|
||||
<span>Premium Status: {{ profile.expiration | date }}</span>
|
||||
} @else {
|
||||
<span class="no-premium">Not premium</span>
|
||||
}
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="navbar-end">
|
||||
|
|
@ -46,15 +57,29 @@
|
|||
<span class="navbar-link"> Account </span>
|
||||
|
||||
<div class="navbar-dropdown is-right">
|
||||
<a class="navbar-item"> Profile </a>
|
||||
<a class="navbar-item" routerLink="profile"> Profile </a>
|
||||
<a class="navbar-item" (click)="logout()"> Logout </a>
|
||||
<hr class="navbar-divider" />
|
||||
<div class="navbar-item">Version 1.5.2</div>
|
||||
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version {{ version }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<app-add-new-torrent [(open)]="showNewTorrent"></app-add-new-torrent>
|
||||
<app-settings [(open)]="showSettings"></app-settings>
|
||||
@if (
|
||||
profile &&
|
||||
(!profile.disableUpdateNotification || profile.isInsecure) &&
|
||||
profile.latestVersion &&
|
||||
profile.currentVersion !== profile.latestVersion
|
||||
) {
|
||||
<div class="notification" [ngClass]="profile.isInsecure ? 'is-danger' : 'is-warning'">
|
||||
@if (profile.isInsecure) {
|
||||
<span> Your current version is insecure. </span>
|
||||
}
|
||||
<span>
|
||||
Version {{ profile.latestVersion }} of RealDebrid Client was found. You are currently on version
|
||||
{{ profile.currentVersion }}.
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
.no-premium {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.notification {
|
||||
margin-top: 52px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,77 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { TorrentService } from '../torrent.service';
|
||||
import { SettingsService } from '../settings.service';
|
||||
import { Profile } from '../models/profile.model';
|
||||
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { NavigationEnd, Router, RouterLink } from '@angular/router';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Profile } from '../models/profile.model';
|
||||
import { SettingsService } from '../settings.service';
|
||||
import { NgClass, DatePipe } from '@angular/common';
|
||||
import { filter } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
templateUrl: './navbar.component.html',
|
||||
styleUrls: ['./navbar.component.scss'],
|
||||
imports: [RouterLink, NgClass, DatePipe],
|
||||
standalone: true,
|
||||
})
|
||||
export class NavbarComponent implements OnInit {
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private settingsService = inject(SettingsService);
|
||||
private authService = inject(AuthService);
|
||||
private router = inject(Router);
|
||||
|
||||
public showMobileMenu = false;
|
||||
|
||||
public showNewTorrent = false;
|
||||
public showSettings = false;
|
||||
|
||||
public profile: Profile;
|
||||
public providerLink: string;
|
||||
public version: string;
|
||||
|
||||
constructor(private settingsService: SettingsService, private authService: AuthService, private router: Router) {}
|
||||
constructor() {
|
||||
this.router.events
|
||||
.pipe(
|
||||
filter((event): event is NavigationEnd => event instanceof NavigationEnd),
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.showMobileMenu = false;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.settingsService.getProfile().subscribe((result) => {
|
||||
this.profile = result;
|
||||
});
|
||||
this.settingsService
|
||||
.getProfile()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe((result) => {
|
||||
this.profile = result;
|
||||
|
||||
switch (result.provider) {
|
||||
case 'RealDebrid':
|
||||
this.providerLink = 'https://real-debrid.com/?id=1348683';
|
||||
break;
|
||||
case 'AllDebrid':
|
||||
this.providerLink = 'https://alldebrid.com/?uid=2v91l&lang=en';
|
||||
break;
|
||||
case 'Premiumize':
|
||||
this.providerLink = 'https://www.premiumize.me/';
|
||||
break;
|
||||
case 'TorBox':
|
||||
this.providerLink = 'https://torbox.app/';
|
||||
break;
|
||||
case 'DebridLink':
|
||||
this.providerLink = 'https://debrid-link.com/';
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
this.settingsService
|
||||
.getVersion()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe((result) => {
|
||||
this.version = result.version;
|
||||
});
|
||||
}
|
||||
|
||||
public logout(): void {
|
||||
this.authService.logout().subscribe(
|
||||
() => {
|
||||
this.router.navigate(['/login']);
|
||||
},
|
||||
(err) => {}
|
||||
);
|
||||
this.authService.logout().subscribe({ next: () => this.router.navigate(['/login']), error: console.error });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,217 +0,0 @@
|
|||
<div class="modal" [class.is-active]="isActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Settings</p>
|
||||
<button class="delete" aria-label="close" (click)="cancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid API Key</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" maxlength="100" [(ngModel)]="settingRealDebridApiKey" />
|
||||
</div>
|
||||
<p class="help">
|
||||
You can find your API key here:
|
||||
<a href="https://real-debrid.com/apitoken" target="_blank" rel="noopener">https://real-debrid.com/apitoken</a
|
||||
>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Download path</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" maxlength="1000" [(ngModel)]="settingDownloadPath" />
|
||||
</div>
|
||||
<p class="help">Path in the docker container to download files to (i.e. /data/downloads).</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Mapped path</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" maxlength="1000" [(ngModel)]="settingMappedPath" />
|
||||
</div>
|
||||
<p class="help">
|
||||
Path where files are downloaded to on your host (i.e. D:\Downloads). This path is used for Radarr and Sonarr
|
||||
to find your downloads.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Download client</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="settingDownloadClient">
|
||||
<option value="Simple">Simple Downloader</option>
|
||||
<option value="MultiPart">Multi Part Downloader</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">
|
||||
Select which download client to use, see the
|
||||
<a href="https://github.com/rogerfar/rdt-client/" target="_blank">README</a> for the various options.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field" *ngIf="settingDownloadClient === 'MultiPart'">
|
||||
<label class="label">Temp Download path</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" maxlength="1000" [(ngModel)]="settingTempPath" />
|
||||
</div>
|
||||
<p class="help">
|
||||
Path in the docker container to temporarily download to (i.e. /data/temp). Make sure the docker container has
|
||||
enough disk space if using a path inside the container.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Maximum parallel downloads</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="100" min="1" [(ngModel)]="settingDownloadLimit" />
|
||||
</div>
|
||||
<p class="help">Maximum amount of torrents that get downloaded to your host at the same time.</p>
|
||||
</div>
|
||||
|
||||
<div class="field" *ngIf="settingDownloadClient === 'MultiPart'">
|
||||
<label class="label">Parallel connections per download</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="100" min="0" [(ngModel)]="settingDownloadChunkCount" />
|
||||
</div>
|
||||
<p class="help">
|
||||
Maximum amount of parallel threads that are used to download a single torrent to your host. If set to 1 no
|
||||
parallel downloading will be done.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field" *ngIf="settingDownloadClient === 'MultiPart'">
|
||||
<label class="label">Download speed (in MB/s)</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="1000" min="0" [(ngModel)]="settingDownloadMaxSpeed" />
|
||||
</div>
|
||||
<p class="help">Maximum download speed in Megabytes per second. When set to 0 unlimited speed is used.</p>
|
||||
</div>
|
||||
|
||||
<div class="field" *ngIf="settingDownloadClient === 'MultiPart'">
|
||||
<label class="label">Proxy Server</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" maxlength="1000" [(ngModel)]="settingProxyServer" />
|
||||
</div>
|
||||
<p class="help">Address of a proxy server.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Maximum unpack processes</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="100" min="1" [(ngModel)]="settingUnpackLimit" />
|
||||
</div>
|
||||
<p class="help">Maximum amount of downloads that get unpacked on your host at the same time.</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Minimum file size to download</label>
|
||||
<div class="control">
|
||||
<div class="field has-addons" style="margin-bottom: 0">
|
||||
<div class="control is-expanded">
|
||||
<input class="input" type="number" max="100" min="1" [(ngModel)]="settingMinFileSize" />
|
||||
</div>
|
||||
<div class="control">
|
||||
<a class="button is-static">MB</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="help">When selecting files in the torrent, skip files smaller than this setting.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="settingOnlyDownloadAvailableFiles" />
|
||||
Only download available files on RealDebrid
|
||||
</label>
|
||||
<div class="help">
|
||||
When selected, it will only download files in the torrent that have been download by Real Debrid. You can
|
||||
use this in combination with the Min File size setting above.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Test download path permissions</label>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testDownloadPath()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
*ngIf="!testPathError && !testPathSuccess"
|
||||
>
|
||||
Test permissions
|
||||
</button>
|
||||
<div class="notification is-danger is-light" *ngIf="testPathError">
|
||||
Could not test your download path<br />
|
||||
{{ testPathError }}
|
||||
</div>
|
||||
|
||||
<div class="notification is-success is-light" *ngIf="testPathSuccess">Your download path looks good!</div>
|
||||
</div>
|
||||
<div class="help">This will check if the download folder has write permissions.</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Test RealDebrid download speed</label>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testDownloadSpeed()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
*ngIf="!testDownloadSpeedError && !testDownloadSpeedSuccess"
|
||||
>
|
||||
Test download speed
|
||||
</button>
|
||||
<div class="notification is-danger is-light" *ngIf="testDownloadSpeedError">
|
||||
Could not test your download speed<br />
|
||||
{{ testDownloadSpeedError }}
|
||||
</div>
|
||||
|
||||
<div class="notification is-success is-light" *ngIf="testDownloadSpeedSuccess">
|
||||
Download speed {{ testDownloadSpeedSuccess | filesize }}/s
|
||||
</div>
|
||||
</div>
|
||||
<div class="help">
|
||||
This will download a 10GB test file from RealDebrid. Hit cancel when you have seen enough.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Test download folder write speed</label>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testWriteSpeed()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
*ngIf="!testWriteSpeedError && !testWriteSpeedSuccess"
|
||||
>
|
||||
Test write speed
|
||||
</button>
|
||||
<div class="notification is-danger is-light" *ngIf="testWriteSpeedError">
|
||||
Could not test your download speed<br />
|
||||
{{ testWriteSpeedError }}
|
||||
</div>
|
||||
|
||||
<div class="notification is-success is-light" *ngIf="testWriteSpeedSuccess">
|
||||
Write speed {{ testWriteSpeedSuccess | filesize }}/s
|
||||
</div>
|
||||
</div>
|
||||
<div class="help">This will write a small file to your download folder to see how fast it can write to it.</div>
|
||||
</div>
|
||||
|
||||
<div class="notification is-danger is-light" *ngIf="error?.length > 0">Error saving settings: {{ error }}</div>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button is-success" (click)="ok()" [disabled]="saving" [ngClass]="{ 'is-loading': saving }">
|
||||
Save Settings
|
||||
</button>
|
||||
<button class="button" (click)="cancel()" [disabled]="saving" [ngClass]="{ 'is-loading': saving }">Cancel</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Setting } from 'src/app/models/setting.model';
|
||||
import { SettingsService } from 'src/app/settings.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrls: ['./settings.component.scss'],
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
@Input()
|
||||
public get open(): boolean {
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
public set open(val: boolean) {
|
||||
this.reset();
|
||||
this.isActive = val;
|
||||
}
|
||||
|
||||
@Output()
|
||||
public openChange = new EventEmitter<boolean>();
|
||||
|
||||
public isActive = false;
|
||||
|
||||
public saving = false;
|
||||
public error: string;
|
||||
|
||||
public testPathError: string;
|
||||
public testPathSuccess: boolean;
|
||||
|
||||
public testDownloadSpeedError: string;
|
||||
public testDownloadSpeedSuccess: number;
|
||||
|
||||
public testWriteSpeedError: string;
|
||||
public testWriteSpeedSuccess: number;
|
||||
|
||||
public settingRealDebridApiKey: string;
|
||||
public settingDownloadPath: string;
|
||||
public settingMappedPath: string;
|
||||
public settingTempPath: string;
|
||||
public settingDownloadClient: string;
|
||||
public settingDownloadLimit: number;
|
||||
public settingDownloadChunkCount: number;
|
||||
public settingDownloadMaxSpeed: number;
|
||||
public settingUnpackLimit: number;
|
||||
public settingMinFileSize: number;
|
||||
public settingOnlyDownloadAvailableFiles: boolean;
|
||||
public settingProxyServer: string;
|
||||
|
||||
constructor(private settingsService: SettingsService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
public reset(): void {
|
||||
this.saving = false;
|
||||
this.error = null;
|
||||
|
||||
this.settingsService.get().subscribe(
|
||||
(results) => {
|
||||
this.settingRealDebridApiKey = this.getSetting(results, 'RealDebridApiKey');
|
||||
this.settingDownloadPath = this.getSetting(results, 'DownloadPath');
|
||||
this.settingMappedPath = this.getSetting(results, 'MappedPath');
|
||||
this.settingTempPath = this.getSetting(results, 'TempPath');
|
||||
this.settingDownloadClient = this.getSetting(results, 'DownloadClient');
|
||||
this.settingDownloadLimit = parseInt(this.getSetting(results, 'DownloadLimit'), 10);
|
||||
this.settingDownloadChunkCount = parseInt(this.getSetting(results, 'DownloadChunkCount'), 10);
|
||||
this.settingDownloadMaxSpeed = parseInt(this.getSetting(results, 'DownloadMaxSpeed'), 10);
|
||||
this.settingUnpackLimit = parseInt(this.getSetting(results, 'UnpackLimit'), 10);
|
||||
this.settingMinFileSize = parseInt(this.getSetting(results, 'MinFileSize'), 10);
|
||||
this.settingOnlyDownloadAvailableFiles = this.getSetting(results, 'OnlyDownloadAvailableFiles') === '1';
|
||||
this.settingProxyServer = this.getSetting(results, 'ProxyServer');
|
||||
},
|
||||
(err) => {
|
||||
this.error = err.error;
|
||||
this.saving = true;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public ok(): void {
|
||||
this.saving = true;
|
||||
|
||||
const settings: Setting[] = [
|
||||
{
|
||||
settingId: 'RealDebridApiKey',
|
||||
value: this.settingRealDebridApiKey,
|
||||
},
|
||||
{
|
||||
settingId: 'DownloadPath',
|
||||
value: this.settingDownloadPath,
|
||||
},
|
||||
{
|
||||
settingId: 'MappedPath',
|
||||
value: this.settingMappedPath,
|
||||
},
|
||||
{
|
||||
settingId: 'TempPath',
|
||||
value: this.settingTempPath,
|
||||
},
|
||||
{
|
||||
settingId: 'DownloadClient',
|
||||
value: this.settingDownloadClient,
|
||||
},
|
||||
{
|
||||
settingId: 'DownloadLimit',
|
||||
value: (this.settingDownloadLimit ?? 10).toString(),
|
||||
},
|
||||
{
|
||||
settingId: 'DownloadChunkCount',
|
||||
value: (this.settingDownloadChunkCount ?? 8).toString(),
|
||||
},
|
||||
{
|
||||
settingId: 'DownloadMaxSpeed',
|
||||
value: (this.settingDownloadMaxSpeed ?? 0).toString(),
|
||||
},
|
||||
{
|
||||
settingId: 'UnpackLimit',
|
||||
value: (this.settingUnpackLimit ?? 1).toString(),
|
||||
},
|
||||
{
|
||||
settingId: 'MinFileSize',
|
||||
value: (this.settingMinFileSize ?? 0).toString(),
|
||||
},
|
||||
{
|
||||
settingId: 'OnlyDownloadAvailableFiles',
|
||||
value: (this.settingOnlyDownloadAvailableFiles ? '1' : '0').toString(),
|
||||
},
|
||||
{
|
||||
settingId: 'ProxyServer',
|
||||
value: this.settingProxyServer,
|
||||
},
|
||||
];
|
||||
|
||||
this.settingsService.update(settings).subscribe(
|
||||
() => {
|
||||
this.isActive = false;
|
||||
this.openChange.emit(this.open);
|
||||
},
|
||||
(err) => {
|
||||
this.error = err;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public testDownloadPath(): void {
|
||||
this.saving = true;
|
||||
this.testPathError = null;
|
||||
this.testPathSuccess = false;
|
||||
|
||||
this.settingsService.testPath(this.settingDownloadPath).subscribe(
|
||||
() => {
|
||||
this.saving = false;
|
||||
this.testPathSuccess = true;
|
||||
},
|
||||
(err) => {
|
||||
this.testPathError = err.error;
|
||||
this.saving = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public testDownloadSpeed(): void {
|
||||
this.saving = true;
|
||||
this.testDownloadSpeedError = null;
|
||||
this.testDownloadSpeedSuccess = 0;
|
||||
|
||||
this.settingsService.testDownloadSpeed().subscribe(
|
||||
(result) => {
|
||||
this.saving = false;
|
||||
this.testDownloadSpeedSuccess = result;
|
||||
},
|
||||
(err) => {
|
||||
this.testDownloadSpeedError = err.error;
|
||||
this.saving = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
public testWriteSpeed(): void {
|
||||
this.saving = true;
|
||||
this.testWriteSpeedError = null;
|
||||
this.testWriteSpeedSuccess = 0;
|
||||
|
||||
this.settingsService.testWriteSpeed().subscribe(
|
||||
(result) => {
|
||||
this.saving = false;
|
||||
this.testWriteSpeedSuccess = result;
|
||||
},
|
||||
(err) => {
|
||||
this.testWriteSpeedError = err.error;
|
||||
this.saving = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
this.isActive = false;
|
||||
this.openChange.emit(this.open);
|
||||
}
|
||||
|
||||
private getSetting(settings: Setting[], key: string): string {
|
||||
const setting = settings.filter((m) => m.settingId === key);
|
||||
|
||||
if (setting.length !== 1) {
|
||||
throw new Error(`Unable to find setting with key ${key}`);
|
||||
}
|
||||
|
||||
return setting[0].value;
|
||||
}
|
||||
}
|
||||
25
client/src/app/nl2br.pipe.ts
Normal file
25
client/src/app/nl2br.pipe.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { Pipe, PipeTransform, SecurityContext, VERSION, inject } from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
@Pipe({ name: 'nl2br' })
|
||||
export class Nl2BrPipe implements PipeTransform {
|
||||
private sanitizer = inject(DomSanitizer);
|
||||
|
||||
transform(value: string, sanitizeBeforehand?: boolean): string {
|
||||
if (typeof value !== 'string') {
|
||||
return value;
|
||||
}
|
||||
let result: any;
|
||||
const textParsed = value.replace(/(?:\r\n|\r|\n)/g, '<br />');
|
||||
|
||||
if (!VERSION || VERSION.major === '2') {
|
||||
result = this.sanitizer.bypassSecurityTrustHtml(textParsed);
|
||||
} else if (sanitizeBeforehand) {
|
||||
result = this.sanitizer.sanitize(SecurityContext.HTML, textParsed);
|
||||
} else {
|
||||
result = textParsed;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
42
client/src/app/profile/profile.component.html
Normal file
42
client/src/app/profile/profile.component.html
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<div class="field">
|
||||
<label class="label">Login username</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" minlength="1" [(ngModel)]="username" />
|
||||
</div>
|
||||
<p class="help">
|
||||
This is the username you use to login Real-Debrid Client. Only change this if you want to change the username.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Login password</label>
|
||||
<div class="control">
|
||||
<input class="input" type="password" minlength="1" [(ngModel)]="password" />
|
||||
</div>
|
||||
<p class="help">
|
||||
This is the password you use to login Real-Debrid Client. Only change this if you want to change the password.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
@if (error !== null) {
|
||||
<div class="notification is-danger is-light">Error saving: {{ error }}</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
@if (success) {
|
||||
<div class="notification is-success is-light">Your profile has been updated</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<button class="button is-success" (click)="save()" [disabled]="saving" [ngClass]="{ 'is-loading': saving }">
|
||||
Save Profile
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
40
client/src/app/profile/profile.component.ts
Normal file
40
client/src/app/profile/profile.component.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { Component, inject } from '@angular/core';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { NgClass } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
templateUrl: './profile.component.html',
|
||||
styleUrls: ['./profile.component.scss'],
|
||||
imports: [FormsModule, NgClass],
|
||||
standalone: true,
|
||||
})
|
||||
export class ProfileComponent {
|
||||
private authService = inject(AuthService);
|
||||
|
||||
public username: string;
|
||||
public password: string;
|
||||
|
||||
public saving = false;
|
||||
public success: boolean;
|
||||
public error: string;
|
||||
|
||||
public save(): void {
|
||||
this.success = false;
|
||||
this.error = null;
|
||||
this.saving = true;
|
||||
|
||||
this.authService.update(this.username, this.password).subscribe({
|
||||
next: () => {
|
||||
this.success = true;
|
||||
this.saving = false;
|
||||
},
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
this.success = false;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +1,50 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Profile } from './models/profile.model';
|
||||
import { Setting } from './models/setting.model';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
import { Version } from './models/version.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SettingsService {
|
||||
constructor(private http: HttpClient) {}
|
||||
private http = inject(HttpClient);
|
||||
private baseHref = inject(APP_BASE_HREF);
|
||||
|
||||
public get(): Observable<Setting[]> {
|
||||
return this.http.get<Setting[]>(`/Api/Settings`);
|
||||
return this.http.get<Setting[]>(`${this.baseHref}Api/Settings`);
|
||||
}
|
||||
|
||||
public update(settings: Setting[]): Observable<void> {
|
||||
return this.http.put<void>(`/Api/Settings`, { settings });
|
||||
return this.http.put<void>(`${this.baseHref}Api/Settings`, settings);
|
||||
}
|
||||
|
||||
public getProfile(): Observable<Profile> {
|
||||
return this.http.get<Profile>(`/Api/Settings/Profile`);
|
||||
return this.http.get<Profile>(`${this.baseHref}Api/Settings/Profile`);
|
||||
}
|
||||
|
||||
public getVersion(): Observable<Version> {
|
||||
return this.http.get<Version>(`${this.baseHref}Api/Settings/Version`);
|
||||
}
|
||||
|
||||
public testPath(path: string): Observable<void> {
|
||||
return this.http.post<void>(`/Api/Settings/TestPath`, { path });
|
||||
return this.http.post<void>(`${this.baseHref}Api/Settings/TestPath`, { path });
|
||||
}
|
||||
|
||||
public testDownloadSpeed(): Observable<number> {
|
||||
return this.http.get<number>(`/Api/Settings/TestDownloadSpeed`);
|
||||
return this.http.get<number>(`${this.baseHref}Api/Settings/TestDownloadSpeed`);
|
||||
}
|
||||
|
||||
public testWriteSpeed(): Observable<number> {
|
||||
return this.http.get<number>(`/Api/Settings/TestWriteSpeed`);
|
||||
return this.http.get<number>(`${this.baseHref}Api/Settings/TestWriteSpeed`);
|
||||
}
|
||||
|
||||
public testAria2cConnection(url: string, secret: string): Observable<{ version: string }> {
|
||||
return this.http.post<{ version: string }>(`${this.baseHref}Api/Settings/TestAria2cConnection`, {
|
||||
url,
|
||||
secret,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
219
client/src/app/settings/settings.component.html
Normal file
219
client/src/app/settings/settings.component.html
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
@for (tab of tabs; track tab.key; let i = $index) {
|
||||
<li [ngClass]="{ 'is-active': activeTab === i }" (click)="activeTab = i">
|
||||
<a>{{ tab.displayName }}</a>
|
||||
</li>
|
||||
}
|
||||
<li [ngClass]="{ 'is-active': activeTab === 99 }" (click)="activeTab = 99">
|
||||
<a>Speed Tests</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@for (tab of tabs; track tab.key; let i = $index) {
|
||||
<div [hidden]="activeTab !== i">
|
||||
<h3>{{ tab.description }}</h3>
|
||||
@for (setting of tab.settings; track setting.key) {
|
||||
@if (setting.type === "Object") {
|
||||
<h3 class="title is-3" style="margin-top: 1.2rem">{{ setting.displayName }}</h3>
|
||||
}
|
||||
<div class="field">
|
||||
@if (setting.type !== "Boolean" && setting.type !== "Object") {
|
||||
<label class="label">{{ setting.displayName }}</label>
|
||||
}
|
||||
@switch (setting.type) {
|
||||
@case ("String") {
|
||||
<div class="control">
|
||||
<input class="input" type="text" [(ngModel)]="setting.value" />
|
||||
</div>
|
||||
}
|
||||
@case ("Int32") {
|
||||
<div class="control">
|
||||
<input class="input" type="number" [(ngModel)]="setting.value" />
|
||||
</div>
|
||||
}
|
||||
@case ("Boolean") {
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="setting.value" />
|
||||
{{ setting.displayName }}
|
||||
</label>
|
||||
}
|
||||
@case ("Enum") {
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="setting.value">
|
||||
@for (kvp of setting.enumValues | keyvalue; track kvp) {
|
||||
<option [value]="kvp.key">{{ kvp.value }}</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
@case ("Object") {}
|
||||
@default {
|
||||
<div class="control">Invalid setting type {{ setting.type }}</div>
|
||||
}
|
||||
}
|
||||
<p class="help" [innerHtml]="setting.description | nl2br"></p>
|
||||
@if (setting.key === "DownloadClient:Aria2cSecret") {
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testAria2cConnection()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
>
|
||||
Test aria2 connection
|
||||
</button>
|
||||
@if (testAria2cConnectionError) {
|
||||
<div class="notification is-danger is-light" style="margin-top: 1rem">
|
||||
Could connect to Aria2 client<br />
|
||||
{{ testAria2cConnectionError }}
|
||||
</div>
|
||||
}
|
||||
@if (testAria2cConnectionSuccess) {
|
||||
<div class="notification is-success is-light" style="margin-top: 1rem">
|
||||
Found Aria2 client version {{ testAria2cConnectionSuccess }}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (activeTab === 99) {
|
||||
<div>
|
||||
<div class="field">
|
||||
<label class="label">Test download path permissions</label>
|
||||
<div class="control">
|
||||
@if (!testPathError && !testPathSuccess) {
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testDownloadPath()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
>
|
||||
Test permissions
|
||||
</button>
|
||||
}
|
||||
@if (testPathError) {
|
||||
<div class="notification is-danger is-light">
|
||||
Could not test your download path<br />
|
||||
{{ testPathError }}
|
||||
</div>
|
||||
}
|
||||
@if (testPathSuccess) {
|
||||
<div class="notification is-success is-light">Your download path looks good!</div>
|
||||
}
|
||||
</div>
|
||||
<div class="help">This will check if the download folder has write permissions.</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Test Real-Debrid download speed</label>
|
||||
<div class="control">
|
||||
@if (testDownloadSpeedError) {
|
||||
<div class="notification is-danger is-light">
|
||||
Could not test your download speed<br />
|
||||
{{ testDownloadSpeedError }}
|
||||
</div>
|
||||
} @else if (testDownloadSpeedSuccess) {
|
||||
<div class="notification is-success is-light">Download speed {{ testDownloadSpeedSuccess | filesize }}/s</div>
|
||||
} @else {
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testDownloadSpeed()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
>
|
||||
Test download speed
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="help">
|
||||
This will attempt to download a 10GB file from Real-Debrid. When 50MB has been downloaded the test will stop.
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Test download folder write speed</label>
|
||||
<div class="control">
|
||||
@if (testWriteSpeedError) {
|
||||
<div class="notification is-danger is-light">
|
||||
Could not test your download speed<br />
|
||||
{{ testWriteSpeedError }}
|
||||
</div>
|
||||
} @else if (testWriteSpeedSuccess) {
|
||||
<div class="notification is-success is-light">Write speed {{ testWriteSpeedSuccess | filesize }}/s</div>
|
||||
} @else {
|
||||
<button
|
||||
class="button is-warning"
|
||||
(click)="testWriteSpeed()"
|
||||
[disabled]="saving"
|
||||
[ngClass]="{ 'is-loading': saving }"
|
||||
>
|
||||
Test write speed
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
<div class="help">This will write a small file to your download folder to see how fast it can write to it.</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
@if (error?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error saving settings: {{ error }}</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (activeTab === 0) {
|
||||
<div class="field">
|
||||
<label class="label">Register client as magnet link handler</label>
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-info"
|
||||
type="button"
|
||||
(click)="registerMagnetHandler()"
|
||||
[disabled]="!canRegisterMagnetHandler"
|
||||
>
|
||||
<span>
|
||||
{{ canRegisterMagnetHandler ? "Register Handler" : "Unavailable in This Browser" }}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<p class="help">
|
||||
@if (canRegisterMagnetHandler) {
|
||||
This will attempt to register the client as your browser's default handler for magnet links and automatically
|
||||
open them in the new torrent screen for downloading.
|
||||
} @else {
|
||||
Magnet link registration is unavailable. Your
|
||||
<a
|
||||
href="https://caniuse.com/mdn-api_navigator_registerprotocolhandler"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
browser may not support this feature
|
||||
</a>
|
||||
, or the client is not being served in a
|
||||
<a
|
||||
href="https://developer.mozilla.org/en-US/docs/Glossary/Secure_Context/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
secure context
|
||||
</a>
|
||||
.
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (activeTab < 99) {
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<button class="button is-success" (click)="ok()" [disabled]="saving" [ngClass]="{ 'is-loading': saving }">
|
||||
Save Settings
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
0
client/src/app/settings/settings.component.scss
Normal file
0
client/src/app/settings/settings.component.scss
Normal file
160
client/src/app/settings/settings.component.ts
Normal file
160
client/src/app/settings/settings.component.ts
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
import { Component, OnInit, inject } from '@angular/core';
|
||||
import { Setting } from '../models/setting.model';
|
||||
import { NgClass, KeyValuePipe } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Nl2BrPipe } from '../nl2br.pipe';
|
||||
import { FileSizePipe } from '../filesize.pipe';
|
||||
import { SettingsService } from '../settings.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrls: ['./settings.component.scss'],
|
||||
imports: [NgClass, FormsModule, KeyValuePipe, Nl2BrPipe, FileSizePipe],
|
||||
standalone: true,
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
private settingsService = inject(SettingsService);
|
||||
|
||||
public activeTab = 0;
|
||||
|
||||
public tabs: Setting[] = [];
|
||||
|
||||
public saving = false;
|
||||
public error: string;
|
||||
|
||||
public testPathError: string;
|
||||
public testPathSuccess: boolean;
|
||||
|
||||
public testDownloadSpeedError: string;
|
||||
public testDownloadSpeedSuccess: number;
|
||||
|
||||
public testWriteSpeedError: string;
|
||||
public testWriteSpeedSuccess: number;
|
||||
|
||||
public testAria2cConnectionError: string = null;
|
||||
public testAria2cConnectionSuccess: string = null;
|
||||
|
||||
public canRegisterMagnetHandler = false;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.reset();
|
||||
this.canRegisterMagnetHandler = !!(window.isSecureContext && 'registerProtocolHandler' in navigator);
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
this.settingsService.get().subscribe((settings) => {
|
||||
this.tabs = settings.filter((m) => m.key.indexOf(':') === -1);
|
||||
|
||||
for (let tab of this.tabs) {
|
||||
tab.settings = settings.filter((m) => m.key.indexOf(`${tab.key}:`) > -1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ok(): void {
|
||||
this.saving = true;
|
||||
|
||||
const settingsToSave = this.tabs.flatMap((m) => m.settings).filter((m) => m.type !== 'Object');
|
||||
|
||||
this.settingsService.update(settingsToSave).subscribe({
|
||||
next: () =>
|
||||
setTimeout(() => {
|
||||
this.saving = false;
|
||||
}, 1000),
|
||||
error: (err) => {
|
||||
this.saving = false;
|
||||
this.error = err;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public testDownloadPath(): void {
|
||||
const settingDownloadPath = this.tabs
|
||||
.find((m) => m.key === 'DownloadClient')
|
||||
.settings.find((m) => m.key === 'DownloadClient:DownloadPath').value as string;
|
||||
|
||||
this.saving = true;
|
||||
this.testPathError = null;
|
||||
this.testPathSuccess = false;
|
||||
|
||||
this.settingsService.testPath(settingDownloadPath).subscribe({
|
||||
next: () => {
|
||||
this.saving = false;
|
||||
this.testPathSuccess = true;
|
||||
},
|
||||
error: (err) => {
|
||||
this.testPathError = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public testDownloadSpeed(): void {
|
||||
this.saving = true;
|
||||
this.testDownloadSpeedError = null;
|
||||
this.testDownloadSpeedSuccess = 0;
|
||||
|
||||
this.settingsService.testDownloadSpeed().subscribe({
|
||||
next: (result) => {
|
||||
this.saving = false;
|
||||
this.testDownloadSpeedSuccess = result;
|
||||
},
|
||||
error: (err) => {
|
||||
this.testDownloadSpeedError = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
public testWriteSpeed(): void {
|
||||
this.saving = true;
|
||||
this.testWriteSpeedError = null;
|
||||
this.testWriteSpeedSuccess = 0;
|
||||
|
||||
this.settingsService.testWriteSpeed().subscribe({
|
||||
next: (result) => {
|
||||
this.saving = false;
|
||||
this.testWriteSpeedSuccess = result;
|
||||
},
|
||||
error: (err) => {
|
||||
this.testWriteSpeedError = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public testAria2cConnection(): void {
|
||||
const settingAria2cUrl = this.tabs
|
||||
.find((m) => m.key === 'DownloadClient')
|
||||
.settings.find((m) => m.key === 'DownloadClient:Aria2cUrl').value as string;
|
||||
const settingAria2cSecret = this.tabs
|
||||
.find((m) => m.key === 'DownloadClient')
|
||||
.settings.find((m) => m.key === 'DownloadClient:Aria2cSecret').value as string;
|
||||
|
||||
this.saving = true;
|
||||
this.testAria2cConnectionError = null;
|
||||
this.testAria2cConnectionSuccess = null;
|
||||
|
||||
this.settingsService.testAria2cConnection(settingAria2cUrl, settingAria2cSecret).subscribe({
|
||||
next: (result) => {
|
||||
this.saving = false;
|
||||
this.testAria2cConnectionSuccess = result.version;
|
||||
},
|
||||
error: (err) => {
|
||||
this.testAria2cConnectionError = err.error;
|
||||
this.saving = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public registerMagnetHandler(): void {
|
||||
try {
|
||||
navigator.registerProtocolHandler('magnet', `${window.location.origin}/add?magnet=%s`);
|
||||
alert(
|
||||
'Success! Your browser will now prompt you to confirm and add the client as the default handler for magnet links.',
|
||||
);
|
||||
} catch (error) {
|
||||
alert('Magnet link registration failed.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,100 +3,189 @@
|
|||
<div class="container">
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-5-tablet is-5-desktop is-5-widescreen">
|
||||
<img src="../../assets/logo.png" />
|
||||
<div class="box" *ngIf="step === 1">
|
||||
<div class="notification is-primary">
|
||||
Welcome to RealDebrid Client. Please create your account by entering a username and password.
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="" class="label">Username</label>
|
||||
<div class="control has-icons-left">
|
||||
<input type="text" placeholder="" class="input" name="userName" [(ngModel)]="userName" required />
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-envelope"></i>
|
||||
</span>
|
||||
<img src="assets/logo.png" />
|
||||
@if (step === 1) {
|
||||
<div class="box">
|
||||
<div class="notification is-primary">
|
||||
Welcome to Real-Debrid Client. Please create your account by entering a username and password.
|
||||
</div>
|
||||
<form (ngSubmit)="setup()">
|
||||
<div class="field">
|
||||
<label for="userName" class="label">Username</label>
|
||||
<div class="control has-icons-left">
|
||||
<input
|
||||
type="text"
|
||||
placeholder=""
|
||||
class="input"
|
||||
name="userName"
|
||||
id="userName"
|
||||
[(ngModel)]="userName"
|
||||
required
|
||||
/>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-envelope"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="password" class="label">Password</label>
|
||||
<div class="control has-icons-left">
|
||||
<input
|
||||
type="password"
|
||||
class="input"
|
||||
required
|
||||
name="password"
|
||||
id="password"
|
||||
[(ngModel)]="password"
|
||||
/>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-lock"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button class="button is-success" [ngClass]="{ 'is-loading': working }" [disabled]="working">
|
||||
Setup
|
||||
</button>
|
||||
</div>
|
||||
@if (error?.length > 0) {
|
||||
<div class="notification is-danger is-light">
|
||||
{{ error }}
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="" class="label" name="password">Password</label>
|
||||
<div class="control has-icons-left">
|
||||
<input type="password" class="input" required name="password" [(ngModel)]="password" />
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-lock"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="setup()"
|
||||
[ngClass]="{ 'is-loading': working }"
|
||||
[disabled]="working"
|
||||
>
|
||||
Setup
|
||||
</button>
|
||||
</div>
|
||||
<div class="notification is-danger is-light" *ngIf="error?.length > 0">
|
||||
{{ error }}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="box" *ngIf="step === 2">
|
||||
<div class="notification is-primary">
|
||||
To be able to use the RealDebrid Client you need a premium subscription to download torrents.
|
||||
<br /><br />
|
||||
Not premium yet?
|
||||
<a href="https://real-debrid.com/?id=1348683" target="_blank" rel="noopener"
|
||||
>Use this link to sign up to RealDebrid.</a
|
||||
>
|
||||
<br /><br />
|
||||
To connect to RealDebrid please enter your Personal Prive API Token found here:
|
||||
<a href="https://real-debrid.com/apitoken" target="_blank" rel="noopener"
|
||||
>https://real-debrid.com/apitoken</a
|
||||
>.
|
||||
@if (step === 2) {
|
||||
<div class="box">
|
||||
<div class="notification is-primary">
|
||||
To be able to use the Real-Debrid Client you need a premium subscription to download torrents.
|
||||
<br /><br />
|
||||
Not premium yet? You have the choice of 5 providers:
|
||||
<br />
|
||||
<a href="https://real-debrid.com/?id=1348683" target="_blank" rel="noopener"
|
||||
>Use this link to sign up to Real-Debrid.</a
|
||||
>
|
||||
<br />
|
||||
<a href="https://alldebrid.com/?uid=2v91l&lang=en" target="_blank" rel="noopener"
|
||||
>Use this link to sign up to AllDebrid.</a
|
||||
>
|
||||
<br />
|
||||
<a href="https://www.premiumize.me/" target="_blank" rel="noopener"
|
||||
>Use this link to sign up to Premiumize.</a
|
||||
>
|
||||
<br />
|
||||
<a href="https://torbox.app/" target="_blank" rel="noopener">Use this link to sign up to TorBox.</a>
|
||||
<br />
|
||||
<a href="https://debrid-link.com/" target="_blank" rel="noopener"
|
||||
>Use this link to sign up to DebridLink.</a
|
||||
>
|
||||
<small>(Referal links)</small>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Provider</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="provider">
|
||||
<option [ngValue]="0">Real-Debrid</option>
|
||||
<option [ngValue]="1">AllDebrid</option>
|
||||
<option [ngValue]="2">Premiumize</option>
|
||||
<option [ngValue]="3">TorBox</option>
|
||||
<option [ngValue]="4">DebridLink</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="debrid-api-token" class="label">API Private Token</label>
|
||||
<div class="control">
|
||||
<input
|
||||
type="text"
|
||||
placeholder=""
|
||||
class="input"
|
||||
name="token"
|
||||
id="debrid-api-token"
|
||||
[(ngModel)]="token"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
@if (provider === 0) {
|
||||
<p class="help">
|
||||
You can find your API key here:
|
||||
<a href="https://real-debrid.com/apitoken" target="_blank" rel="noopener"
|
||||
>https://real-debrid.com/apitoken</a
|
||||
>.
|
||||
</p>
|
||||
}
|
||||
@if (provider === 1) {
|
||||
<p class="help">
|
||||
You can find your API key here:
|
||||
<a href="https://alldebrid.com/apikeys/" target="_blank" rel="noopener"
|
||||
>https://alldebrid.com/apikeys/</a
|
||||
>.
|
||||
</p>
|
||||
}
|
||||
@if (provider === 2) {
|
||||
<p class="help">
|
||||
You can find your API key here:
|
||||
<a href="https://www.premiumize.me/account" target="_blank" rel="noopener"
|
||||
>https://www.premiumize.me/account</a
|
||||
>.
|
||||
</p>
|
||||
}
|
||||
@if (provider === 3) {
|
||||
<p class="help">
|
||||
You can find your API key here:
|
||||
<a href="https://torbox.app/settings" target="_blank" rel="noopener">https://torbox.app/settings</a
|
||||
>.
|
||||
</p>
|
||||
}
|
||||
@if (provider === 4) {
|
||||
<p class="help">
|
||||
You can find your API key here:
|
||||
<a href="https://debrid-link.com/webapp/apikey" target="_blank" rel="noopener"
|
||||
>https://debrid-link.com/webapp/apikey</a
|
||||
>.
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="setToken()"
|
||||
[ngClass]="{ 'is-loading': working }"
|
||||
[disabled]="working"
|
||||
>
|
||||
Setup
|
||||
</button>
|
||||
</div>
|
||||
@if (error?.length > 0) {
|
||||
<div class="notification is-danger is-light">
|
||||
{{ error }}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="" class="label">API Private Token</label>
|
||||
<div class="control has-icons-left">
|
||||
<input type="text" placeholder="" class="input" name="token" [(ngModel)]="token" required />
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-envelope"></i>
|
||||
</span>
|
||||
}
|
||||
|
||||
@if (step === 3) {
|
||||
<div class="box">
|
||||
<div class="notification is-primary">
|
||||
You are now connected to Real-Debrid! To setup Radarr or Sonarr, please following the instructions here:
|
||||
<a href="https://github.com/rogerfar/rdt-client/" target="_blank" rel="noopener"
|
||||
>https://github.com/rogerfar/rdt-client/</a
|
||||
>.
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="close()"
|
||||
[ngClass]="{ 'is-loading': working }"
|
||||
[disabled]="working"
|
||||
>
|
||||
OK
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="setToken()"
|
||||
[ngClass]="{ 'is-loading': working }"
|
||||
[disabled]="working"
|
||||
>
|
||||
Setup
|
||||
</button>
|
||||
</div>
|
||||
<div class="notification is-danger is-light" *ngIf="error?.length > 0">
|
||||
{{ error }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box" *ngIf="step === 3">
|
||||
<div class="notification is-primary">
|
||||
You are now connected to RealDebrid! To setup Radarr or Sonarr, please following the instructions here:
|
||||
<a href="https://github.com/rogerfar/rdt-client/" target="_blank" rel="noopener"
|
||||
>https://github.com/rogerfar/rdt-client/</a
|
||||
>.
|
||||
</div>
|
||||
<div class="field">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="close()"
|
||||
[ngClass]="{ 'is-loading': working }"
|
||||
[disabled]="working"
|
||||
>
|
||||
OK
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { Setting } from '../models/setting.model';
|
||||
import { SettingsService } from '../settings.service';
|
||||
import { NgClass } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-setup',
|
||||
templateUrl: './setup.component.html',
|
||||
styleUrls: ['./setup.component.scss'],
|
||||
imports: [FormsModule, NgClass],
|
||||
standalone: true,
|
||||
})
|
||||
export class SetupComponent implements OnInit {
|
||||
export class SetupComponent {
|
||||
private authService = inject(AuthService);
|
||||
private router = inject(Router);
|
||||
|
||||
public userName: string;
|
||||
public password: string;
|
||||
public provider = 0;
|
||||
public token: string;
|
||||
|
||||
public error: string;
|
||||
|
|
@ -19,41 +25,33 @@ export class SetupComponent implements OnInit {
|
|||
|
||||
public step: number = 1;
|
||||
|
||||
constructor(private authService: AuthService, private settingsService: SettingsService, private router: Router) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
public setup(): void {
|
||||
this.error = null;
|
||||
this.working = true;
|
||||
|
||||
this.authService.create(this.userName, this.password).subscribe(
|
||||
() => {
|
||||
this.authService.create(this.userName, this.password).subscribe({
|
||||
next: () => {
|
||||
this.step = 2;
|
||||
this.working = false;
|
||||
},
|
||||
(err) => {
|
||||
error: (err) => {
|
||||
this.working = false;
|
||||
this.error = err.error;
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public setToken(): void {
|
||||
const setting = new Setting();
|
||||
setting.settingId = 'RealDebridApiKey';
|
||||
setting.value = this.token;
|
||||
|
||||
this.settingsService.update([setting]).subscribe(
|
||||
() => {
|
||||
this.authService.setupProvider(this.provider, this.token).subscribe({
|
||||
next: () => {
|
||||
this.step = 3;
|
||||
this.working = false;
|
||||
},
|
||||
(err) => {
|
||||
error: (err: any) => {
|
||||
this.working = false;
|
||||
this.error = err.error;
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public close(): void {
|
||||
|
|
|
|||
78
client/src/app/sort.pipe.ts
Normal file
78
client/src/app/sort.pipe.ts
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
export type SortDirection = 'asc' | 'desc';
|
||||
|
||||
export function getSortFieldValue(item: unknown, field: string): unknown {
|
||||
if (item == null || !field) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return field.split('.').reduce<unknown>((value, key) => {
|
||||
if (value == null || typeof value !== 'object') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return (value as Record<string, unknown>)[key];
|
||||
}, item);
|
||||
}
|
||||
|
||||
function compareSortValues(left: unknown, right: unknown): number {
|
||||
if (left === right) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (left == null) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (right == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (typeof left === 'string' && typeof right === 'string') {
|
||||
return left.localeCompare(right, undefined, { sensitivity: 'base' });
|
||||
}
|
||||
|
||||
if (left instanceof Date && right instanceof Date) {
|
||||
return left.getTime() - right.getTime();
|
||||
}
|
||||
|
||||
if (typeof left === 'boolean' && typeof right === 'boolean') {
|
||||
return Number(left) - Number(right);
|
||||
}
|
||||
|
||||
const comparableLeft = left as string | number | bigint;
|
||||
const comparableRight = right as string | number | bigint;
|
||||
|
||||
if (comparableLeft < comparableRight) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (comparableLeft > comparableRight) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
export function sortItems<T>(
|
||||
array: readonly T[],
|
||||
field: string,
|
||||
order: SortDirection = 'asc',
|
||||
accessor: (item: T, field: string) => unknown = getSortFieldValue,
|
||||
): T[] {
|
||||
if (!Array.isArray(array)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const direction = order === 'asc' ? 1 : -1;
|
||||
|
||||
return [...array].sort((left, right) => compareSortValues(accessor(left, field), accessor(right, field)) * direction);
|
||||
}
|
||||
|
||||
@Pipe({ name: 'sort' })
|
||||
export class SortPipe implements PipeTransform {
|
||||
transform(array: unknown[], field: string, order: SortDirection = 'asc'): unknown[] {
|
||||
return sortItems(array, field, order);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<td colspan="4">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
{{ download.link }}
|
||||
</td>
|
||||
<td>
|
||||
{{ download.bytesTotal | filesize }}
|
||||
</td>
|
||||
<td>
|
||||
{{ download | downloadStatus }}
|
||||
</td>
|
||||
<td></td>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
td {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Download } from '../models/download.model';
|
||||
|
||||
@Component({
|
||||
selector: '[app-torrent-download]',
|
||||
templateUrl: './torrent-download.component.html',
|
||||
styleUrls: ['./torrent-download.component.scss'],
|
||||
})
|
||||
export class TorrentDownloadComponent implements OnInit {
|
||||
@Input()
|
||||
public download: Download;
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<td colspan="4">
|
||||
<i class="fas fa-file" aria-hidden="true"></i>
|
||||
{{ file.path }}
|
||||
</td>
|
||||
<td>{{ file.bytes | filesize }}</td>
|
||||
<td colspan="10"></td>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
td {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { TorrentFile } from '../models/torrent.model';
|
||||
|
||||
@Component({
|
||||
selector: '[app-torrent-file]',
|
||||
templateUrl: './torrent-file.component.html',
|
||||
styleUrls: ['./torrent-file.component.scss'],
|
||||
})
|
||||
export class TorrentFileComponent implements OnInit {
|
||||
@Input()
|
||||
public file: TorrentFile;
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
<td>{{ torrent.rdName }}</td>
|
||||
<td>
|
||||
{{ torrent.files.length | number }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.downloads.length | number }}
|
||||
</td>
|
||||
<td class="auto">
|
||||
<i class="fas fa-download" *ngIf="torrent.autoDownload" title="Auto download"></i>
|
||||
<i class="fas fa-box-open" *ngIf="torrent.autoUnpack" title="Auto unpack"></i>
|
||||
<i class="fas fa-trash" *ngIf="torrent.autoDelete" title="Auto delete"></i>
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.rdSize | filesize }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent | status }}
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
class="icon download-icon"
|
||||
(click)="download($event)"
|
||||
title="Download to disk"
|
||||
*ngIf="!loading && canDownload()"
|
||||
>
|
||||
<i class="fas fa-download"></i>
|
||||
</span>
|
||||
<span class="icon download-icon" (click)="unpack($event)" title="Unpack" *ngIf="!loading && canUnpack()">
|
||||
<i class="fas fa-box-open"></i>
|
||||
</span>
|
||||
<span class="icon delete-icon" (click)="delete1($event)" title="Delete torrent" *ngIf="!loading">
|
||||
<i class="fas fa-times"></i>
|
||||
</span>
|
||||
<span class="icon loading-icon" *ngIf="loading">
|
||||
<i class="fas fa-spinner fa-pulse"></i>
|
||||
</span>
|
||||
</td>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
.delete-icon {
|
||||
color: red;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.auto .fas {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { RealDebridStatus, Torrent } from 'src/app/models/torrent.model';
|
||||
import { TorrentService } from 'src/app/torrent.service';
|
||||
|
||||
@Component({
|
||||
selector: '[app-torrent-row]',
|
||||
templateUrl: './torrent-row.component.html',
|
||||
styleUrls: ['./torrent-row.component.scss'],
|
||||
})
|
||||
export class TorrentRowComponent implements OnInit {
|
||||
@Input()
|
||||
public torrent: Torrent;
|
||||
|
||||
@Output('delete')
|
||||
public delete = new EventEmitter();
|
||||
|
||||
public loading = false;
|
||||
|
||||
constructor(private torrentService: TorrentService) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
|
||||
public download(event: Event): void {
|
||||
event.stopPropagation();
|
||||
|
||||
this.loading = true;
|
||||
this.torrentService.download(this.torrent.torrentId).subscribe(
|
||||
() => {
|
||||
this.loading = false;
|
||||
},
|
||||
(err) => {
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public unpack(event: Event): void {
|
||||
event.stopPropagation();
|
||||
|
||||
this.loading = true;
|
||||
this.torrentService.unpack(this.torrent.torrentId).subscribe(
|
||||
() => {
|
||||
this.loading = false;
|
||||
},
|
||||
(err) => {
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public delete1(event: Event): void {
|
||||
event.stopPropagation();
|
||||
this.delete.emit(this.torrent.torrentId);
|
||||
}
|
||||
|
||||
public canDownload(): boolean {
|
||||
return (
|
||||
(this.torrent.rdStatus === RealDebridStatus.Finished && this.torrent.downloads.length === 0) ||
|
||||
(this.torrent.downloads.length > 0 && this.torrent.downloads.any((m) => m.error != null))
|
||||
);
|
||||
}
|
||||
|
||||
public canUnpack(): boolean {
|
||||
const downloadsDone = this.torrent.downloads.any((m) => m.downloadFinished != null);
|
||||
const downloadsUnpacked = this.torrent.downloads.any((m) => m.unpackingQueued != null);
|
||||
return downloadsDone && !downloadsUnpacked;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,99 +1,132 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { FileSizePipe } from 'ngx-filesize';
|
||||
import { RealDebridStatus, Torrent } from './models/torrent.model';
|
||||
import { FileSizePipe } from './filesize.pipe';
|
||||
|
||||
@Pipe({
|
||||
name: 'status',
|
||||
})
|
||||
export class TorrentStatusPipe implements PipeTransform {
|
||||
constructor(private pipe: FileSizePipe) {}
|
||||
const fileSizePipe = new FileSizePipe();
|
||||
|
||||
transform(torrent: Torrent): string {
|
||||
if (torrent.downloads.length > 0) {
|
||||
const errors = torrent.downloads.where((m) => m.error != null);
|
||||
export function getTorrentStatus(torrent: Torrent): string {
|
||||
if (torrent.error) {
|
||||
return torrent.error;
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
return 'Error';
|
||||
const downloads = torrent.downloads ?? [];
|
||||
|
||||
if (downloads.length > 0) {
|
||||
let allFinished = true;
|
||||
let downloadingCount = 0;
|
||||
let downloadedCount = 0;
|
||||
let downloadingBytesDone = 0;
|
||||
let downloadingBytesTotal = 0;
|
||||
let downloadingSpeed = 0;
|
||||
let unpackingCount = 0;
|
||||
let unpackedCount = 0;
|
||||
let unpackingBytesDone = 0;
|
||||
let unpackingBytesTotal = 0;
|
||||
let queuedForUnpackingCount = 0;
|
||||
let queuedForDownloadingCount = 0;
|
||||
|
||||
for (const download of downloads) {
|
||||
if (download.completed == null) {
|
||||
allFinished = false;
|
||||
}
|
||||
|
||||
const allFinished = torrent.downloads.all((m) => m.completed != null);
|
||||
|
||||
if (allFinished) {
|
||||
return 'Finished';
|
||||
if (download.downloadFinished != null) {
|
||||
downloadedCount += 1;
|
||||
}
|
||||
|
||||
const downloading = torrent.downloads.where((m) => m.downloadStarted && !m.downloadFinished);
|
||||
|
||||
if (downloading.length > 0) {
|
||||
const bytesDone = downloading.sum((m) => m.bytesDone);
|
||||
const bytesTotal = downloading.sum((m) => m.bytesTotal);
|
||||
let progress = (bytesDone / bytesTotal) * 100;
|
||||
let allSpeeds = downloading.sum((m) => m.speed) / downloading.length;
|
||||
|
||||
let speed: string | string[] = '0';
|
||||
if (allSpeeds > 0) {
|
||||
speed = this.pipe.transform(allSpeeds, 'filesize');
|
||||
|
||||
return `Downloading (${progress.toFixed(2)}% - ${speed}/s)`;
|
||||
}
|
||||
if (download.downloadStarted && !download.downloadFinished && download.bytesDone > 0) {
|
||||
downloadingCount += 1;
|
||||
downloadingBytesDone += download.bytesDone;
|
||||
downloadingBytesTotal += download.bytesTotal;
|
||||
downloadingSpeed += download.speed;
|
||||
}
|
||||
|
||||
const unpacking = torrent.downloads.where((m) => m.unpackingStarted && !m.unpackingFinished);
|
||||
|
||||
if (unpacking.length > 0) {
|
||||
const bytesDone = unpacking.sum((m) => m.bytesDone);
|
||||
const bytesTotal = unpacking.sum((m) => m.bytesTotal);
|
||||
let progress = (bytesDone / bytesTotal) * 100;
|
||||
let allSpeeds = unpacking.sum((m) => m.speed) / unpacking.length;
|
||||
|
||||
if (allSpeeds > 0) {
|
||||
return `Extracting (${progress.toFixed(2)}%)`;
|
||||
}
|
||||
if (download.unpackingFinished != null) {
|
||||
unpackedCount += 1;
|
||||
}
|
||||
|
||||
const queuedForUnpacking = torrent.downloads.where((m) => m.unpackingQueued && !m.unpackingStarted);
|
||||
|
||||
if (queuedForUnpacking.length > 0) {
|
||||
return `Queued for unpacking`;
|
||||
if (download.unpackingStarted && !download.unpackingFinished && download.bytesDone > 0) {
|
||||
unpackingCount += 1;
|
||||
unpackingBytesDone += download.bytesDone;
|
||||
unpackingBytesTotal += download.bytesTotal;
|
||||
}
|
||||
|
||||
const queuedForDownload = torrent.downloads.where((m) => m.downloadQueued && !m.downloadStarted);
|
||||
|
||||
if (queuedForDownload.length > 0) {
|
||||
return `Queued for downloading`;
|
||||
if (download.unpackingQueued && !download.unpackingStarted) {
|
||||
queuedForUnpackingCount += 1;
|
||||
}
|
||||
|
||||
const unpacked = torrent.downloads.where((m) => m.unpackingFinished != null);
|
||||
|
||||
if (unpacked.length > 0) {
|
||||
return `Files unpacked`;
|
||||
}
|
||||
|
||||
const downloaded = torrent.downloads.where((m) => m.downloadFinished != null);
|
||||
|
||||
if (downloaded.length > 0) {
|
||||
return `Files downloaded to host`;
|
||||
if (!download.downloadStarted && !download.downloadFinished) {
|
||||
queuedForDownloadingCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (torrent.completed) {
|
||||
if (allFinished) {
|
||||
return 'Finished';
|
||||
}
|
||||
|
||||
switch (torrent.rdStatus) {
|
||||
case RealDebridStatus.Downloading:
|
||||
const speed = this.pipe.transform(torrent.rdSpeed, 'filesize');
|
||||
return `Torrent downloading (${torrent.rdProgress}% - ${speed}/s)`;
|
||||
case RealDebridStatus.Processing:
|
||||
return `Torrent processing`;
|
||||
case RealDebridStatus.WaitingForFileSelection:
|
||||
return `Torrent waiting for file selection`;
|
||||
case RealDebridStatus.Error:
|
||||
return `Torrent error: ${torrent.rdStatusRaw}`;
|
||||
case RealDebridStatus.Finished:
|
||||
return `Torrent finished, waiting to download`;
|
||||
default:
|
||||
return 'Unknown status';
|
||||
if (downloadingCount > 0) {
|
||||
const progress = ((downloadingBytesDone / downloadingBytesTotal) || 0) * 100;
|
||||
const speed = fileSizePipe.transform(downloadingSpeed, 'filesize') as string;
|
||||
|
||||
return `Downloading file ${downloadingCount + downloadedCount}/${downloads.length} (${progress.toFixed(2)}% - ${speed}/s)`;
|
||||
}
|
||||
|
||||
if (unpackingCount > 0) {
|
||||
const progress = ((unpackingBytesDone / unpackingBytesTotal) || 0) * 100;
|
||||
|
||||
return `Extracting file ${unpackingCount + unpackedCount}/${downloads.length} (${progress.toFixed(2)}%)`;
|
||||
}
|
||||
|
||||
if (queuedForUnpackingCount > 0) {
|
||||
return 'Queued for unpacking';
|
||||
}
|
||||
|
||||
if (queuedForDownloadingCount > 0) {
|
||||
return 'Queued for downloading';
|
||||
}
|
||||
|
||||
if (unpackedCount > 0) {
|
||||
return 'Files unpacked';
|
||||
}
|
||||
|
||||
if (downloadedCount > 0) {
|
||||
return 'Files downloaded to host';
|
||||
}
|
||||
}
|
||||
|
||||
if (torrent.completed) {
|
||||
return 'Finished';
|
||||
}
|
||||
|
||||
const prefix = torrent.type === 1 ? 'NZB' : 'Torrent';
|
||||
|
||||
switch (torrent.rdStatus) {
|
||||
case RealDebridStatus.Queued:
|
||||
return 'Not Yet Added to Provider';
|
||||
case RealDebridStatus.Downloading:
|
||||
if (torrent.rdSeeders < 1 && torrent.type !== 1) {
|
||||
return 'Torrent stalled';
|
||||
}
|
||||
|
||||
return `${prefix} downloading (${torrent.rdProgress}% - ${fileSizePipe.transform(torrent.rdSpeed, 'filesize') as string}/s)`;
|
||||
case RealDebridStatus.Processing:
|
||||
return `${prefix} processing`;
|
||||
case RealDebridStatus.WaitingForFileSelection:
|
||||
return `${prefix} waiting for file selection`;
|
||||
case RealDebridStatus.Error:
|
||||
return `${prefix} error: ${torrent.rdStatusRaw}`;
|
||||
case RealDebridStatus.Finished:
|
||||
return `${prefix} finished, waiting for download links`;
|
||||
case RealDebridStatus.Uploading:
|
||||
return `${prefix} uploading`;
|
||||
default:
|
||||
return 'Unknown status';
|
||||
}
|
||||
}
|
||||
|
||||
@Pipe({ name: 'status' })
|
||||
export class TorrentStatusPipe implements PipeTransform {
|
||||
transform(torrent: Torrent): string {
|
||||
return getTorrentStatus(torrent);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,180 @@
|
|||
<div class="notification is-danger is-light" *ngIf="error && error.length > 0">
|
||||
An error has occured: {{ error }}<br />
|
||||
Please refresh the screen after fixing this error.
|
||||
</div>
|
||||
@if (error && error.length > 0) {
|
||||
<div class="notification is-danger is-light">
|
||||
An error has occurred: {{ error }}<br />
|
||||
Please refresh the screen after fixing this error.
|
||||
</div>
|
||||
}
|
||||
@if (diskSpaceStatus?.isPaused) {
|
||||
<div class="notification is-warning">
|
||||
<strong>Bezzad downloads paused due to low disk space</strong>
|
||||
<br />
|
||||
Available: {{ diskSpaceStatus.availableSpaceGB }} GB | Resume at: {{ diskSpaceStatus.thresholdGB * 2 }} GB
|
||||
<br />
|
||||
<small>Last check: {{ diskSpaceStatus.lastCheckTime | date: "short" }}</small>
|
||||
</div>
|
||||
}
|
||||
@if (rateLimitStatus?.nextDequeueTime) {
|
||||
<div class="notification is-warning">
|
||||
<strong>Debrid provider rate limit reached</strong>
|
||||
<br />
|
||||
Processing paused until {{ rateLimitStatus.nextDequeueTime | date: "medium" }}
|
||||
@if (rateLimitStatus.secondsRemaining > 0) {
|
||||
({{ rateLimitStatus.secondsRemaining | number: "1.0-0" }} seconds remaining)
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="table-container">
|
||||
<table class="table is-fullwidth is-hoverable">
|
||||
@if (!isMobile) {
|
||||
<table class="table is-fullwidth is-hoverable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input
|
||||
type="checkbox"
|
||||
(click)="toggleDeleteSelectAll($event)"
|
||||
[checked]="selectedTorrents.length > 0 && selectedTorrents.length === torrents.length"
|
||||
/>
|
||||
</th>
|
||||
<th (click)="sort('rdName')">Name</th>
|
||||
<th (click)="sort('category')">Category</th>
|
||||
<th (click)="sort('priority')">Priority</th>
|
||||
<th (click)="sort('rdSeeders')">Seeders</th>
|
||||
<th (click)="sort('files.length')">Files</th>
|
||||
<th (click)="sort('downloads.length')">Downloads</th>
|
||||
<th (click)="sort('rdSize')">Size</th>
|
||||
<th (click)="sort('added')">Requested</th>
|
||||
<th (click)="sort('status')">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (torrent of sortedTorrents; track torrent.torrentId) {
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" (click)="toggleSelect(torrent.torrentId)" [checked]="isSelected(torrent.torrentId)" />
|
||||
</td>
|
||||
<td (click)="openTorrent(torrent.torrentId)" class="break-all">
|
||||
{{ torrent.rdName }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.category }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.priority }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.rdSeeders }}
|
||||
</td>
|
||||
<td>
|
||||
{{ (torrent.filesCount ?? torrent.files?.length ?? 0) | number }}
|
||||
</td>
|
||||
<td>
|
||||
{{ (torrent.downloadsCount ?? torrent.downloads?.length ?? 0) | number }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.rdSize | filesize }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.added | date: "medium" }}
|
||||
</td>
|
||||
<td>
|
||||
{{ torrent.statusText ?? (torrent | status) }}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
} @else {
|
||||
<div class="mobile-cards">
|
||||
@for (torrent of sortedTorrents; track torrent.torrentId) {
|
||||
<div class="box mobile-card" [class.is-selected]="isSelected(torrent.torrentId)">
|
||||
<div class="mobile-card-checkbox">
|
||||
<input
|
||||
type="checkbox"
|
||||
(click)="toggleSelect(torrent.torrentId)"
|
||||
[checked]="isSelected(torrent.torrentId)"
|
||||
/>
|
||||
</div>
|
||||
<div class="mobile-card-body" (click)="openTorrent(torrent.torrentId)">
|
||||
<p class="mobile-card-name">{{ torrent.rdName }}</p>
|
||||
<div class="tags mb-2">
|
||||
<span class="tag is-info is-light">{{ torrent.statusText ?? (torrent | status) }}</span>
|
||||
@if (torrent.category) {
|
||||
<span class="tag is-light">{{ torrent.category }}</span>
|
||||
}
|
||||
</div>
|
||||
<div class="mobile-card-details">
|
||||
<span class="mobile-card-detail"
|
||||
><span class="detail-label">Size</span> {{ torrent.rdSize | filesize }}</span
|
||||
>
|
||||
<span class="mobile-card-detail"><span class="detail-label">Seeders</span> {{ torrent.rdSeeders }}</span>
|
||||
<span class="mobile-card-detail"
|
||||
><span class="detail-label">Files</span> {{ (torrent.filesCount ?? torrent.files?.length ?? 0) | number }}</span
|
||||
>
|
||||
<span class="mobile-card-detail"
|
||||
><span class="detail-label">Downloads</span> {{ (torrent.downloadsCount ?? torrent.downloads?.length ?? 0) | number }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Files</th>
|
||||
<th>Downloads</th>
|
||||
<th>Auto</th>
|
||||
<th>Size</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<ng-container *ngFor="let torrent of torrents; trackBy: trackByMethod">
|
||||
<tr
|
||||
app-torrent-row
|
||||
[torrent]="torrent"
|
||||
(click)="selectTorrent(torrent)"
|
||||
(delete)="showDeleteModal($event)"
|
||||
></tr>
|
||||
<ng-container *ngIf="showFiles[torrent.torrentId]">
|
||||
<tr class="separator">
|
||||
<td colspan="10">Downloads</td>
|
||||
</tr>
|
||||
<tr app-torrent-download [download]="download" *ngFor="let download of torrent.downloads"></tr>
|
||||
<tr class="separator">
|
||||
<td colspan="10">Files in torrent</td>
|
||||
</tr>
|
||||
<tr app-torrent-file [file]="file" *ngFor="let file of torrent.files"></tr>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex-container">
|
||||
@if (torrents.length > 0) {
|
||||
<button class="button is-danger" (click)="showDeleteModal()" [disabled]="selectedTorrents.length === 0">
|
||||
Delete Selected
|
||||
</button>
|
||||
<button class="button is-primary" (click)="showRetryModal()" [disabled]="selectedTorrents.length === 0">
|
||||
Retry Selected
|
||||
</button>
|
||||
<button class="button is-primary" (click)="changeSettingsModal()" [disabled]="selectedTorrents.length === 0">
|
||||
Change Settings
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" [class.is-active]="isDeleteModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Delete torrent</p>
|
||||
<p class="modal-card-title">Delete selected torrents</p>
|
||||
<button class="delete" aria-label="close" (click)="deleteCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<p>Are you sure you want to delete these torrent?</p>
|
||||
<div class="field">
|
||||
<label class="label"></label>
|
||||
<div class="control">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteData" />
|
||||
Delete Torrent from local RealDebrid Client
|
||||
<input type="checkbox" [(ngModel)]="deleteData" (change)="updateDeleteSelectAll()" />
|
||||
Delete Torrents from client
|
||||
</label>
|
||||
<br />
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteRdTorrent" />
|
||||
Delete Torrent from RealDebrid
|
||||
<input type="checkbox" [(ngModel)]="deleteRdTorrent" (change)="updateDeleteSelectAll()" />
|
||||
Delete Torrents from provider
|
||||
</label>
|
||||
<br />
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteLocalFiles" />
|
||||
<input type="checkbox" [(ngModel)]="deleteLocalFiles" (change)="updateDeleteSelectAll()" />
|
||||
Delete local files
|
||||
</label>
|
||||
<br />
|
||||
<br />
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteSelectAll" (change)="toggleDeleteSelectAllOptions()" />
|
||||
Select All
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="notification is-primary">
|
||||
Deleting a torrent from RealDebrid will automatically delete it here too.
|
||||
</div>
|
||||
<div class="notification is-danger is-light" *ngIf="deleteError?.length > 0">
|
||||
Error deleting torrent: {{ deleteError }}
|
||||
Deleting a torrent from Real-Debrid will automatically delete it here too.
|
||||
</div>
|
||||
@if (deleteError?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error deleting torrent: {{ deleteError }}</div>
|
||||
}
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
|
|
@ -80,7 +183,7 @@
|
|||
[disabled]="deleting"
|
||||
[ngClass]="{ 'is-loading': deleting }"
|
||||
>
|
||||
Delete
|
||||
Delete selected
|
||||
</button>
|
||||
<button class="button" (click)="deleteCancel()" [disabled]="deleting" [ngClass]="{ 'is-loading': deleting }">
|
||||
Cancel
|
||||
|
|
@ -88,3 +191,172 @@
|
|||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" [class.is-active]="isRetryModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Retry selected torrents</p>
|
||||
<button class="delete" aria-label="close" (click)="retryCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<p>Are you sure you want to retry these torrent?</p>
|
||||
<p>
|
||||
This action will delete all the torrent data + all local downloads. Then it will re-add the original magnet link
|
||||
or torrent file to the debrid provider.
|
||||
</p>
|
||||
@if (retryError?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error retrying torrent: {{ retryError }}</div>
|
||||
}
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="retryOk()"
|
||||
[disabled]="retrying"
|
||||
[ngClass]="{ 'is-loading': retrying }"
|
||||
>
|
||||
Retry selected
|
||||
</button>
|
||||
<button class="button" (click)="retryCancel()" [disabled]="retrying" [ngClass]="{ 'is-loading': retrying }">
|
||||
Cancel
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" [class.is-active]="isChangeSettingsModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Change settings for selected torrents</p>
|
||||
<button class="delete" aria-label="close" (click)="changeSettingsCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<div class="field">
|
||||
<label class="label">Downloader</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="updateSettingsDownloadClient">
|
||||
<option [ngValue]="null"></option>
|
||||
<option [ngValue]="0">Bezzad</option>
|
||||
<option [ngValue]="1">Aria2c</option>
|
||||
<option [ngValue]="2">Symlink Downloader</option>
|
||||
<option [ngValue]="3">Synology DownloadStation</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">
|
||||
Select which downloader is used to download this torrent from the debrid provider to your host.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Post Download Action</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="updateSettingsHostDownloadAction">
|
||||
<option [ngValue]="0">Download all files to host</option>
|
||||
<option [ngValue]="1">Don't download any files to host</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">
|
||||
When a torrent is finished downloading on the provider, perform this action. Use this setting if you only want
|
||||
to add files to Real-Debrid but not download them to the host.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Category</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" [(ngModel)]="updateSettingsCategory" />
|
||||
</div>
|
||||
<p class="help">The category becomes a sub-folder in your main download path.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Priority</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" step="1" [(ngModel)]="updateSettingsPriority" />
|
||||
</div>
|
||||
<p class="help">
|
||||
Set the priority for this torrent where 1 is the highest. When empty it will be assigned the lowest priority.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Automatic retry downloads</label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
max="1000"
|
||||
min="0"
|
||||
step="1"
|
||||
[(ngModel)]="updateSettingsDownloadRetryAttempts"
|
||||
/>
|
||||
</div>
|
||||
<p class="help">When a single download fails it will retry it this many times before marking it as failed.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Automatic retry torrent</label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
max="1000"
|
||||
min="0"
|
||||
step="1"
|
||||
[(ngModel)]="updateSettingsTorrentRetryAttempts"
|
||||
/>
|
||||
</div>
|
||||
<p class="help">
|
||||
When a single download has failed multiple times (see setting above) or when the torrent itself received an
|
||||
error it will retry the full torrent this many times before marking it failed.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Delete download when in error</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="1000" min="0" step="1" [(ngModel)]="updateSettingsDeleteOnError" />
|
||||
</div>
|
||||
<p class="help">
|
||||
When a download has been in error for this many minutes, delete it from the provider and the client. 0 to
|
||||
disable.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Torrent maximum lifetime</label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
max="100000"
|
||||
min="0"
|
||||
step="1"
|
||||
[(ngModel)]="updateSettingsTorrentLifetime"
|
||||
/>
|
||||
</div>
|
||||
<p class="help">
|
||||
The maximum lifetime of a torrent in minutes. When this time has passed, mark the torrent as error. If the
|
||||
torrent is completed and has downloads, the lifetime setting will not apply. 0 to disable.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if (changeSettingsError?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error changing settings: {{ changeSettingsError }}</div>
|
||||
}
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="changeSettingsOk()"
|
||||
[disabled]="changingSettings"
|
||||
[ngClass]="{ 'is-loading': changingSettings }"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
<button
|
||||
class="button"
|
||||
(click)="changeSettingsCancel()"
|
||||
[disabled]="changingSettings"
|
||||
[ngClass]="{ 'is-loading': changingSettings }"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,96 @@
|
|||
table {
|
||||
tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
tr.separator {
|
||||
td {
|
||||
font-size: smaller;
|
||||
font-weight: bold;
|
||||
td.break-all {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-cards {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mobile-card {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.75rem;
|
||||
padding: 0.875rem 0.75rem !important;
|
||||
margin-bottom: 0.5rem !important;
|
||||
cursor: pointer;
|
||||
|
||||
&.is-selected {
|
||||
border-left: 3px solid hsl(217, 71%, 53%);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: hsl(0, 0%, 96%);
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-card-checkbox {
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.125rem;
|
||||
|
||||
input[type="checkbox"] {
|
||||
width: 1.1rem;
|
||||
height: 1.1rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-card-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.mobile-card-name {
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-bottom: 0.375rem;
|
||||
color: hsl(0, 0%, 21%);
|
||||
}
|
||||
|
||||
.mobile-card-details {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem 1rem;
|
||||
}
|
||||
|
||||
.mobile-card-detail {
|
||||
font-size: 0.8rem;
|
||||
color: hsl(0, 0%, 29%);
|
||||
white-space: nowrap;
|
||||
|
||||
.detail-label {
|
||||
color: hsl(0, 0%, 48%);
|
||||
font-size: 0.72rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.03em;
|
||||
margin-right: 0.2em;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
display: flex;
|
||||
flex: 1 1 0;
|
||||
gap: 20px;
|
||||
flex-direction: row;
|
||||
margin-top: 1rem;
|
||||
|
||||
@media screen and (max-width: 1279px) {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
gap: 0.5rem;
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,58 +1,184 @@
|
|||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, DestroyRef, OnDestroy, OnInit, inject } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { Router } from '@angular/router';
|
||||
import { Torrent } from '../models/torrent.model';
|
||||
import { DiskSpaceStatus } from '../models/disk-space-status.model';
|
||||
import { RateLimitStatus } from '../models/rate-limit-status.model';
|
||||
import { TorrentService } from '../torrent.service';
|
||||
import { forkJoin, Observable } from 'rxjs';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { NgClass, DecimalPipe, DatePipe } from '@angular/common';
|
||||
import { getTorrentStatus, TorrentStatusPipe } from '../torrent-status.pipe';
|
||||
import { SortDirection, getSortFieldValue, sortItems } from '../sort.pipe';
|
||||
import { FileSizePipe } from '../filesize.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'app-torrent-table',
|
||||
templateUrl: './torrent-table.component.html',
|
||||
styleUrls: ['./torrent-table.component.scss'],
|
||||
imports: [FormsModule, NgClass, DecimalPipe, DatePipe, TorrentStatusPipe, FileSizePipe],
|
||||
standalone: true,
|
||||
})
|
||||
export class TorrentTableComponent implements OnInit, OnDestroy {
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private router = inject(Router);
|
||||
private torrentService = inject(TorrentService);
|
||||
private selectedTorrentIds = new Set<string>();
|
||||
|
||||
public torrents: Torrent[] = [];
|
||||
public sortedTorrents: Torrent[] = [];
|
||||
public selectedTorrents: string[] = [];
|
||||
public error: string;
|
||||
public showFiles: { [key: string]: boolean } = {};
|
||||
public sortProperty = 'added';
|
||||
public sortDirection: SortDirection = 'desc';
|
||||
|
||||
public isDeleteModalActive: boolean;
|
||||
public deleteError: string;
|
||||
public deleting: boolean;
|
||||
public deleteTorrentId: string;
|
||||
public deleteSelectAll: boolean;
|
||||
public deleteData: boolean;
|
||||
public deleteRdTorrent: boolean;
|
||||
public deleteLocalFiles: boolean;
|
||||
|
||||
constructor(private torrentService: TorrentService) {}
|
||||
public isRetryModalActive: boolean;
|
||||
public retryError: string;
|
||||
public retrying: boolean;
|
||||
|
||||
public isChangeSettingsModalActive: boolean;
|
||||
public changeSettingsError: string;
|
||||
public changingSettings: boolean;
|
||||
|
||||
public updateSettingsDownloadClient: number;
|
||||
public updateSettingsHostDownloadAction: number;
|
||||
public updateSettingsCategory: string;
|
||||
public updateSettingsPriority: number;
|
||||
public updateSettingsDownloadRetryAttempts: number;
|
||||
public updateSettingsTorrentRetryAttempts: number;
|
||||
public updateSettingsDeleteOnError: number;
|
||||
public updateSettingsTorrentLifetime: number;
|
||||
|
||||
public diskSpaceStatus: DiskSpaceStatus | null = null;
|
||||
public rateLimitStatus: RateLimitStatus | null = null;
|
||||
|
||||
public isMobile = false;
|
||||
private mobileQuery: MediaQueryList;
|
||||
private mobileQueryListener: (e: MediaQueryListEvent) => void;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.torrentService.getList().subscribe(
|
||||
(result) => {
|
||||
this.torrents = result;
|
||||
this.mobileQuery = window.matchMedia('(max-width: 768px)');
|
||||
this.isMobile = this.mobileQuery.matches;
|
||||
this.mobileQueryListener = (e: MediaQueryListEvent) => {
|
||||
this.isMobile = e.matches;
|
||||
};
|
||||
this.mobileQuery.addEventListener('change', this.mobileQueryListener);
|
||||
|
||||
this.torrentService.connect();
|
||||
|
||||
this.torrentService.update$.subscribe((result2) => {
|
||||
this.torrents = result2;
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
this.error = err.error;
|
||||
// Load persisted sort settings (if any)
|
||||
try {
|
||||
const sp = localStorage.getItem('torrentTable.sortProperty');
|
||||
const sd = localStorage.getItem('torrentTable.sortDirection');
|
||||
if (sp) {
|
||||
this.sortProperty = sp;
|
||||
}
|
||||
);
|
||||
if (sd === 'asc' || sd === 'desc') {
|
||||
this.sortDirection = sd as 'asc' | 'desc';
|
||||
}
|
||||
} catch (_) {
|
||||
// Ignore storage errors (e.g., disabled storage)
|
||||
}
|
||||
|
||||
this.torrentService
|
||||
.getDiskSpaceStatus()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: (status) => {
|
||||
this.diskSpaceStatus = status;
|
||||
},
|
||||
});
|
||||
|
||||
this.torrentService.diskSpaceStatus$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((status) => {
|
||||
this.diskSpaceStatus = status;
|
||||
});
|
||||
|
||||
this.torrentService
|
||||
.getRateLimitStatus()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: (status) => {
|
||||
this.rateLimitStatus = status;
|
||||
},
|
||||
});
|
||||
|
||||
this.torrentService.rateLimitStatus$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((status) => {
|
||||
this.rateLimitStatus = status;
|
||||
});
|
||||
|
||||
this.torrentService.update$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((result) => {
|
||||
this.setTorrents(result);
|
||||
});
|
||||
|
||||
this.torrentService
|
||||
.getList()
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe({
|
||||
next: (result) => {
|
||||
this.setTorrents(result);
|
||||
},
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.torrentService.disconnect();
|
||||
public sort(property: string): void {
|
||||
if (this.sortProperty === property) {
|
||||
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
this.sortProperty = property;
|
||||
this.sortDirection = 'desc';
|
||||
}
|
||||
|
||||
// Persist sort settings
|
||||
try {
|
||||
localStorage.setItem('torrentTable.sortProperty', this.sortProperty);
|
||||
localStorage.setItem('torrentTable.sortDirection', this.sortDirection);
|
||||
} catch (_) {
|
||||
// Ignore storage errors
|
||||
}
|
||||
|
||||
this.applySorting();
|
||||
}
|
||||
|
||||
public selectTorrent(torrent: Torrent): void {
|
||||
this.showFiles[torrent.torrentId] = !this.showFiles[torrent.torrentId];
|
||||
public openTorrent(torrentId: string): void {
|
||||
this.router.navigate([`/torrent/${torrentId}`]);
|
||||
}
|
||||
|
||||
public trackByMethod(index: number, el: Torrent): string {
|
||||
return el.torrentId;
|
||||
public toggleDeleteSelectAll(event: Event) {
|
||||
const checked = (event.target as HTMLInputElement).checked;
|
||||
|
||||
this.selectedTorrentIds = checked ? new Set(this.torrents.map((torrent) => torrent.torrentId)) : new Set<string>();
|
||||
this.syncSelectedTorrents();
|
||||
}
|
||||
|
||||
public showDeleteModal(torrentId: string): void {
|
||||
this.deleteTorrentId = torrentId;
|
||||
public toggleSelect(torrentId: string) {
|
||||
if (this.selectedTorrentIds.has(torrentId)) {
|
||||
this.selectedTorrentIds.delete(torrentId);
|
||||
} else {
|
||||
this.selectedTorrentIds.add(torrentId);
|
||||
}
|
||||
|
||||
this.syncSelectedTorrents();
|
||||
}
|
||||
|
||||
public isSelected(torrentId: string): boolean {
|
||||
return this.selectedTorrentIds.has(torrentId);
|
||||
}
|
||||
|
||||
public showDeleteModal(): void {
|
||||
this.deleteData = false;
|
||||
this.deleteRdTorrent = false;
|
||||
this.deleteLocalFiles = false;
|
||||
this.deleteError = null;
|
||||
|
||||
this.isDeleteModalActive = true;
|
||||
}
|
||||
|
||||
|
|
@ -63,17 +189,212 @@ export class TorrentTableComponent implements OnInit, OnDestroy {
|
|||
public deleteOk(): void {
|
||||
this.deleting = true;
|
||||
|
||||
this.torrentService
|
||||
.delete(this.deleteTorrentId, this.deleteData, this.deleteRdTorrent, this.deleteLocalFiles)
|
||||
.subscribe(
|
||||
() => {
|
||||
this.isDeleteModalActive = false;
|
||||
this.deleting = false;
|
||||
},
|
||||
(err) => {
|
||||
this.deleteError = err.error;
|
||||
this.deleting = false;
|
||||
}
|
||||
);
|
||||
const calls: Observable<void>[] = [];
|
||||
|
||||
this.selectedTorrents.forEach((torrentId) => {
|
||||
calls.push(this.torrentService.delete(torrentId, this.deleteData, this.deleteRdTorrent, this.deleteLocalFiles));
|
||||
});
|
||||
|
||||
forkJoin(calls).subscribe({
|
||||
complete: () => {
|
||||
this.isDeleteModalActive = false;
|
||||
this.deleting = false;
|
||||
|
||||
this.clearSelectedTorrents();
|
||||
},
|
||||
error: (err) => {
|
||||
this.deleteError = err.error;
|
||||
this.deleting = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public showRetryModal(): void {
|
||||
this.retryError = null;
|
||||
|
||||
this.isRetryModalActive = true;
|
||||
}
|
||||
|
||||
public retryCancel(): void {
|
||||
this.isRetryModalActive = false;
|
||||
}
|
||||
|
||||
public retryOk(): void {
|
||||
this.retrying = true;
|
||||
|
||||
const calls: Observable<void>[] = [];
|
||||
|
||||
this.selectedTorrents.forEach((torrentId) => {
|
||||
calls.push(this.torrentService.retry(torrentId));
|
||||
});
|
||||
|
||||
forkJoin(calls).subscribe({
|
||||
complete: () => {
|
||||
this.isRetryModalActive = false;
|
||||
this.retrying = false;
|
||||
|
||||
this.clearSelectedTorrents();
|
||||
},
|
||||
error: (err) => {
|
||||
this.retryError = err.error;
|
||||
this.retrying = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public changeSettingsModal(): void {
|
||||
this.changeSettingsError = null;
|
||||
|
||||
const selectedTorrents = this.getSelectedTorrentModels();
|
||||
|
||||
this.updateSettingsDownloadClient = selectedTorrents.every(
|
||||
(m, _, arr) => m.downloadClient === arr[0].downloadClient,
|
||||
)
|
||||
? selectedTorrents[0].downloadClient
|
||||
: null;
|
||||
this.updateSettingsHostDownloadAction = selectedTorrents.every(
|
||||
(m, _, arr) => m.hostDownloadAction === arr[0].hostDownloadAction,
|
||||
)
|
||||
? selectedTorrents[0].hostDownloadAction
|
||||
: null;
|
||||
this.updateSettingsCategory = selectedTorrents.every((m, _, arr) => m.category === arr[0].category)
|
||||
? selectedTorrents[0].category
|
||||
: null;
|
||||
this.updateSettingsPriority = selectedTorrents.every((m, _, arr) => m.priority === arr[0].priority)
|
||||
? selectedTorrents[0].priority
|
||||
: null;
|
||||
this.updateSettingsDownloadRetryAttempts = selectedTorrents.every(
|
||||
(m, _, arr) => m.downloadRetryAttempts === arr[0].downloadRetryAttempts,
|
||||
)
|
||||
? selectedTorrents[0].downloadRetryAttempts
|
||||
: null;
|
||||
this.updateSettingsTorrentRetryAttempts = selectedTorrents.every(
|
||||
(m, _, arr) => m.torrentRetryAttempts === arr[0].torrentRetryAttempts,
|
||||
)
|
||||
? selectedTorrents[0].torrentRetryAttempts
|
||||
: null;
|
||||
this.updateSettingsDeleteOnError = selectedTorrents.every((m, _, arr) => m.deleteOnError === arr[0].deleteOnError)
|
||||
? selectedTorrents[0].deleteOnError
|
||||
: null;
|
||||
this.updateSettingsTorrentLifetime = selectedTorrents.every((m, _, arr) => m.lifetime === arr[0].lifetime)
|
||||
? selectedTorrents[0].lifetime
|
||||
: null;
|
||||
|
||||
this.isChangeSettingsModalActive = true;
|
||||
}
|
||||
|
||||
public changeSettingsCancel(): void {
|
||||
this.isChangeSettingsModalActive = false;
|
||||
}
|
||||
|
||||
public changeSettingsOk(): void {
|
||||
this.changingSettings = true;
|
||||
|
||||
const calls: Observable<void>[] = [];
|
||||
|
||||
const selectedTorrents = this.getSelectedTorrentModels();
|
||||
|
||||
selectedTorrents.forEach((torrent) => {
|
||||
if (this.updateSettingsDownloadClient != null) {
|
||||
torrent.downloadClient = this.updateSettingsDownloadClient;
|
||||
}
|
||||
if (this.updateSettingsHostDownloadAction != null) {
|
||||
torrent.hostDownloadAction = this.updateSettingsHostDownloadAction;
|
||||
}
|
||||
if (this.updateSettingsCategory != null) {
|
||||
torrent.category = this.updateSettingsCategory;
|
||||
}
|
||||
if (this.updateSettingsPriority != null) {
|
||||
torrent.priority = this.updateSettingsPriority;
|
||||
}
|
||||
if (this.updateSettingsDownloadRetryAttempts != null) {
|
||||
torrent.downloadRetryAttempts = this.updateSettingsDownloadRetryAttempts;
|
||||
}
|
||||
if (this.updateSettingsTorrentRetryAttempts != null) {
|
||||
torrent.torrentRetryAttempts = this.updateSettingsTorrentRetryAttempts;
|
||||
}
|
||||
if (this.updateSettingsDeleteOnError != null) {
|
||||
torrent.deleteOnError = this.updateSettingsDeleteOnError;
|
||||
}
|
||||
if (this.updateSettingsTorrentLifetime != null) {
|
||||
torrent.lifetime = this.updateSettingsTorrentLifetime;
|
||||
}
|
||||
|
||||
calls.push(this.torrentService.update(torrent));
|
||||
});
|
||||
|
||||
forkJoin(calls).subscribe({
|
||||
complete: () => {
|
||||
this.isChangeSettingsModalActive = false;
|
||||
this.changingSettings = false;
|
||||
|
||||
this.clearSelectedTorrents();
|
||||
},
|
||||
error: (err) => {
|
||||
this.changeSettingsError = err.error;
|
||||
this.changingSettings = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
toggleDeleteSelectAllOptions() {
|
||||
this.deleteData = this.deleteSelectAll;
|
||||
this.deleteRdTorrent = this.deleteSelectAll;
|
||||
this.deleteLocalFiles = this.deleteSelectAll;
|
||||
}
|
||||
|
||||
updateDeleteSelectAll() {
|
||||
this.deleteSelectAll = this.deleteData && this.deleteRdTorrent && this.deleteLocalFiles;
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.mobileQuery?.removeEventListener('change', this.mobileQueryListener);
|
||||
}
|
||||
|
||||
private setTorrents(torrents: Torrent[]): void {
|
||||
this.torrents = torrents;
|
||||
this.pruneSelectedTorrents();
|
||||
this.applySorting();
|
||||
}
|
||||
|
||||
private applySorting(): void {
|
||||
this.sortedTorrents = sortItems(this.torrents, this.sortProperty, this.sortDirection, (torrent, field) => {
|
||||
switch (field) {
|
||||
case 'files.length':
|
||||
return torrent.filesCount ?? torrent.files?.length ?? 0;
|
||||
case 'downloads.length':
|
||||
return torrent.downloadsCount ?? torrent.downloads?.length ?? 0;
|
||||
case 'status':
|
||||
return torrent.statusText ?? getTorrentStatus(torrent);
|
||||
default:
|
||||
return getSortFieldValue(torrent, field);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getSelectedTorrentModels(): Torrent[] {
|
||||
return this.torrents.filter((torrent) => this.selectedTorrentIds.has(torrent.torrentId));
|
||||
}
|
||||
|
||||
private pruneSelectedTorrents(): void {
|
||||
const torrentIds = new Set(this.torrents.map((torrent) => torrent.torrentId));
|
||||
|
||||
for (const torrentId of this.selectedTorrentIds) {
|
||||
if (!torrentIds.has(torrentId)) {
|
||||
this.selectedTorrentIds.delete(torrentId);
|
||||
}
|
||||
}
|
||||
|
||||
this.syncSelectedTorrents();
|
||||
}
|
||||
|
||||
private clearSelectedTorrents(): void {
|
||||
this.selectedTorrentIds.clear();
|
||||
this.syncSelectedTorrents();
|
||||
}
|
||||
|
||||
private syncSelectedTorrents(): void {
|
||||
this.selectedTorrents = this.torrents
|
||||
.filter((torrent) => this.selectedTorrentIds.has(torrent.torrentId))
|
||||
.map((torrent) => torrent.torrentId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +1,157 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import * as signalR from '@microsoft/signalr';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { Torrent } from './models/torrent.model';
|
||||
import { Torrent, TorrentFileAvailability } from './models/torrent.model';
|
||||
import { DiskSpaceStatus } from './models/disk-space-status.model';
|
||||
import { RateLimitStatus } from './models/rate-limit-status.model';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TorrentService {
|
||||
constructor(private http: HttpClient) {}
|
||||
private http = inject(HttpClient);
|
||||
private baseHref = inject(APP_BASE_HREF);
|
||||
|
||||
public update$: Subject<Torrent[]> = new Subject();
|
||||
public diskSpaceStatus$: Subject<DiskSpaceStatus> = new Subject();
|
||||
public rateLimitStatus$: Subject<RateLimitStatus> = new Subject();
|
||||
|
||||
private connection: signalR.HubConnection;
|
||||
|
||||
constructor() {
|
||||
this.connect();
|
||||
}
|
||||
|
||||
public connect(): void {
|
||||
this.connection = new signalR.HubConnectionBuilder().withUrl('/hub').withAutomaticReconnect().build();
|
||||
this.connection.start().catch((err) => console.error(err));
|
||||
if (this.connection != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl(`${this.baseHref}hub`)
|
||||
.withAutomaticReconnect()
|
||||
.build();
|
||||
|
||||
this.connection.on('update', (torrents: Torrent[]) => {
|
||||
this.update$.next(torrents);
|
||||
});
|
||||
}
|
||||
|
||||
public disconnect(): void {
|
||||
this.connection?.stop();
|
||||
this.connection.on('diskSpaceStatus', (status: any) => {
|
||||
this.diskSpaceStatus$.next(status);
|
||||
});
|
||||
|
||||
this.connection.on('rateLimitStatus', (status: any) => {
|
||||
this.rateLimitStatus$.next(status);
|
||||
});
|
||||
|
||||
this.connection.onreconnected(() => {
|
||||
this.getDiskSpaceStatus().subscribe({
|
||||
next: (status) => {
|
||||
if (status) {
|
||||
this.diskSpaceStatus$.next(status);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
this.connection.start().catch((err) => console.error(err));
|
||||
}
|
||||
|
||||
public getList(): Observable<Torrent[]> {
|
||||
return this.http.get<Torrent[]>(`/Api/Torrents`);
|
||||
return this.http.get<Torrent[]>(`${this.baseHref}Api/Torrents`);
|
||||
}
|
||||
|
||||
public uploadMagnet(
|
||||
magnetLink: string,
|
||||
autoDownload: boolean,
|
||||
autoUnpack: boolean,
|
||||
autoDelete: boolean
|
||||
): Observable<void> {
|
||||
return this.http.post<void>(`/Api/Torrents/UploadMagnet`, {
|
||||
public get(torrentId: string): Observable<Torrent> {
|
||||
return this.http.get<Torrent>(`${this.baseHref}Api/Torrents/Get/${torrentId}`);
|
||||
}
|
||||
|
||||
public getDiskSpaceStatus(): Observable<DiskSpaceStatus | null> {
|
||||
return this.http.get<DiskSpaceStatus | null>(`${this.baseHref}Api/Torrents/DiskSpaceStatus`);
|
||||
}
|
||||
|
||||
public getRateLimitStatus(): Observable<RateLimitStatus | null> {
|
||||
return this.http.get<RateLimitStatus | null>(`${this.baseHref}Api/Torrents/RateLimitStatus`);
|
||||
}
|
||||
|
||||
public uploadMagnet(magnetLink: string, torrent: Torrent): Observable<void> {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/UploadMagnet`, {
|
||||
magnetLink,
|
||||
autoDownload,
|
||||
autoUnpack,
|
||||
autoDelete,
|
||||
torrent,
|
||||
});
|
||||
}
|
||||
|
||||
public uploadFile(file: File, autoDownload: boolean, autoUnpack: boolean, autoDelete: boolean): Observable<void> {
|
||||
public uploadFile(file: File, torrent: Torrent): Observable<void> {
|
||||
const formData: FormData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('formData', JSON.stringify({ autoDownload, autoUnpack, autoDelete }));
|
||||
return this.http.post<void>(`/Api/Torrents/UploadFile`, formData);
|
||||
formData.append('formData', JSON.stringify({ torrent }));
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/UploadFile`, formData);
|
||||
}
|
||||
|
||||
public download(torrentId: string): Observable<void> {
|
||||
return this.http.get<void>(`/Api/Torrents/Download/${torrentId}`);
|
||||
public uploadNzbLink(nzbLink: string, torrent: Torrent): Observable<void> {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/UploadNzbLink`, {
|
||||
nzbLink,
|
||||
torrent,
|
||||
});
|
||||
}
|
||||
|
||||
public unpack(torrentId: string): Observable<void> {
|
||||
return this.http.get<void>(`/Api/Torrents/Unpack/${torrentId}`);
|
||||
public uploadNzbFile(file: File, torrent: Torrent): Observable<void> {
|
||||
const formData: FormData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('formData', JSON.stringify({ torrent }));
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/UploadNzbFile`, formData);
|
||||
}
|
||||
|
||||
public checkFilesMagnet(magnetLink: string): Observable<TorrentFileAvailability[]> {
|
||||
return this.http.post<TorrentFileAvailability[]>(`${this.baseHref}Api/Torrents/CheckFilesMagnet`, {
|
||||
magnetLink,
|
||||
});
|
||||
}
|
||||
|
||||
public checkFiles(file: File): Observable<TorrentFileAvailability[]> {
|
||||
const formData: FormData = new FormData();
|
||||
formData.append('file', file);
|
||||
return this.http.post<TorrentFileAvailability[]>(`${this.baseHref}Api/Torrents/CheckFiles`, formData);
|
||||
}
|
||||
|
||||
public delete(
|
||||
torrentId: string,
|
||||
deleteData: boolean,
|
||||
deleteRdTorrent: boolean,
|
||||
deleteLocalFiles: boolean
|
||||
deleteLocalFiles: boolean,
|
||||
): Observable<void> {
|
||||
return this.http.post<void>(`/Api/Torrents/Delete/${torrentId}`, {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/Delete/${torrentId}`, {
|
||||
deleteData,
|
||||
deleteRdTorrent,
|
||||
deleteLocalFiles,
|
||||
});
|
||||
}
|
||||
|
||||
public retry(torrentId: string): Observable<void> {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/Retry/${torrentId}`, {});
|
||||
}
|
||||
|
||||
public retryDownload(downloadId: string): Observable<void> {
|
||||
return this.http.post<void>(`${this.baseHref}Api/Torrents/RetryDownload/${downloadId}`, {});
|
||||
}
|
||||
|
||||
public update(torrent: Torrent): Observable<void> {
|
||||
return this.http.put<void>(`${this.baseHref}Api/Torrents/Update`, torrent);
|
||||
}
|
||||
|
||||
public verifyRegex(
|
||||
includeRegex: string,
|
||||
excludeRegex: string,
|
||||
magnetLink: string,
|
||||
): Observable<{ includeError: string; excludeError: string; selectedFiles: TorrentFileAvailability[] }> {
|
||||
return this.http.post<{ includeError: string; excludeError: string; selectedFiles: TorrentFileAvailability[] }>(
|
||||
`${this.baseHref}Api/Torrents/VerifyRegex`,
|
||||
{
|
||||
includeRegex,
|
||||
excludeRegex,
|
||||
magnetLink,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
705
client/src/app/torrent/torrent.component.html
Normal file
705
client/src/app/torrent/torrent.component.html
Normal file
|
|
@ -0,0 +1,705 @@
|
|||
<div class="tabs">
|
||||
<ul>
|
||||
<li [ngClass]="{ 'is-active': activeTab === 0 }" (click)="activeTab = 0">
|
||||
<a>General</a>
|
||||
</li>
|
||||
<li [ngClass]="{ 'is-active': activeTab === 1 }" (click)="activeTab = 1">
|
||||
<a>Torrent Files</a>
|
||||
</li>
|
||||
<li [ngClass]="{ 'is-active': activeTab === 2 }" (click)="activeTab = 2">
|
||||
<a>Downloads</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@if (torrent === null || torrent === undefined) {
|
||||
<div>
|
||||
<div class="fa-3x">
|
||||
<i class="fas fa-spinner fa-spin"></i>
|
||||
</div>
|
||||
</div>
|
||||
} @else {
|
||||
<div>
|
||||
@if (activeTab === 0) {
|
||||
<div class="flex-container">
|
||||
<div style="flex: 1 1 0">
|
||||
<div class="field is-grouped is-grouped-multiline action-buttons">
|
||||
<div class="control">
|
||||
<button class="button is-danger" (click)="showDeleteModal()">Delete Torrent</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-primary" (click)="showRetryModal()">Retry Torrent</button>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button is-light" (click)="showUpdateSettingsModal()">Change Settings</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Status</label>
|
||||
{{ torrent | status }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Retry count</label>
|
||||
{{ torrent.retryCount }} / {{ torrent.torrentRetryAttempts }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Hash</label>
|
||||
<span class="break-all">{{ torrent.hash }}</span>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Priority</label>
|
||||
{{ torrent.priority || "" }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Category</label>
|
||||
{{ torrent.category || "(no category set)" }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Downloader</label>
|
||||
@switch (torrent.downloadClient) {
|
||||
@case (0) {
|
||||
Bezadd
|
||||
}
|
||||
@case (1) {
|
||||
Aria2c
|
||||
}
|
||||
@case (2) {
|
||||
Symlink Downloader
|
||||
}
|
||||
@case (3) {
|
||||
Synology DownloadStation
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Post Download Action</label>
|
||||
@switch (torrent.hostDownloadAction) {
|
||||
@case (0) {
|
||||
Download all files to host
|
||||
}
|
||||
@case (1) {
|
||||
Don't download files to host
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Post Torrent Download Action</label>
|
||||
@switch (torrent.downloadAction) {
|
||||
@case (0) {
|
||||
Download all files above a certain size
|
||||
}
|
||||
@case (1) {
|
||||
Download all available files on Real-Debrid above a certain size
|
||||
}
|
||||
@case (2) {
|
||||
Pick files I want to download
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Finished action</label>
|
||||
@switch (torrent.finishedAction) {
|
||||
@case (0) {
|
||||
Do nothing
|
||||
}
|
||||
@case (1) {
|
||||
Remove torrent from Real-Debrid and Real-Debrid Client
|
||||
}
|
||||
@case (2) {
|
||||
Remove torrent from Real-Debrid
|
||||
}
|
||||
@case (3) {
|
||||
Remove torrent from client
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Finished action delay</label>
|
||||
{{ torrent.finishedActionDelay || 0 }}
|
||||
@if (torrent.finishedActionDelay === 1) {
|
||||
minute
|
||||
} @else {
|
||||
minutes
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Minimum file size to download</label>
|
||||
{{ torrent.downloadMinSize }}MB
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Include files</label>
|
||||
{{ torrent.includeRegex }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Exclude files</label>
|
||||
{{ torrent.excludeRegex }}
|
||||
</div>
|
||||
@if (!torrent.isFile) {
|
||||
<div class="field">
|
||||
<label class="label">Magnet</label>
|
||||
@if (!copied) {
|
||||
<span [cdkCopyToClipboard]="torrent.fileOrMagnet" (click)="copied = true">
|
||||
Click to copy magnet link to clipboard
|
||||
</span>
|
||||
} @else {
|
||||
<span>Link copied to clipboard!</span>
|
||||
}
|
||||
</div>
|
||||
} @else {
|
||||
<div class="field">
|
||||
<label class="label">Torrent file</label>
|
||||
<span (click)="download()">Click to download torrent file</span>
|
||||
</div>
|
||||
}
|
||||
<div class="field">
|
||||
<label class="label">Added on</label>
|
||||
{{ torrent.added | date: "fullDate" }} {{ torrent.added | date: "mediumTime" }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Files selected on</label>
|
||||
@if (torrent.filesSelected === null) {
|
||||
(no files selected yet)
|
||||
} @else {
|
||||
{{ torrent.filesSelected | date: "fullDate" }} {{ torrent.filesSelected | date: "mediumTime" }}
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Completed on</label>
|
||||
@if (torrent.completed === null) {
|
||||
(not completed yet)
|
||||
} @else {
|
||||
{{ torrent.completed | date: "fullDate" }} {{ torrent.completed | date: "mediumTime" }}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div style="flex: 1 1 0">
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid ID</label>
|
||||
{{ torrent.rdId }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Name</label>
|
||||
{{ torrent.rdName }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Size</label>
|
||||
{{ torrent.rdSize | filesize }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Host</label>
|
||||
{{ torrent.rdHost }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Split</label>
|
||||
{{ torrent.rdSplit }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Progress</label>
|
||||
{{ torrent.rdProgress || 0 }}%
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Status</label>
|
||||
@switch (torrent.rdStatus) {
|
||||
@case (0) {
|
||||
Processing
|
||||
}
|
||||
@case (1) {
|
||||
Waiting For File Selection
|
||||
}
|
||||
@case (2) {
|
||||
Downloading
|
||||
}
|
||||
@case (3) {
|
||||
Finished
|
||||
}
|
||||
@case (99) {
|
||||
Error
|
||||
}
|
||||
}
|
||||
({{ torrent.rdStatusRaw }})
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Added</label>
|
||||
{{ torrent.rdAdded | date: "fullDate" }} {{ torrent.rdAdded | date: "mediumTime" }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Ended</label>
|
||||
{{ torrent.rdEnded | date: "fullDate" }} {{ torrent.rdEnded | date: "mediumTime" }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Speed</label>
|
||||
{{ torrent.rdSpeed || 0 }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Seeders</label>
|
||||
{{ torrent.rdSeeders || "0" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (activeTab === 1) {
|
||||
<div>
|
||||
<div class="field">
|
||||
<div class="table-container">
|
||||
<table class="table is-fullwidth">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Path</th>
|
||||
<th>Size</th>
|
||||
<th>Selected</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (file of torrent.files; track file.id) {
|
||||
<tr>
|
||||
<td>
|
||||
{{ file.id }}
|
||||
</td>
|
||||
<td class="break-all">
|
||||
{{ file.path }}
|
||||
</td>
|
||||
<td>
|
||||
{{ file.bytes | filesize }}
|
||||
</td>
|
||||
<td>
|
||||
@if (file.selected) {
|
||||
<i class="fas fa-check" style="color: green"></i>
|
||||
} @else {
|
||||
<i class="fas fa-times" style="color: red"></i>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (activeTab === 2) {
|
||||
<div>
|
||||
<div class="field">
|
||||
<div class="table-container">
|
||||
<table class="table is-fullwidth is-hoverable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 35px"></th>
|
||||
<th>Link</th>
|
||||
<th>Size</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (download of torrent.downloads; track download.downloadId) {
|
||||
@let expanded = downloadExpanded[download.downloadId];
|
||||
<tr (click)="downloadExpanded[download.downloadId] = !expanded">
|
||||
<td style="width: 35px">
|
||||
@if (!expanded) {
|
||||
<i class="fas fa-caret-right"></i>
|
||||
} @else {
|
||||
<i class="fas fa-caret-down"></i>
|
||||
}
|
||||
</td>
|
||||
<td class="break-all">
|
||||
@if (download.link) {
|
||||
{{ download.link | decodeURI }}
|
||||
}
|
||||
@if (!download.link) {
|
||||
{{ download.path }}
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
{{ download.bytesTotal | filesize }}
|
||||
</td>
|
||||
<td>
|
||||
{{ download | downloadStatus }}
|
||||
</td>
|
||||
</tr>
|
||||
@if (expanded) {
|
||||
<tr class="separator">
|
||||
<td style="width: 35px"></td>
|
||||
<td colspan="5">
|
||||
<div class="flex-container">
|
||||
<div style="flex: 1 1 0">
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-primary" (click)="showDownloadRetryModal(download.downloadId)">
|
||||
Retry Download
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@if (download.error) {
|
||||
<div class="field">
|
||||
<label class="label">Error</label>
|
||||
{{ download.error }}
|
||||
</div>
|
||||
}
|
||||
<div class="field">
|
||||
<label class="label">Real-Debrid Unrestricted Link</label>
|
||||
@if (download.link) {
|
||||
<a class="break-all" href="{{ download.link }}" target="_blank"> {{ download.link | decodeURI }}</a>
|
||||
}
|
||||
</div>
|
||||
<div class="field break-all">
|
||||
<label class="label">Real-Debrid Link</label>
|
||||
{{ download.path }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Download</label>
|
||||
{{ download.bytesDone | filesize }} / {{ download.bytesTotal | filesize }} ({{
|
||||
download.speed | filesize
|
||||
}}/s)
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Retry Count</label>
|
||||
{{ download.retryCount }} / {{ torrent.downloadRetryAttempts }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="flex: 1 1 0">
|
||||
<div class="field">
|
||||
<label class="label">Added</label>
|
||||
@if (download.added) {
|
||||
{{ download.added | date: "fullDate" }} {{ download.added | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not added yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Download Queued</label>
|
||||
@if (download.downloadQueued) {
|
||||
{{ download.downloadQueued | date: "fullDate" }}
|
||||
{{ download.downloadQueued | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not queued for downloading yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Download Started</label>
|
||||
@if (download.downloadStarted) {
|
||||
{{ download.downloadStarted | date: "fullDate" }}
|
||||
{{ download.downloadStarted | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not started downloading yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Download Finished</label>
|
||||
@if (download.downloadFinished) {
|
||||
{{ download.downloadFinished | date: "fullDate" }}
|
||||
{{ download.downloadFinished | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not finished yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Unpacking Queued</label>
|
||||
@if (download.unpackingQueued) {
|
||||
{{ download.unpackingQueued | date: "fullDate" }}
|
||||
{{ download.unpackingQueued | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not queued for unpacking yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Unpacking Started</label>
|
||||
@if (download.unpackingStarted) {
|
||||
{{ download.unpackingStarted | date: "fullDate" }}
|
||||
{{ download.unpackingStarted | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not started unpacking yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Unpacking Finished</label>
|
||||
@if (download.unpackingFinished) {
|
||||
{{ download.unpackingFinished | date: "fullDate" }}
|
||||
{{ download.unpackingFinished | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not finished unpacking yet)
|
||||
}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Completed</label>
|
||||
@if (download.completed) {
|
||||
{{ download.completed | date: "fullDate" }}
|
||||
{{ download.completed | date: "mediumTime" }}
|
||||
} @else {
|
||||
(not completed yet)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="modal" [class.is-active]="isDeleteModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Delete torrent</p>
|
||||
<button class="delete" aria-label="close" (click)="deleteCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<p>Are you sure you want to delete this torrent?</p>
|
||||
<div class="field">
|
||||
<label class="label"></label>
|
||||
<div class="control">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteData" (change)="updateDeleteSelectAll()" />
|
||||
Delete Torrent from client
|
||||
</label>
|
||||
<br />
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteRdTorrent" (change)="updateDeleteSelectAll()" />
|
||||
Delete Torrent from provider
|
||||
</label>
|
||||
<br />
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteLocalFiles" (change)="updateDeleteSelectAll()" />
|
||||
Delete local files
|
||||
</label>
|
||||
<br />
|
||||
<br />
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" [(ngModel)]="deleteSelectAll" (change)="toggleDeleteSelectAllOptions()" />
|
||||
Select All
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="notification is-primary">
|
||||
Deleting a torrent from Real-Debrid will automatically delete it here too.
|
||||
</div>
|
||||
@if (deleteError?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error deleting torrent: {{ deleteError }}</div>
|
||||
}
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="deleteOk()"
|
||||
[disabled]="deleting"
|
||||
[ngClass]="{ 'is-loading': deleting }"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
<button class="button" (click)="deleteCancel()" [disabled]="deleting" [ngClass]="{ 'is-loading': deleting }">
|
||||
Cancel
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" [class.is-active]="isRetryModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Retry torrent</p>
|
||||
<button class="delete" aria-label="close" (click)="retryCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<p>Are you sure you want to retry this torrent?</p>
|
||||
<p>
|
||||
This action will delete all the torrent data + all local downloads. Then it will re-add the original magnet link
|
||||
or torrent file to Real-Debrid.
|
||||
</p>
|
||||
@if (retryError?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error retrying torrent: {{ retryError }}</div>
|
||||
}
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="retryOk()"
|
||||
[disabled]="retrying"
|
||||
[ngClass]="{ 'is-loading': retrying }"
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
<button class="button" (click)="retryCancel()" [disabled]="retrying" [ngClass]="{ 'is-loading': retrying }">
|
||||
Cancel
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" [class.is-active]="isDownloadRetryModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Retry download</p>
|
||||
<button class="delete" aria-label="close" (click)="downloadRetryCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<p>Are you sure you want to retry this download?</p>
|
||||
<p>This action will remove the local download and re-download the file from Real-Debrid.</p>
|
||||
@if (downloadRetryError?.length > 0) {
|
||||
<div class="notification is-danger is-light">Error retrying download: {{ downloadRetryError }}</div>
|
||||
}
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="downloadRetryOk()"
|
||||
[disabled]="downloadRetrying"
|
||||
[ngClass]="{ 'is-loading': downloadRetrying }"
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
<button
|
||||
class="button"
|
||||
(click)="downloadRetryCancel()"
|
||||
[disabled]="downloadRetrying"
|
||||
[ngClass]="{ 'is-loading': downloadRetrying }"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" [class.is-active]="isUpdateSettingsModalActive">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Update torrent settings</p>
|
||||
<button class="delete" aria-label="close" (click)="updateSettingsCancel()"></button>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<p>
|
||||
Settings that are blank do not have the same values for each torrent. Updating a setting with a blank value will
|
||||
not update it.
|
||||
</p>
|
||||
<div class="field">
|
||||
<label class="label">Downloader</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="updateSettingsDownloadClient">
|
||||
<option [ngValue]="0">Bezzad</option>
|
||||
<option [ngValue]="1">Aria2c</option>
|
||||
<option [ngValue]="2">Symlink Downloader</option>
|
||||
<option [ngValue]="3">Synology DownloadStation</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">
|
||||
Select which downloader is used to download this torrent from the debrid provider to your host.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Post Download Action</label>
|
||||
<div class="control select is-fullwidth">
|
||||
<select [(ngModel)]="updateSettingsHostDownloadAction">
|
||||
<option [ngValue]="null"></option>
|
||||
<option [ngValue]="0">Download all files to host</option>
|
||||
<option [ngValue]="1">Don't download any files to host</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help">
|
||||
When a torrent is finished downloading on the provider, perform this action. Use this setting if you only want
|
||||
to add files to Real-Debrid but not download them to the host.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Category</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" [(ngModel)]="updateSettingsCategory" />
|
||||
</div>
|
||||
<p class="help">The category becomes a sub-folder in your main download path.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Priority</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" step="1" [(ngModel)]="updateSettingsPriority" />
|
||||
</div>
|
||||
<p class="help">
|
||||
Set the priority for this torrent where 1 is the highest. When empty it will be assigned the lowest priority.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Automatic retry downloads</label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
max="1000"
|
||||
min="0"
|
||||
step="1"
|
||||
[(ngModel)]="updateSettingsDownloadRetryAttempts"
|
||||
/>
|
||||
</div>
|
||||
<p class="help">When a single download fails it will retry it this many times before marking it as failed.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Automatic retry torrent</label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
max="1000"
|
||||
min="0"
|
||||
step="1"
|
||||
[(ngModel)]="updateSettingsTorrentRetryAttempts"
|
||||
/>
|
||||
</div>
|
||||
<p class="help">
|
||||
When a single download has failed multiple times (see setting above) or when the torrent itself received an
|
||||
error it will retry the full torrent this many times before marking it failed.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Delete download when in error</label>
|
||||
<div class="control">
|
||||
<input class="input" type="number" max="1000" min="0" step="1" [(ngModel)]="updateSettingsDeleteOnError" />
|
||||
</div>
|
||||
<p class="help">
|
||||
When a download has been in error for this many minutes, delete it from the provider and the client. 0 to
|
||||
disable.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Torrent maximum lifetime</label>
|
||||
<div class="control">
|
||||
<input
|
||||
class="input"
|
||||
type="number"
|
||||
max="100000"
|
||||
min="0"
|
||||
step="1"
|
||||
[(ngModel)]="updateSettingsTorrentLifetime"
|
||||
/>
|
||||
</div>
|
||||
<p class="help">
|
||||
The maximum lifetime of a torrent in minutes. When this time has passed, mark the torrent as error. If the
|
||||
torrent is completed and has downloads, the lifetime setting will not apply. 0 to disable.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<button
|
||||
class="button is-success"
|
||||
(click)="updateSettingsOk()"
|
||||
[disabled]="updating"
|
||||
[ngClass]="{ 'is-loading': updating }"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
<button
|
||||
class="button"
|
||||
(click)="updateSettingsCancel()"
|
||||
[disabled]="updating"
|
||||
[ngClass]="{ 'is-loading': updating }"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
45
client/src/app/torrent/torrent.component.scss
Normal file
45
client/src/app/torrent/torrent.component.scss
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
.label {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.break-all {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
display: flex;
|
||||
flex: 1 1 0;
|
||||
gap: 20px;
|
||||
flex-direction: row;
|
||||
|
||||
@media screen and (max-width: 1279px) {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.action-buttons {
|
||||
.control {
|
||||
width: 100%;
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabs ul {
|
||||
flex-wrap: wrap;
|
||||
|
||||
li {
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
276
client/src/app/torrent/torrent.component.ts
Normal file
276
client/src/app/torrent/torrent.component.ts
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { saveAs } from 'file-saver-es';
|
||||
import { Torrent } from '../models/torrent.model';
|
||||
import { TorrentService } from '../torrent.service';
|
||||
import { NgClass, DatePipe } from '@angular/common';
|
||||
import { CdkCopyToClipboard } from '@angular/cdk/clipboard';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { TorrentStatusPipe } from '../torrent-status.pipe';
|
||||
import { DownloadStatusPipe } from '../download-status.pipe';
|
||||
import { DecodeURIPipe } from '../decode-uri.pipe';
|
||||
import { FileSizePipe } from '../filesize.pipe';
|
||||
import { EMPTY, distinctUntilChanged, map, switchMap, tap, catchError } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-torrent',
|
||||
templateUrl: './torrent.component.html',
|
||||
styleUrls: ['./torrent.component.scss'],
|
||||
imports: [
|
||||
NgClass,
|
||||
CdkCopyToClipboard,
|
||||
FormsModule,
|
||||
DatePipe,
|
||||
TorrentStatusPipe,
|
||||
DownloadStatusPipe,
|
||||
DecodeURIPipe,
|
||||
FileSizePipe,
|
||||
],
|
||||
standalone: true,
|
||||
})
|
||||
export class TorrentComponent implements OnInit {
|
||||
private destroyRef = inject(DestroyRef);
|
||||
private activatedRoute = inject(ActivatedRoute);
|
||||
private router = inject(Router);
|
||||
private torrentService = inject(TorrentService);
|
||||
private currentTorrentId: string | null = null;
|
||||
|
||||
public torrent: Torrent;
|
||||
|
||||
public activeTab: number = 0;
|
||||
|
||||
public copied: boolean = false;
|
||||
|
||||
public downloadExpanded: { [downloadId: string]: boolean } = {};
|
||||
|
||||
public isDeleteModalActive: boolean;
|
||||
public deleteError: string;
|
||||
public deleting: boolean;
|
||||
public deleteSelectAll: boolean;
|
||||
public deleteData: boolean;
|
||||
public deleteRdTorrent: boolean;
|
||||
public deleteLocalFiles: boolean;
|
||||
|
||||
public isRetryModalActive: boolean;
|
||||
public retryError: string;
|
||||
public retrying: boolean;
|
||||
|
||||
public isDownloadRetryModalActive: boolean;
|
||||
public downloadRetryError: string;
|
||||
public downloadRetrying: boolean;
|
||||
public downloadRetryId: string;
|
||||
|
||||
public isUpdateSettingsModalActive: boolean;
|
||||
|
||||
public updateSettingsDownloadClient: number;
|
||||
public updateSettingsHostDownloadAction: number;
|
||||
public updateSettingsCategory: string;
|
||||
public updateSettingsPriority: number;
|
||||
public updateSettingsDownloadRetryAttempts: number;
|
||||
public updateSettingsTorrentRetryAttempts: number;
|
||||
public updateSettingsDeleteOnError: number;
|
||||
public updateSettingsTorrentLifetime: number;
|
||||
|
||||
public updating: boolean;
|
||||
|
||||
ngOnInit(): void {
|
||||
this.activatedRoute.params
|
||||
.pipe(
|
||||
map((params) => params['id'] as string),
|
||||
distinctUntilChanged(),
|
||||
tap((torrentId) => {
|
||||
this.currentTorrentId = torrentId;
|
||||
}),
|
||||
switchMap((torrentId) =>
|
||||
this.torrentService.get(torrentId).pipe(
|
||||
catchError(() => {
|
||||
this.router.navigate(['/']);
|
||||
return EMPTY;
|
||||
}),
|
||||
),
|
||||
),
|
||||
takeUntilDestroyed(this.destroyRef),
|
||||
)
|
||||
.subscribe((torrent) => {
|
||||
this.torrent = torrent;
|
||||
this.currentTorrentId = torrent.torrentId;
|
||||
});
|
||||
|
||||
this.torrentService.update$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((result) => {
|
||||
this.update(result);
|
||||
});
|
||||
}
|
||||
|
||||
public update(torrents: Torrent[]): void {
|
||||
const torrentId = this.currentTorrentId ?? this.torrent?.torrentId;
|
||||
|
||||
if (!torrentId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updatedTorrent = torrents.find((m) => m.torrentId === torrentId);
|
||||
|
||||
if (updatedTorrent == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentTorrent = this.torrent;
|
||||
const hasIncomingFiles = Array.isArray(updatedTorrent.files) && updatedTorrent.files.length > 0;
|
||||
|
||||
this.torrent = {
|
||||
...currentTorrent,
|
||||
...updatedTorrent,
|
||||
fileOrMagnet: updatedTorrent.fileOrMagnet ?? currentTorrent?.fileOrMagnet,
|
||||
files: hasIncomingFiles ? updatedTorrent.files : currentTorrent?.files ?? [],
|
||||
downloads: updatedTorrent.downloads ?? currentTorrent?.downloads ?? [],
|
||||
};
|
||||
}
|
||||
|
||||
public download(): void {
|
||||
const binaryString = window.atob(this.torrent.fileOrMagnet);
|
||||
const byteArray = new Uint8Array(binaryString.length);
|
||||
|
||||
for (let index = 0; index < binaryString.length; index += 1) {
|
||||
byteArray[index] = binaryString.charCodeAt(index);
|
||||
}
|
||||
|
||||
const blob = new Blob([byteArray], { type: 'application/x-bittorrent' });
|
||||
saveAs(blob, `${this.torrent.rdName}.torrent`);
|
||||
}
|
||||
|
||||
public showDeleteModal(): void {
|
||||
this.deleteData = false;
|
||||
this.deleteRdTorrent = false;
|
||||
this.deleteLocalFiles = false;
|
||||
this.deleteError = null;
|
||||
|
||||
this.isDeleteModalActive = true;
|
||||
}
|
||||
|
||||
public deleteCancel(): void {
|
||||
this.isDeleteModalActive = false;
|
||||
}
|
||||
|
||||
public deleteOk(): void {
|
||||
this.deleting = true;
|
||||
|
||||
this.torrentService
|
||||
.delete(this.torrent.torrentId, this.deleteData, this.deleteRdTorrent, this.deleteLocalFiles)
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.isDeleteModalActive = false;
|
||||
this.deleting = false;
|
||||
|
||||
this.router.navigate(['/']);
|
||||
},
|
||||
error: (err) => {
|
||||
this.deleteError = err.error;
|
||||
this.deleting = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public showRetryModal(): void {
|
||||
this.retryError = null;
|
||||
|
||||
this.isRetryModalActive = true;
|
||||
}
|
||||
|
||||
public retryCancel(): void {
|
||||
this.isRetryModalActive = false;
|
||||
}
|
||||
|
||||
public retryOk(): void {
|
||||
this.retrying = true;
|
||||
|
||||
this.torrentService.retry(this.torrent.torrentId).subscribe({
|
||||
next: () => {
|
||||
this.isRetryModalActive = false;
|
||||
this.retrying = false;
|
||||
|
||||
this.router.navigate(['/']);
|
||||
},
|
||||
error: (err) => {
|
||||
this.retryError = err.error;
|
||||
this.retrying = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public showDownloadRetryModal(downloadId: string): void {
|
||||
this.downloadRetryId = downloadId;
|
||||
this.downloadRetryError = null;
|
||||
|
||||
this.isDownloadRetryModalActive = true;
|
||||
}
|
||||
|
||||
public downloadRetryCancel(): void {
|
||||
this.isDownloadRetryModalActive = false;
|
||||
}
|
||||
|
||||
public downloadRetryOk(): void {
|
||||
this.downloadRetrying = true;
|
||||
|
||||
this.torrentService.retryDownload(this.downloadRetryId).subscribe({
|
||||
next: () => {
|
||||
this.isDownloadRetryModalActive = false;
|
||||
this.downloadRetrying = false;
|
||||
},
|
||||
error: (err) => {
|
||||
this.downloadRetryError = err.error;
|
||||
this.downloadRetrying = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public showUpdateSettingsModal(): void {
|
||||
this.updateSettingsDownloadClient = this.torrent.downloadClient;
|
||||
this.updateSettingsHostDownloadAction = this.torrent.hostDownloadAction;
|
||||
this.updateSettingsCategory = this.torrent.category;
|
||||
this.updateSettingsPriority = this.torrent.priority;
|
||||
this.updateSettingsDownloadRetryAttempts = this.torrent.downloadRetryAttempts;
|
||||
this.updateSettingsTorrentRetryAttempts = this.torrent.torrentRetryAttempts;
|
||||
this.updateSettingsDeleteOnError = this.torrent.deleteOnError;
|
||||
this.updateSettingsTorrentLifetime = this.torrent.lifetime;
|
||||
|
||||
this.isUpdateSettingsModalActive = true;
|
||||
}
|
||||
|
||||
public updateSettingsCancel(): void {
|
||||
this.isUpdateSettingsModalActive = false;
|
||||
}
|
||||
|
||||
public updateSettingsOk(): void {
|
||||
this.updating = true;
|
||||
|
||||
this.torrent.downloadClient = this.updateSettingsDownloadClient;
|
||||
this.torrent.hostDownloadAction = this.updateSettingsHostDownloadAction;
|
||||
this.torrent.category = this.updateSettingsCategory;
|
||||
this.torrent.priority = this.updateSettingsPriority;
|
||||
this.torrent.downloadRetryAttempts = this.updateSettingsDownloadRetryAttempts;
|
||||
this.torrent.torrentRetryAttempts = this.updateSettingsTorrentRetryAttempts;
|
||||
this.torrent.deleteOnError = this.updateSettingsDeleteOnError;
|
||||
this.torrent.lifetime = this.updateSettingsTorrentLifetime;
|
||||
|
||||
this.torrentService.update(this.torrent).subscribe({
|
||||
next: () => {
|
||||
this.isUpdateSettingsModalActive = false;
|
||||
this.updating = false;
|
||||
},
|
||||
error: () => {
|
||||
this.isUpdateSettingsModalActive = false;
|
||||
this.updating = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
toggleDeleteSelectAllOptions() {
|
||||
this.deleteData = this.deleteSelectAll;
|
||||
this.deleteRdTorrent = this.deleteSelectAll;
|
||||
this.deleteLocalFiles = this.deleteSelectAll;
|
||||
}
|
||||
|
||||
updateDeleteSelectAll() {
|
||||
this.deleteSelectAll = this.deleteData && this.deleteRdTorrent && this.deleteLocalFiles;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class UsersService {
|
||||
constructor() {}
|
||||
|
||||
public getLoggedInUser() {}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// This file can be replaced during build by using the `fileReplacements` array.
|
||||
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
||||
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
|
||||
// The list of file replacements can be found in `angular.json`.
|
||||
|
||||
export const environment = {
|
||||
|
|
@ -13,4 +13,4 @@ export const environment = {
|
|||
* This import should be commented out in production mode because it will have a negative impact
|
||||
* on performance if an error is thrown.
|
||||
*/
|
||||
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
||||
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Real-Debrid Torrent Client</title>
|
||||
<base href="/" />
|
||||
<script>
|
||||
(function () {
|
||||
const baseElement = document.querySelector("base");
|
||||
|
||||
if (baseElement) {
|
||||
window["_app_base"] = baseElement.getAttribute("href");
|
||||
console.log("setting base href to " + window["_app_base"]);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,28 @@
|
|||
import { enableProdMode } from '@angular/core';
|
||||
import { enableProdMode, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
import { FileSizePipe } from './app/filesize.pipe';
|
||||
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { AuthInterceptor } from './app/auth.interceptor';
|
||||
import { APP_BASE_HREF } from '@angular/common';
|
||||
import { BrowserModule, bootstrapApplication } from '@angular/platform-browser';
|
||||
import { AppRoutingModule } from './app/app-routing.module';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { ClipboardModule } from '@angular/cdk/clipboard';
|
||||
import { AppComponent } from './app/app.component';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.catch((err) => console.error(err));
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
provideZoneChangeDetection(),
|
||||
importProvidersFrom(BrowserModule, AppRoutingModule, FormsModule, ClipboardModule),
|
||||
FileSizePipe,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
|
||||
{ provide: APP_BASE_HREF, useValue: (window as any)['_app_base'] || '/' },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
}).catch((err) => console.error(err));
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
* file.
|
||||
*
|
||||
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
||||
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||||
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||||
* automatically update themselves. This includes recent versions of Safari, Chrome (including
|
||||
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
|
||||
*
|
||||
* Learn more in https://angular.io/guide/browser-support
|
||||
*/
|
||||
|
|
@ -18,16 +18,6 @@
|
|||
* BROWSER POLYFILLS
|
||||
*/
|
||||
|
||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
|
||||
/**
|
||||
* Web Animations `@angular/platform-browser/animations`
|
||||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||
*/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
||||
|
|
@ -55,7 +45,7 @@
|
|||
/***************************************************************************************************
|
||||
* Zone JS is required by default for Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
import 'zone.js'; // Included with Angular CLI.
|
||||
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
@import "../node_modules/bulma/bulma.sass";
|
||||
@import "../node_modules/@fortawesome/fontawesome-free/css/all.css";
|
||||
@forward "../node_modules/bulma/bulma.scss";
|
||||
@forward "../node_modules/@fortawesome/fontawesome-free/css/all.css";
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
||||
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
declare const require: {
|
||||
context(
|
||||
path: string,
|
||||
deep?: boolean,
|
||||
filter?: RegExp
|
||||
): {
|
||||
keys(): string[];
|
||||
<T>(id: string): T;
|
||||
};
|
||||
};
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
||||
// Then we find all the tests.
|
||||
const context = require.context('./', true, /\.spec\.ts$/);
|
||||
// And load the modules.
|
||||
context.keys().map(context);
|
||||
|
|
@ -1,14 +1,10 @@
|
|||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/app",
|
||||
"types": []
|
||||
},
|
||||
"files": [
|
||||
"src/main.ts",
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
"files": ["src/main.ts", "src/polyfills.ts"],
|
||||
"include": ["src/**/*.d.ts"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,30 @@
|
|||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"outDir": "./dist/out-tsc",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"downlevelIteration": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"importHelpers": true,
|
||||
"target": "es2015",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"dom"
|
||||
]
|
||||
"strictNullChecks": false,
|
||||
"target": "ES2022",
|
||||
"module": "es2020",
|
||||
"useDefineForClassFields": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"fullTemplateTypeCheck": true,
|
||||
"strictInjectionParameters": true
|
||||
"enableI18nLegacyMessageIdFormat": false,
|
||||
"strictInjectionParameters": true,
|
||||
"strictInputAccessModifiers": true,
|
||||
"strictTemplates": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"src/test.ts",
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
{
|
||||
"extends": "tslint:recommended",
|
||||
"rules": {
|
||||
"align": {
|
||||
"options": ["parameters", "statements"]
|
||||
},
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": true,
|
||||
"curly": true,
|
||||
"deprecation": {
|
||||
"severity": "warning"
|
||||
},
|
||||
"component-class-suffix": true,
|
||||
"contextual-lifecycle": true,
|
||||
"directive-class-suffix": true,
|
||||
"directive-selector": [true, "attribute", "app", "camelCase"],
|
||||
"component-selector": [true, "element", "app", "kebab-case"],
|
||||
"eofline": true,
|
||||
"import-blacklist": [true, "rxjs/Rx"],
|
||||
"import-spacing": true,
|
||||
"indent": {
|
||||
"options": ["spaces"]
|
||||
},
|
||||
"max-classes-per-file": false,
|
||||
"max-line-length": [true, 140],
|
||||
"member-ordering": [
|
||||
true,
|
||||
{
|
||||
"order": [
|
||||
"static-field",
|
||||
"instance-field",
|
||||
"static-method",
|
||||
"instance-method"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
|
||||
"no-empty": false,
|
||||
"no-inferrable-types": [true, "ignore-params"],
|
||||
"no-non-null-assertion": true,
|
||||
"no-redundant-jsdoc": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-var-requires": false,
|
||||
"object-literal-key-quotes": [true, "as-needed"],
|
||||
"quotemark": [true, "single"],
|
||||
"semicolon": {
|
||||
"options": ["always"]
|
||||
},
|
||||
"space-before-function-paren": {
|
||||
"options": {
|
||||
"anonymous": "never",
|
||||
"asyncArrow": "always",
|
||||
"constructor": "never",
|
||||
"method": "never",
|
||||
"named": "never"
|
||||
}
|
||||
},
|
||||
"typedef-whitespace": {
|
||||
"options": [
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
},
|
||||
{
|
||||
"call-signature": "onespace",
|
||||
"index-signature": "onespace",
|
||||
"parameter": "onespace",
|
||||
"property-declaration": "onespace",
|
||||
"variable-declaration": "onespace"
|
||||
}
|
||||
]
|
||||
},
|
||||
"variable-name": {
|
||||
"options": ["ban-keywords", "check-format", "allow-pascal-case"]
|
||||
},
|
||||
"whitespace": {
|
||||
"options": [
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type",
|
||||
"check-typecast"
|
||||
]
|
||||
},
|
||||
"no-conflicting-lifecycle": true,
|
||||
"no-host-metadata-property": true,
|
||||
"no-input-rename": true,
|
||||
"no-inputs-metadata-property": true,
|
||||
"no-output-native": true,
|
||||
"no-output-on-prefix": true,
|
||||
"no-output-rename": true,
|
||||
"no-outputs-metadata-property": true,
|
||||
"template-banana-in-box": true,
|
||||
"template-no-negated-async": true,
|
||||
"use-lifecycle-interface": true,
|
||||
"use-pipe-transform-interface": true
|
||||
},
|
||||
"rulesDirectory": ["codelyzer"]
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
docker stop rdtclient
|
||||
docker rm rdtclient
|
||||
docker build --tag rdtclient .
|
||||
docker-compose up -d
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
version: '3.3'
|
||||
services:
|
||||
rdtclient:
|
||||
image: rogerfar/rdtclient
|
||||
volumes:
|
||||
- 'C:/Downloads/:/data/downloads'
|
||||
- 'C:/Docker/rdtclient/:/data/db'
|
||||
container_name: rdtclient
|
||||
restart: always
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
ports:
|
||||
- '6500:6500'
|
||||
|
|
@ -1 +0,0 @@
|
|||
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag rogerfar/rdtclient .
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
cd client
|
||||
npm install
|
||||
ng build --prod --output-path=..\server\RdtClient.Web\wwwroot
|
||||
|
||||
cd ..
|
||||
cd server
|
||||
dotnet build -c Release
|
||||
dotnet publish -c Release -o ..\out
|
||||
|
||||
cd ..
|
||||
cd out
|
||||
|
||||
Add-Type -Assembly System.IO.Compression.FileSystem
|
||||
$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
|
||||
$location = Get-Location
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($location, "$location/../release.zip", $compressionLevel, $false)
|
||||
|
||||
cd ..
|
||||
|
||||
Remove-Item -Path out -Recurse -Force
|
||||
13
root/etc/s6-overlay/s6-rc.d/init-rdt-client/run
Executable file
13
root/etc/s6-overlay/s6-rc.d/init-rdt-client/run
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# cleanup pid if it exists
|
||||
[[ -e /config/rtdclient.pid ]] && \
|
||||
rm -rf /config/rtdclient.pid
|
||||
|
||||
[[ -e /data/rtdclient.pid ]] && \
|
||||
rm -rf /data/rtdclient.pid
|
||||
|
||||
# permissions
|
||||
echo "Setting permissions"
|
||||
chown -R abc:abc \
|
||||
/app /data
|
||||
1
root/etc/s6-overlay/s6-rc.d/init-rdt-client/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/init-rdt-client/type
Normal file
|
|
@ -0,0 +1 @@
|
|||
oneshot
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue